content
stringlengths
7
2.61M
Explaining the increased mortality in type 1 diabetes. Despite large improvements in the management of glucose levels and in the treatment of cardiovascular risk factors, the mortality rate in individuals with type 1 diabetes (T1D) is still high. Recently, Lind et al found that T1D individuals with glycated hemoglobin levels of 6.9% or lower had a risk of death from any cause or from cardiovascular causes that is twice as high as the risk for matched controls. T1D is a chronic disease with an early onset (e.g., pediatric age) and thus in order to establish a clear correlation between death rate and the glycometabolic control, the whole history of glycemic control should be considered; particularly in the early years of diabetes. The switch from a normo- to hyperglycemic milieu in an individual with T1D in the pediatric age, represents a stressful event that may impact outcomes and death rate many years later. In this paper we will discuss the aforementioned issues, and offer our view on these findings, paying a particular attention to the several alterations occurring in the earliest phases of T1D and to the many factors that may be associated with the chronic history of T1D. This may help us to better understand the recently published death rate data and to develop future innovative and effective preventive strategies. INTRODUCTION Whether mortality in type 1 diabetes mellitus (T1D) is improved by intensive glycemic therapy has not been clarified yet. A number of studies have recently been published claiming that mortality rate is still higher than in age-matched controls without diabetes, despite improvements in management of glucose levels and treatment of cardiovascular risk factors. Lind et al reported data on current life expectancy for adults with T1D in a population-based sample using Swedish national registries of adults with and without diabetes. The Authors found that individuals with T1D and glycated hemoglobin (HbA1c) level of 6.9% or lower had a risk of death from any cause or from cardiovascular causes that was twice as high as the risk for matched controls. The multivariable-adjusted hazard ratios for death from any cause according to the HbA1c level for individuals with T1D as compared with controls are reported in Table 1. Livingstone et al report data on current life expectancy for adults with T1D in a population-based sample using Scottish national registries of adults with and without diabetes. At the age of 20 years, women and men with T1D could expect to live 12.9 years (95%CI: 11.7-14.1) and 11.1 years (95%CI: 10.1-12.1), respectively, less than aged-matched adults without it. Finally, Orchard et al report survival data on the selective cohort of North Americans with T1D who participated in the Diabetes Control and Complications Trial (DCCT) and its observational followup study, Epidemiology of Diabetes Interventions and Complications (EDIC). They found that 27 years after entry into the trial, 6.5 years of initial intensive diabetes therapy was associated with a modestly lower all-cause mortality rate when compared with conventional therapy. Few editorials accompanied or commented these data, without suggesting any conclusive hypothesis about the reason why this happens. T1D is known to be associated with an increased risk of premature mortality among the affected individuals, as documented by a recent systematic review on this topic by Morgan et al. Authors identified thirteen relevant publications with mortality data, describing 23 independent studies. Standardized mortality ratios varied markedly (P < 0.0001). The increased mortality in childhood/adolescentdiagnosed with T1D was apparent across countries worldwide. Excesses were less marked in more recent studies and in countries with lower infant mortality and higher health expenditure. Given that good metabolic control has been shown to be effective reducing microvascular and macrovascular complication rates, one should expect that also the mortality rate might be reduced, but this is not the case. Therefore, we would like to propose our appraisal to these important findings. YEARS OF T1D All studies reporting mortality rates in T1D refer to adult individuals, most of the time with a diabetes which occurred in childhood. For instance all individuals studied in the Lind paper were at least 18-year-old at the moment of enrollment, with a mean age at baseline of 35.8 years and mean diabetes duration of 20.4 years. This implies that the average age for the onset of diabetes was 15.4 years, during their adolescence. The study does not provide any information at all with respect to HbA1c levels between diabetes onset and the time of data collection (on average 40 to 50 years after T1D diagnosis). From previous studies, (e.g., DCCT and EDIC), we know how "metabolic memory" provides an important footprinting to future long-term complications. We can thus argue that "metabolic memory" may partially be accounted for the higher death rate observed in individuals with T1D, whose onset was during childhood or adolescence. This aforementioned aspect reinforces the important of obtaining an optimal glycometabolic control in the first years of T1D. This is an important issue, since T1D incidence rate increases from birth, and peaks between the ages 10-14 years, with an even increased incidence especially marked in the youngest children (0-4 years), making T1D the second most frequent chronic disease of childhood, after asthma. Further emphasis should be pointed to vascular complications, which start at the onset of the disease, although the consequences become clinically evident later in adulthood. Once again, we may speculate that the reported excess mortality in adult individuals showing HbA1C < 6.9% in the study by Lind et al, may be the residual effect of previous cardiovascular insults started in infancy, childhood or adolescence. It is still unclear and partially unexplained why cardiovascular complications start so early in the disease history of T1D; indeed we can only speculate that a chronic state of mild hyperglycemia might be the culprit of cardiovascular morbidity, and thereby of excess death, as unaccounted in the Swedish observational trial. Indeed, according the A1c-Derived Average Glucose study group, a HbA1c value of 6.9% indicate an average glucose level as high as 151 mg/dL (8.4 mmol/L). Additionally, the HbA1c measurement has some limitations itself. It has been shown to be unreliable in several different clinical scenarios, such as anemia or hemolysis, in presence of implanted mechanical heart valves, hypothyroidism, or during the use of medications such as erythropoietin. Moreover, there is a recognized biological variability in the glycation process of the hemoglobin molecule in response to hyperglycemia. This is the result of a different glycation rate in "high glycating" vs "low glycating" subjects, where the same mean blood glucose was associated with an HbA1c level of 9.6% vs 7.6%, respectively. To summarize, besides the issues related to the use of HbA1c, multiple factors contributed to the augmented risk of death in T1D individuals despite a good metabolic control. Indeed, several challenges are offered by the constantly evolving age-appropriate care needed by diabetic individuals transitioning from infancy to adulthood. ENDOTHELIAL DYSFUNCTION AND EARLY ATHEROSCLEROSIS Several different systems show altered homeostasis early along the course of diabetes. Among them, the endothelium is definitely one of the most important and earlier targeted organs. Evidence suggests that impairment in nitric oxide-mediated smooth muscle vasodilation is an early pathophysiologic process and underlies the onset endothelial dysfunction, a key event for the development of atherosclerosis. Among factors that may worsen endothelial function in individuals with T1D, we should mention: a long disease duration, a severely altered glycemic control, high low density lipoprotein cholesterol levels, high levels od advanced glycated end products, and altered mitochondrial dynamics. Our group recently observed a high prevalence of endothelial dysfunction (76.7%) in adolescents with T1D for a mean duration of 9 years, particularly in those individuals with impaired glycometabolic control, subclinical signs of autonomic neuropathy and sedentary lifestyle. We did not observe any correlations between endothelial dysfunction and diabetes duration or individuals' age. A HbA1c below 7.5% (58 mmol/mol) and regular physical activity of at least 4 h per week, were indeed associated with better endothelial function. Atherosclerosis, the late event of endothelial dysfunction, is frequently linked to the likelihood of death from cardiovascular origin, especially in individuals with T1D. Compared to non-diabetic subjects, individuals with T1D show an increased risk up to 10-fold to develop atherosclerotic plaques, starting since childhood and adolescence. Furthermore, intima media thickness measurement of the carotid artery is considered another valid surrogate marker for cardiovascular risk allowing assessment of atherosclerotic changes at a very early stage. Finally, Paroni et al showed that hyperhomocysteinemia in individuals with T1D may further increase the risk of endothelial dysfunction. CARDIOVASCULAR AUTONOMIC NEUROPATHY Cardiac autonomic neuropathy is an often overlooked and common complication of diabetes mellitus and by itself it is associated with increased cardiovascular morbidity and mortality, together with cardiac abnormalities typical of individuals with diabetes. Data demonstrate the dual (vagal and sympathetic) control of heart rate and the dominant role of respiration in the genesis of heart rate and blood pressure fluctuations, suggesting that reduced vagal control of the sinoatrial node and impaired vascular regulation are the two main pathophysiological alterations. Few years ago, our group investigated the autonomic performance of 93 children and adolescents with uncomplicated wellcontrolled T1D compared to age-matched controls. We found a significant increase in arterial blood pressure, a blunted baroreceptor reflex, and an increase of the low-frequency component of systolic arterial pressure variability. These findings entail the simultaneous impairment of the capability of the vagal system to influence the heart function, together with an increased sympathetic vasomotor regulation. A follow-up study conducted 1-year later showed further impairment of the neuro vegetative performance, thereby suggesting early progression of the autonomic disturbance. Interestingly, a small weekly increase in exercise in these same individuals can greatly help to improve cardiac autonomic neuropathy. STRESS In the last fifteen years several groups worked in the direction of uncovering the association between the increased cardiovascular risk in individuals with T1D and inflammation. Schaumberg et al measured levels of inflammatory biomarkers at baseline and after a 3-year follow-up in a random sample of 385 participants of the DCCT cohort. Results were controversial and emphasized the extremely complex interaction between 891 July 10, 2015|Volume 6|Issue 7| WJD|www.wjgnet.com Adapted from Lind et al. HbA1c: Glycated hemoglobin. exercise, in combination with a correct insulin therapy, play a pivotal role in obtaining and maintaining the best glycemic control possible. In the evaluation of a subgroup of individuals from the treatment group of the DCCT cohort, Delahanty et al established the relation between diet and glycemic control beyond the sole intensive insulin therapy. A higher content of total and saturated fat, associated with a lower carbohydrate intake are linked to worse glycemic control, thereby further increasing the cardiovascular risk. Adequate fibers intake, usually lower than suggested, is also recommended. Indeed, fibers offer a beneficial dietary profile: by reducing or at least delaying the overall glucose absorption; by blunting post-prandial glycemic peaks, and finally by impacting low-density lipoproteins by enhancing biliary acid secretion. For the aforementioned reasons, a proper nutritional education is a crucial part of diabetes management and needs to be promoted in all pediatric individuals with T1D and their families. Interestingly, recent study reported that children with T1D show less healthy food habits than same age healthy subjects. Routine physical exercise is known to have beneficial effects on the cardiovascular system in the general population, and even more in individuals with T1D. For this reason, we should strongly encourage individuals with T1D to participate in regular physical activity since childhood. One hour of moderate, aerobic exercise every day is currently recommended. Lucini et al recently found the favorable effects of moderate increase (10%) in spontaneous exercise load in adolescents with T1D. Similarly, in children with T1D (mean age 11 years old), 60 min per day of exercise improves endothelial dysfunction, a well-known risk factor for cardiovascular diseases. Moreover, in the recent years, technology has helped to reduce the impact of T1D especially in children. Continuous glucose monitoring has emerged as one of the most significant innovation in the management of children with T1D. The combination of continuous glucose monitoring and insulin pumps, provides better glycemic control with less hypoglycemic episodes. The ultimate technological advance of such automated insulin administration systems, currently under development, is the completely automated glycemic management, the closed-loop system also known as "external artificial pancreas". Finally, we would like to highlight recent stem cellbased trials, for which expectations in the scientific community and among individuals with T1D are high. One of the most promising is cord blood stem cells that have been demonstrated to became a powerful tool not only for regenerative medicine but for autoimmune (e.g., T1D) and inflammatory diseases as well. Recently, a novel hematopoietic stem cell-based strategy has been tested in individuals with new-onset T1D, suggesting that remission of the disease is possible by combining hematopoietic stem cell transplantation and immunosuppression; however safer hematopoietic stem cell-based therapeutic options are required. inflammation, T1D and insulin therapy. Some of the inflammation indexes were high in both intensive and conventional insulin treatment groups; others were higher in the intensive insulin therapy group, others in the conventional one. What seemed to be linked to increased inflammation status in individuals using intensive insulin therapy was the weight gain they showed, underlining the need for a more effective weight control in individuals with T1D. Indeed, a recent study by Valerio et al found that T1D adolescents, particularly females, showed a considerable occurrence of abdominal adiposity and metabolic syndrome. That is why pediatric diabetologists need to make every effort to achieve normal weight and better health outcomes in their young T1D patients. Dav et al found that newly T1D diagnosed individuals showed significantly augmented lipid peroxidation and platelet activation, paralleled by a higher degree of systemic inflammation. This data strongly support the idea of a significantly noxious effect of even the earliest form of damage triggered by the disease. The biochemical picture depicted is suggestive of a true acute inflammatory response accompanying the disease in its very earliest, hence pediatric, phase. The SEARCH Case-Control Study showed that young individuals with T1D, when compared to healthy controls, were characterized by excess inflammation despite good glycemic control. Interestingly, Folli et al demonstrated that persistent cellular changes of antioxidative machinery and of aerobic/anaerobic glycolysis are present in individuals with T1D (with or without endstage renal disease), and these abnormalities may play a key role in the pathogenesis of hyperglycemia-related vascular complications. Restoration of euglycemia and removal of uremia with kidney pancreas transplant can correct these abnormalities. Some of these identified pathways may become potential therapeutic targets for a new generation of drugs. HYPOGLYCEMIC EVENTS Another possible explanation for the increased death rate in individuals with T1D despite good glycemic control may be hypoglycemia. The T1D Exchange Registry seems to confirm this hypothesis. Elderly individuals and children younger than 5 years seem to be the two populations at greater risk. A value of HbA1c in the low range ("good" metabolic control) may not only be associated with well controlled glucose control but with recurrent episodes of hyper/hypoglycemic oscillations. We may speculate that, in the study by Lind et al, one of the factors potentially explaining the persistence of a sizeable mortality hazard ratio in individuals with low HbA1c could be a high rate of hypoglycemic events in those individuals. HOW TO IMPROVE OUTCOMES T1D is a complex disease whose management may be extremely awkward and demanding. Diet and DIABETES As the prevalence of type 2 diabetes (T2D) continues to increase worldwide, diabetes-related morbidity and mortality increase as well. There is scarce evidence on the effect of HbA1c reduction on mortality rate in T2D individuals. Recently a study by Skriver et al in a large cohort (n = 11205) of Danish individuals with T2D, showed that HbA1c variability was associated with mortality irrespective of the magnitude of absolute change in HbA1c. An increased mortality was observed even in those individuals with a HbA1c ≤ 8% if presenting a higher HbA1c variability. However, in T2D individuals many factors other than glycometabolic control may contribute to increase the mortality rate (e.g., hypertension, obesity, dyslipidemia, elevated uric acid and insulin resistance). Therefore, an early diagnosis and a prompt management of T2D comorbidities is required. CONCLUSION In conclusion, the recent findings describing an increased mortality in individuals with T1D as compared to agematched population, even in the presence of on-target HbA1c, are important. Whenever the outcomes of a chronic disease like T1D are being studied, it is important to acquire data from the onset. Indeed, any events in the early phase may affect its future course and especially its final outcome (i.e., death rates). A better understanding of the several alterations occurring in the earliest phases of T1D and of the factors that may be associated with the chronic history of T1D may help us to develop future innovative and effective preventive strategies.
from pathlib import Path import pybullet as p import pybullet_data import rospkg from active_grasp.bbox import AABBox from robot_helpers.bullet import * from robot_helpers.io import load_yaml from robot_helpers.model import KDLModel from robot_helpers.spatial import Rotation from vgn.perception import UniformTSDFVolume from vgn.utils import find_urdfs, view_on_sphere from vgn.detection import VGN, select_local_maxima # import vgn.visualizer as vis rospack = rospkg.RosPack() pkg_root = Path(rospack.get_path("active_grasp")) urdfs_dir = pkg_root / "assets" class Simulation: """Robot is placed s.t. world and base frames are the same""" def __init__(self, gui, scene_id, vgn_path): self.configure_physics_engine(gui, 60, 4) self.configure_visualizer() self.seed() self.load_robot() self.load_vgn(Path(vgn_path)) self.scene = get_scene(scene_id) def configure_physics_engine(self, gui, rate, sub_step_count): self.rate = rate self.dt = 1.0 / self.rate p.connect(p.GUI if gui else p.DIRECT) p.setAdditionalSearchPath(pybullet_data.getDataPath()) p.setPhysicsEngineParameter(fixedTimeStep=self.dt, numSubSteps=sub_step_count) p.setGravity(0.0, 0.0, -9.81) def configure_visualizer(self): # p.configureDebugVisualizer(p.COV_ENABLE_GUI, 0) p.resetDebugVisualizerCamera(1.2, 30, -30, [0.4, 0.0, 0.2]) def seed(self, seed=None): self.rng = np.random.default_rng(seed) if seed else np.random def load_robot(self): panda_urdf_path = urdfs_dir / "franka/panda_arm_hand.urdf" self.arm = BtPandaArm(panda_urdf_path) self.gripper = BtPandaGripper(self.arm) self.model = KDLModel.from_urdf_file( panda_urdf_path, self.arm.base_frame, self.arm.ee_frame ) self.camera = BtCamera(320, 240, 0.96, 0.01, 1.0, self.arm.uid, 11) def load_vgn(self, model_path): self.vgn = VGN(model_path) def reset(self): valid = False while not valid: self.set_arm_configuration([0.0, -1.39, 0.0, -2.36, 0.0, 1.57, 0.79]) self.scene.clear() q = self.scene.generate(self.rng) self.set_arm_configuration(q) uid = self.select_target() bbox = self.get_target_bbox(uid) valid = self.check_for_grasps(bbox) return bbox def set_arm_configuration(self, q): for i, q_i in enumerate(q): p.resetJointState(self.arm.uid, i, q_i, 0) p.resetJointState(self.arm.uid, 9, 0.04, 0) p.resetJointState(self.arm.uid, 10, 0.04, 0) self.gripper.set_desired_width(0.4) def select_target(self): _, _, mask = self.camera.get_image() uids, counts = np.unique(mask, return_counts=True) mask = np.isin(uids, self.scene.object_uids) # remove ids of the floor, etc uids, counts = uids[mask], counts[mask] target_uid = uids[np.argmin(counts)] p.changeVisualShape(target_uid, -1, rgbaColor=[1, 0, 0, 1]) return target_uid def get_target_bbox(self, uid): aabb_min, aabb_max = p.getAABB(uid) return AABBox(aabb_min, aabb_max) def check_for_grasps(self, bbox): origin = Transform.from_translation(self.scene.origin) origin.translation[2] -= 0.05 center = Transform.from_translation(self.scene.center) # First, reconstruct the scene from many views tsdf = UniformTSDFVolume(self.scene.length, 40) r = 2.0 * self.scene.length theta = np.pi / 4.0 phis = np.linspace(0.0, 2.0 * np.pi, 5) for view in [view_on_sphere(center, r, theta, phi) for phi in phis]: depth_img = self.camera.get_image(view)[1] tsdf.integrate(depth_img, self.camera.intrinsic, view.inv() * origin) voxel_size, tsdf_grid = tsdf.voxel_size, tsdf.get_grid() # Then check whether VGN can find any grasps on the target out = self.vgn.predict(tsdf_grid) grasps, qualities = select_local_maxima(voxel_size, out, threshold=0.9) # vis.scene_cloud(voxel_size, tsdf.get_scene_cloud()) # vis.grasps(grasps, qualities, 0.05) # vis.show() for grasp in grasps: pose = origin * grasp.pose tip = pose.rotation.apply([0, 0, 0.05]) + pose.translation if bbox.is_inside(tip): return True return False def step(self): p.stepSimulation() class Scene: def __init__(self): self.support_urdf = urdfs_dir / "plane/model.urdf" self.support_uid = -1 self.object_uids = [] def clear(self): self.remove_support() self.remove_all_objects() def generate(self, rng): raise NotImplementedError def add_support(self, pos): self.support_uid = p.loadURDF(str(self.support_urdf), pos, globalScaling=0.3) def remove_support(self): p.removeBody(self.support_uid) def add_object(self, urdf, ori, pos, scale=1.0): uid = p.loadURDF(str(urdf), pos, ori.as_quat(), globalScaling=scale) self.object_uids.append(uid) return uid def remove_object(self, uid): p.removeBody(uid) self.object_uids.remove(uid) def remove_all_objects(self): for uid in list(self.object_uids): self.remove_object(uid) class YamlScene(Scene): def __init__(self, config_name): super().__init__() self.config_path = pkg_root / "cfg/sim" / config_name def load_config(self): self.scene = load_yaml(self.config_path) self.center = np.asarray(self.scene["center"]) self.length = 0.3 self.origin = self.center - np.r_[0.5 * self.length, 0.5 * self.length, 0.0] def generate(self, rng): self.load_config() self.add_support(self.center) for object in self.scene["objects"]: urdf = urdfs_dir / object["object_id"] / "model.urdf" ori = Rotation.from_euler("xyz", object["rpy"], degrees=True) pos = self.center + np.asarray(object["xyz"]) scale = object.get("scale", 1) if randomize := object.get("randomize", False): angle = rng.uniform(-randomize["rot"], randomize["rot"]) ori = Rotation.from_euler("z", angle, degrees=True) * ori b = np.asarray(randomize["pos"]) pos += rng.uniform(-b, b) self.add_object(urdf, ori, pos, scale) for _ in range(60): p.stepSimulation() return self.scene["q"] class RandomScene(Scene): def __init__(self): super().__init__() self.center = np.r_[0.5, 0.0, 0.2] self.length = 0.3 self.origin = self.center - np.r_[0.5 * self.length, 0.5 * self.length, 0.0] self.object_urdfs = find_urdfs(urdfs_dir / "test") def generate(self, rng, object_count=4, attempts=10): self.add_support(self.center) urdfs = rng.choice(self.object_urdfs, object_count) for urdf in urdfs: scale = rng.uniform(0.8, 1.0) uid = self.add_object(urdf, Rotation.identity(), np.zeros(3), scale) lower, upper = p.getAABB(uid) z_offset = 0.5 * (upper[2] - lower[2]) + 0.002 state_id = p.saveState() for _ in range(attempts): # Try to place and check for collisions ori = Rotation.from_euler("z", rng.uniform(0, 2 * np.pi)) pos = np.r_[rng.uniform(0.2, 0.8, 2) * self.length, z_offset] p.resetBasePositionAndOrientation(uid, self.origin + pos, ori.as_quat()) p.stepSimulation() if not p.getContactPoints(uid): break else: p.restoreState(stateId=state_id) else: # No placement found, remove the object self.remove_object(uid) q = [0.0, -1.39, 0.0, -2.36, 0.0, 1.57, 0.79] q += rng.uniform(-0.08, 0.08, 7) return q def get_scene(scene_id): if scene_id.endswith(".yaml"): return YamlScene(scene_id) elif scene_id == "random": return RandomScene() else: raise ValueError("Unknown scene {}.".format(scene_id))
/** * Write snapshot period into the snapshot period file. * * @param entry * The snapshot period to be written. * @throws IOException * Thrown if the snapshot period cannot be written. */ public synchronized void writeSnapshotPeriod(String entry) throws IOException { try { writers.snapshotPeriodWriter.write(entry); } catch (IOException e) { Log.e("Failed to write to the log file " + writers.logPath + RuntimeLogWriters.DEFAULT_PERIOD_FILE_PATH, e); throw e; } }
(Newser) – Every family has some dirty laundry but not like this: A woman in Virginia is now revealing that her father was the Kommandant of Auschwitz. Brigette Höss (which is her maiden name; she is keeping her married name secret out of fear for her own safety) had kept the story from even her grandkids. But now 80 and recently diagnosed with cancer, she agreed to an interview after writer Thomas Harding found her while researching a book about the hunt for and capture of (by Harding's own great-uncle, no less) her father, Rudolf Höss. The Washington Post has her story. Brigette Höss spent ages 7 to 11 living among cooks, nannies, and drivers at Auschwitz, which her father designed and helped realize after stints at Dachau and Sachsenhausen. As the war neared its end the family separated; she went with her mother and her father hid on a farm disguised as a laborer. But, she says, British soldiers beat her brother until her mother gave his location up. He was arrested and eventually executed, while the rest of the family were treated as outcasts. Höss moved to Spain in the 1950s, where she met and married an American engineer, moving to the US in 1972. Remarkably, one person in her new life who did know her story was the owner of a store she worked in. The owner was a Jew who had fled Nazi Germany, but continued to employ her for 35 years. Höss says she acknowledges that atrocities took place under her father's watch, but does not believe that millions were killed, and thinks her father only confessed to killing so many because he was tortured. "He was the nicest man in the world," she says. "He was very good to us." (In related news, Hitler's bodyguard died last week.)
def update(self): if self.axis != 0 and self.mplObject != []: self.plot(self.mplObject[0].axes) self.mplObject[0].axes.figure.canvas.draw()
The euro declined 0.4 percent to $1.3855 in late-day trading as it became increasingly unlikely that European Officials would arrive at a finalized plan for dealing with the growing European debt crisis during a meeting today in Brussels. German Chancellor Angela Merkel even went so far as to blunt expectations for a deal saying “the work’s not been done yet”. One of the sticking points that continues to elude resolution is the question of the write-down percentage Greek bond holders will be forced to accept. Earlier rumors placed the “haircut” to be 50 percent – this is far greater than the 21 percent banking representatives suggested as being acceptable. The spotlight also turned to Italy where, yesterday, the coalition government led by Prime Minister Silvio Berlusconi failed to implement a series of spending cuts imposed by European Union officials. The Italian government had agreed to reduce spending in exchange for a pledge by EU members to continue to buy Italy’s bonds. As a result of the government’s failure, Berlusconi spent the day working on a plan to demonstrate to EU officials that the government does have a credible plan to meet the spending reduction targets. In addition to these developments, media outlets in Italy are reporting that Berlusconi has informed his coalition members that he will resign as Prime Minister by the end of the year. This was immediately denied by the Prime Minister’s office but pressure is mounting on the current administration. Italy’s debt has ballooned to 1.9 trillion euros ($2.6 trillion) and is now equal to 120 percent of the country’s annual Gross Domestic Product.
a = int(input().strip()) import sys sys.setrecursionlimit(1000000) tmp = [] res = [] ind = 1 def bar(foo,hoge): if(foo == 0): return if foo == 1: res.append(1) return elif foo == 2: res.append(2) return for i in reversed(range(hoge)): if (tmp[i] <= foo): res.append(i + 1) bar(foo - (i + 1) , i) return for i in range(10000000): ind = ind + i tmp.append(ind) if ind >= a : bar(a, i + 1 ) break for i in res: print(i)
<filename>src/com/funnyboyroks/real/_2021_12_11/Six.java package com.funnyboyroks.real._2021_12_11; import java.io.File; import java.io.FileNotFoundException; import java.util.Scanner; public class Six { public static void main(String[] args) throws FileNotFoundException { Scanner scanner = new Scanner(new File("drift.dat")); int sets = scanner.nextInt(); for (int i = 0; i < sets; i++) { int a = scanner.nextInt(); int c = scanner.nextInt(); double b = Math.round( Math.sqrt(-(a * a) + c * c) * 10000 ) / 10000.0; String[] parts = (b + "").split("\\."); parts[1] += "0000000000"; parts[1] = parts[1].substring(0, 4); System.out.println(String.join(".", parts)); } } }
// Copyright (c) 2017-2017 The Chaos Authors. All rights reserved. // Created on: 2017.9.19 Author: kerry #include "his_head.h" #include "flw_his_stk.h" #include "stk_datacps.h" #include "logic/logic_comm.h" #include "basic/basic_util.h" #include "file/file_path.h" #include "file/file_util.h" #include "protocol/data_packet.h" namespace fc_data { const chaos_data::SymbolStatic_SYMBOL_TYPE g_gpb_data_type[chaos_data::SymbolStatic_SYMBOL_TYPE_SYMBOL_TYPE_ARRAYSIZE] = { chaos_data::SymbolStatic_SYMBOL_TYPE_INDEX, chaos_data::SymbolStatic_SYMBOL_TYPE_STOCK, chaos_data::SymbolStatic_SYMBOL_TYPE_FUND, chaos_data::SymbolStatic_SYMBOL_TYPE_BOND, chaos_data::SymbolStatic_SYMBOL_TYPE_OTHER_STOCK, chaos_data::SymbolStatic_SYMBOL_TYPE_OPTION, chaos_data::SymbolStatic_SYMBOL_TYPE_EXCHANGE, chaos_data::SymbolStatic_SYMBOL_TYPE_FUTURE, chaos_data::SymbolStatic_SYMBOL_TYPE_FTR_IDX, chaos_data::SymbolStatic_SYMBOL_TYPE_RGZ, chaos_data::SymbolStatic_SYMBOL_TYPE_ETF, chaos_data::SymbolStatic_SYMBOL_TYPE_LOF, chaos_data::SymbolStatic_SYMBOL_TYPE_COV_BOND, chaos_data::SymbolStatic_SYMBOL_TYPE_TRUST, chaos_data::SymbolStatic_SYMBOL_TYPE_WARRANT, chaos_data::SymbolStatic_SYMBOL_TYPE_REPO, chaos_data::SymbolStatic_SYMBOL_TYPE_COMM }; FlwHisStk::FlwHisStk(std::string& dir) : static_size_(NULL), static_(NULL), static_ex_(NULL), staticex_size_(NULL), his_data_count_(NULL), data_ptr_(NULL), data_head_(NULL), market_date_(0), out_dir_(dir) { memset(market_mtk_,'\0',32); last_pos_index_.set_start_pos(0); last_pos_index_.set_time_index(0); last_pos_index_.set_end_pos(0); } FlwHisStk::~FlwHisStk() { RestStk(); while (his_data_list_.size() > 0) { fc_data::FlwHisData* flw_data = his_data_list_.front(); his_data_list_.pop_front(); if (flw_data) { delete flw_data; flw_data = NULL; } } //LOG_MSG2("his_data_list size %d",his_data_list_.size()); } //清除数据 void FlwHisStk::RestStk() { static_size_ = NULL; static_ = NULL; static_ex_ = NULL; staticex_size_ = NULL; his_data_count_ = NULL; } bool FlwHisStk::LoadStk(const unsigned char*& his_buffer, const uint32 market_date, const uint16 market_mtk) { RestStk(); try { static_size_ = (const int32*) his_buffer; his_buffer = (const unsigned char*) (static_size_ + 1); if (*static_size_ < sizeof(struct STK_STATIC)) return false; static_ = (const struct STK_STATIC*) his_buffer; his_buffer = his_buffer + (*static_size_); staticex_size_ = (const int32*) his_buffer; his_buffer = (const unsigned char*) (staticex_size_ + 1); if (*staticex_size_ < sizeof(struct STK_STATICEx)) return false; static_ex_ = (const struct STK_STATICEx*) his_buffer; his_buffer = his_buffer + (*staticex_size_); his_data_count_ = (const int32*) his_buffer; his_buffer = (const unsigned char*) (his_data_count_ + 1); if (*his_data_count_ < 0) return false; market_date_ = market_date; memcpy(market_mtk_, &market_mtk, sizeof(uint16)); if (*his_data_count_) { for (int i = 0; i < (*his_data_count_); i++) { fc_data::FlwHisData* flw_data = new fc_data::FlwHisData(); if (!flw_data->LoadData(his_buffer)) { RestStk(); return false; } his_data_list_.push_back(flw_data); } } } catch (...) { RestStk(); return false; } return true; } //获取证券代码 bool FlwHisStk::GetStkStatic(struct STK_STATIC& stk_code) { if (NULL == static_) return false; memcpy(&stk_code, static_, sizeof(struct STK_STATIC)); return true; } //读取证券数据类型列表 bool FlwHisStk::GetDataTypeList(std::vector<int>& list) { if (NULL == static_) return false; HISDATA_LIST::iterator it = his_data_list_.begin(); while (it != his_data_list_.end()) { list.push_back((*it)->his_data_type_); it++; } return true; } char* FlwHisStk::SecType(const char* type) { if(std::string(type) == "SC") return "SHFE"; else if(std::string(type) == "DC") return "DCE"; else if (std::string(type) == "ZC") return "CZCE"; else if (std::string(type) == "SF") return "SFFE"; else return "unkown"; } bool FlwHisStk::ProcessHisTypeList() { if (NULL == static_) return false; HISDATA_LIST::iterator it = his_data_list_.begin(); while (it != his_data_list_.end()) { ProcessTypeData((*it)); it++; } return true; } void FlwHisStk::WriteStatic(HIS_DATA_TYPE data_type, const int32 year, const int32 month, const int32 day) { chaos_data::SymbolStatic symbol_static; std::string content; symbol_static.set_symbol(static_->symbol_); symbol_static.set_name(static_->name_); symbol_static.set_ctype(g_gpb_data_type[static_->ctype_]); symbol_static.set_market_mtk(SecType(market_mtk_)); symbol_static.set_market_date(10000 * year + month * 100 + day); symbol_static.set_his_count((*his_data_count_)); symbol_static.set_csub_type(GetSymbolSubType(static_ex_->csub_type_)); symbol_static.set_price_digit(static_->price_digit_); symbol_static.set_vol_unit(static_->vol_unit_); symbol_static.set_float_issued(static_->float_issued_.GetValue()); symbol_static.set_total_issued(static_->total_issued_.GetValue()); symbol_static.set_last_close(static_->last_close_); symbol_static.set_adv_stop(static_->adv_stop_); symbol_static.set_dec_stop(static_->dec_stop_); chaos_data::SymbolStatic::SpecMessage* spc = symbol_static.mutable_spec(); switch (static_->ctype_) { case STK_STATIC::INDEX: { //指数 break; } case STK_STATIC::STOCK: case STK_STATIC::OTHER_STOCK: { //股票//其他股票 chaos_data::SymbolStatic::EquityMessage* equity = spc->mutable_equity(); equity->set_face_value(static_ex_->equity_spec_.face_value_); equity->set_profit(static_ex_->equity_spec_.profit_); equity->set_industry(static_ex_->equity_spec_.industry_); equity->set_trade_status(static_ex_->equity_spec_.trade_status_); equity->set_cash_dividend(static_ex_->equity_spec_.cash_dividend_); equity->set_security_properties( GetSymbolSP(static_ex_->equity_spec_.security_properties_)); equity->set_last_tradedate(static_ex_->equity_spec_.last_tradedate_); break; } case STK_STATIC::FUND: //基金 case STK_STATIC::ETF: //ETF case STK_STATIC::LOF: { //LOF chaos_data::SymbolStatic::FundMessage* fund = spc->mutable_fund(); fund->set_face_value(static_ex_->fund_spec_.face_value_); fund->set_total_issued(static_ex_->fund_spec_.total_issued_); fund->set_iopv(static_ex_->fund_spec_.iopv_); break; } case STK_STATIC::BOND: { //债券 chaos_data::SymbolStatic::BoundMessage* bound = spc->mutable_bound(); bound->set_maturity_date(static_ex_->bond_spec_.maturity_date_); bound->set_intaccru_date(static_ex_->bond_spec_.intaccru_date_); bound->set_isssue_price(static_ex_->bond_spec_.isssue_price_); bound->set_coupon_rate(static_ex_->bond_spec_.coupon_rate_); bound->set_face_value(static_ex_->bond_spec_.face_value_); bound->set_accrued_int(static_ex_->bond_spec_.accrued_int_); break; } case STK_STATIC::OPTION: //选择权 case STK_STATIC::WARRANT: { //权证 chaos_data::SymbolStatic::WarranMessage* warran = spc->mutable_warran(); warran->set_style(static_ex_->warrant_spec_.style_); warran->set_cp(static_ex_->warrant_spec_.cp_); warran->set_cnvt_ratio(static_ex_->warrant_spec_.cnvt_ratio_); warran->set_strike_price(static_ex_->warrant_spec_.strike_price_); warran->set_maturity_date(static_ex_->warrant_spec_.maturity_date_); warran->set_under_line(static_ex_->warrant_spec_.under_line_); warran->set_balance(static_ex_->warrant_spec_.balance_); break; } case STK_STATIC::EXCHANGE: { //外汇 break; } case STK_STATIC::FUTURE: //期货 case STK_STATIC::COMM: //商品现货 case STK_STATIC::FTR_IDX: { //期指 chaos_data::SymbolStatic::FutureMessage* future = spc->mutable_future(); future->set_last_day_oi(static_ex_->future_spec_.last_day_OI_); future->set_last_settle_price( static_ex_->future_spec_.last_settle_price_); break; } case STK_STATIC::RGZ: { //认购证 break; } case STK_STATIC::COV_BOND: { //可转债 chaos_data::SymbolStatic::CNVTMessage* cnvt = spc->mutable_cnvt(); cnvt->set_style(static_ex_->cnvt_spec_.style_); cnvt->set_cp(static_ex_->cnvt_spec_.cp_); cnvt->set_cnvt_ratio(static_ex_->cnvt_spec_.cnvt_ratio_); cnvt->set_strike_price(static_ex_->cnvt_spec_.strike_price_); cnvt->set_maturity_date(static_ex_->cnvt_spec_.maturity_date_); cnvt->set_under_line(static_ex_->cnvt_spec_.under_line_); cnvt->set_accrued_int(static_ex_->cnvt_spec_.accrued_int_); break; } case STK_STATIC::TRUST: { //信托 chaos_data::SymbolStatic::TruestMessage* truset = spc->mutable_truest(); truset->set_asset(static_ex_->trust_spec_.asset_); truset->set_asset_date(static_ex_->trust_spec_.asset_date_); break; } case STK_STATIC::REPO: { //回购 break; } default: break; } std::string in_data; bool r = symbol_static.SerializeToString(&in_data); std::string dir = out_dir_ + "/" + std::string(s_stk_type_en[static_->ctype_]) + "/" + std::string(SecType(market_mtk_)) + "/" + std::string(static_->symbol_) + "/" + std::string(g_his_data_type_en[0]) + "/" + base::BasicUtil::StringUtil::Int64ToString(year) + "/" + base::BasicUtil::StringUtil::Int64ToString(month); file::FilePath current_dir_path(dir); if (!file::DirectoryExists(current_dir_path)) file::CreateDirectory(current_dir_path); std::string file_name = std::string(SecType(market_mtk_)) + "_" + std::string(static_->symbol_) + "_" + base::BasicUtil::StringUtil::Int64ToString(year) + base::BasicUtil::StringUtil::Int64ToString(month) + base::BasicUtil::StringUtil::Int64ToString(day); std::string temp_path = current_dir_path.value() + "/" + file_name + std::string(g_his_data_suffix[0]) + ".chspb"; file::FilePath temp_file_path(temp_path); //檢測是否存在 file::DirectoryExists(temp_file_path); int32 bytes_writen = file::WriteFile(temp_file_path, in_data.c_str(), in_data.length()); } void FlwHisStk::WriteDynaData(HIS_DATA_TYPE data_type) { int32 count = data_head_->item_count_; int32 index = 0; while (index < count) { const struct STK_DYNA* dyna_data = (const STK_DYNA*) (data_ptr_); chaos_data::SymbolDynamMarket dynam_markert; dynam_markert.set_current_time(dyna_data->time_); dynam_markert.set_open_price(dyna_data->open_); dynam_markert.set_high_price(dyna_data->high_); dynam_markert.set_low_price(dyna_data->low_); dynam_markert.set_new_price(dyna_data->new_); dynam_markert.set_volume(dyna_data->volume_); dynam_markert.set_amount(dyna_data->amount_.GetValue()); dynam_markert.set_inner_vol(dyna_data->inner_vol_.GetValue()); dynam_markert.set_tick_count(dyna_data->tick_count_); //-----> dynam_markert.add_buy_price(dyna_data->buy_price_[0]); dynam_markert.add_buy_vol(dyna_data->buy_vol_[0]); dynam_markert.add_sell_price(dyna_data->sell_price_[0]); dynam_markert.add_sell_vol(dyna_data->sell_vol_[0]); //-----> dynam_markert.add_buy_price(dyna_data->buy_price_[1]); dynam_markert.add_buy_vol(dyna_data->buy_vol_[1]); dynam_markert.add_sell_price(dyna_data->sell_price_[1]); dynam_markert.add_sell_vol(dyna_data->sell_vol_[1]); //-----> dynam_markert.add_buy_price(dyna_data->buy_price_[2]); dynam_markert.add_buy_vol(dyna_data->buy_vol_[2]); dynam_markert.add_sell_price(dyna_data->sell_price_[2]); dynam_markert.add_sell_vol(dyna_data->sell_vol_[2]); //-----> dynam_markert.add_buy_price(dyna_data->buy_price_[3]); dynam_markert.add_buy_vol(dyna_data->buy_vol_[3]); dynam_markert.add_sell_price(dyna_data->sell_price_[3]); dynam_markert.add_sell_vol(dyna_data->sell_vol_[3]); //-----> dynam_markert.add_buy_price(dyna_data->buy_price_[4]); dynam_markert.add_buy_vol(dyna_data->buy_vol_[4]); dynam_markert.add_sell_price(dyna_data->sell_price_[4]); dynam_markert.add_sell_vol(dyna_data->sell_vol_[4]); dynam_markert.set_open_interest(dyna_data->open_interest_); dynam_markert.set_settle_price(dyna_data->settle_price_); std::string in_data = ""; bool r = dynam_markert.SerializeToString(&in_data); int32 packet_length = 0; if (r && !in_data.empty()) { //写入文件 packet_length = WriteGoogleFile(dyna_data->time_, g_his_data_type_en[data_type], g_his_data_suffix[data_type], in_data); } else { LOG_ERROR2("symbol:%s DYNA GoogleProtoBuffer Error length:%d", static_->symbol_, in_data.length()); } if (packet_length) SetIndexPos(dyna_data->time_, packet_length, data_type); index++; data_ptr_ = data_ptr_ + data_head_->item_size_; } WriteIndexPosFile(last_pos_index_.time_index(), data_type); } void FlwHisStk::WriteL2MMPEX(HIS_DATA_TYPE data_type) { int32 count = data_head_->item_count_; int32 index = 0; while (index < count) { const struct HIS_L2_MMPEX* data = (const struct HIS_L2_MMPEX*) (data_ptr_); chaos_data::SymbolL2MMPEX l2_mmpex; l2_mmpex.set_time(data->time_); l2_mmpex.set_avg_buy_price(data->data_.avg_buy_price_); l2_mmpex.set_all_buy_vol(data->data_.all_buy_vol_.GetValue()); l2_mmpex.set_avg_sell_price(data->data_.avg_sell_price_); l2_mmpex.set_all_sell_vol(data->data_.all_sell_vol_.GetValue()); //-----> l2_mmpex.add_buy_price(data->data_.buy_price_[0]); l2_mmpex.add_buy_vol(data->data_.buy_vol_[0]); l2_mmpex.add_sell_price(data->data_.sell_price_[0]); l2_mmpex.add_sell_vol(data->data_.sell_vol_[0]); //-----> l2_mmpex.add_buy_price(data->data_.buy_price_[1]); l2_mmpex.add_buy_vol(data->data_.buy_vol_[1]); l2_mmpex.add_sell_price(data->data_.sell_price_[1]); l2_mmpex.add_sell_vol(data->data_.sell_vol_[1]); //-----> l2_mmpex.add_buy_price(data->data_.buy_price_[2]); l2_mmpex.add_buy_vol(data->data_.buy_vol_[2]); l2_mmpex.add_sell_price(data->data_.sell_price_[2]); l2_mmpex.add_sell_vol(data->data_.sell_vol_[2]); //-----> l2_mmpex.add_buy_price(data->data_.buy_price_[3]); l2_mmpex.add_buy_vol(data->data_.buy_vol_[3]); l2_mmpex.add_sell_price(data->data_.sell_price_[3]); l2_mmpex.add_sell_vol(data->data_.sell_vol_[3]); //-----> l2_mmpex.add_buy_price(data->data_.buy_price_[4]); l2_mmpex.add_buy_vol(data->data_.buy_vol_[4]); l2_mmpex.add_sell_price(data->data_.sell_price_[4]); l2_mmpex.add_sell_vol(data->data_.sell_vol_[4]); std::string in_data; bool r = l2_mmpex.SerializeToString(&in_data); int32 packet_length = 0; if (r && !in_data.empty()) { //写入文件 packet_length = WriteGoogleFile(data->time_, g_his_data_type_en[data_type], g_his_data_suffix[data_type], in_data); } else { LOG_ERROR2("symbol:%s HIS_L2_MMPEX GoogleProtoBuffer Error length %d", static_->symbol_, in_data.length()); } if (packet_length) SetIndexPos(data->time_, packet_length, data_type); index++; data_ptr_ = data_ptr_ + data_head_->item_size_; } WriteIndexPosFile(last_pos_index_.time_index(), data_type); } void FlwHisStk::WriteL2Report(HIS_DATA_TYPE data_type) { int32 count = data_head_->item_count_; int32 index = 0; while (index < count) { const struct SH_L2_REPORT *data = (const struct SH_L2_REPORT*) (data_ptr_); chaos_data::SymbolL2Report l2_report; l2_report.set_time(data->time_); l2_report.set_price(data->price_); l2_report.set_volume(data->volume_); std::string in_data; bool r = l2_report.SerializeToString(&in_data); int32 packet_length = 0; if (r && !in_data.empty()) { //写入文件 packet_length = WriteGoogleFile(data->time_, g_his_data_type_en[data_type], g_his_data_suffix[data_type], in_data); } else { LOG_ERROR2("symbol:%s HIS_L2_MMPEX GoogleProtoBuffer Error length:%d", static_->symbol_, in_data.length()); } if (packet_length) SetIndexPos(data->time_, packet_length, data_type); index++; data_ptr_ = data_ptr_ + data_head_->item_size_; } WriteIndexPosFile(last_pos_index_.time_index(), data_type); } void FlwHisStk::WriteOrderStat(HIS_DATA_TYPE data_type) { int32 count = data_head_->item_count_; int32 index = 0; while (index < count) { const struct HIS_L2_ORDER_STAT* data = (const struct HIS_L2_ORDER_STAT*) (data_ptr_); chaos_data::SymbolL2OrderState l2_order; l2_order.set_time(data->time_); //chaos_data::SymbolStatic::SpecMessage* spc = symbol_static.mutable_spec(); chaos_data::SymbolL2OrderState::SymbolOrderStat* order_state = l2_order .mutable_order_state(); order_state->add_buy_order_vol(data->data_.buy_order_vol_[0].GetValue()); order_state->add_buy_order_vol(data->data_.buy_order_vol_[1].GetValue()); order_state->add_buy_order_vol(data->data_.buy_order_vol_[2].GetValue()); order_state->add_buy_order_vol(data->data_.buy_order_vol_[3].GetValue()); order_state->add_sell_order_vol(data->data_.sell_order_vol_[0].GetValue()); order_state->add_sell_order_vol(data->data_.sell_order_vol_[1].GetValue()); order_state->add_sell_order_vol(data->data_.sell_order_vol_[2].GetValue()); order_state->add_sell_order_vol(data->data_.sell_order_vol_[3].GetValue()); order_state->add_order_num(data->data_.order_num_[0].Get()); order_state->add_order_num(data->data_.order_num_[1].Get()); order_state->add_vol(data->data_.vol_[0].GetValue()); order_state->add_vol(data->data_.vol_[1].GetValue()); std::string in_data; bool r = l2_order.SerializeToString(&in_data); int32 packet_length = 0; if (r && !in_data.empty()) { //写入文件 packet_length = WriteGoogleFile(data->time_, g_his_data_type_en[data_type], g_his_data_suffix[data_type], in_data); } else { LOG_ERROR2("symbol:%s HIS_L2_MMPEX GoogleProtoBuffer Error length:%d", static_->symbol_, in_data.length()); } if (packet_length) SetIndexPos(data->time_, packet_length, data_type); index++; data_ptr_ = data_ptr_ + data_head_->item_size_; } WriteIndexPosFile(last_pos_index_.time_index(), data_type); } void FlwHisStk::WriteIOPV(HIS_DATA_TYPE data_type) { int32 count = data_head_->item_count_; int32 index = 0; while (index < count) { const struct HIS_IOPV* data = (const struct HIS_IOPV*) (data_ptr_); chaos_data::SymbolHisIOPV iopv; iopv.set_time(data->time_); iopv.set_value(data->value_); std::string in_data; bool r = iopv.SerializeToString(&in_data); int32 packet_length = 0; if (r && !in_data.length()) { //写入文件 packet_length = WriteGoogleFile(data->time_, g_his_data_type_en[data_type], g_his_data_suffix[data_type], in_data); } else { LOG_ERROR2("symbol:%s HIS_L2_MMPEX GoogleProtoBuffer Error length:%d", static_->symbol_, in_data.length()); } if (packet_length) SetIndexPos(data->time_, packet_length, data_type); index++; data_ptr_ = data_ptr_ + data_head_->item_size_; } WriteIndexPosFile(last_pos_index_.time_index(), data_type); } void FlwHisStk::WriteMatuYld(HIS_DATA_TYPE data_type) { int32 count = data_head_->item_count_; int32 index = 0; while (index < count) { const struct HIS_Matu_Yld* data = (const struct HIS_Matu_Yld*) (data_ptr_); chaos_data::SymbolHisMatuYld matu_yld; matu_yld.set_time(data->time_); matu_yld.set_value(data->value_); std::string in_data; bool r = matu_yld.SerializeToString(&in_data); int32 packet_length = 0; if (r && !in_data.empty()) { //写入文件 packet_length = WriteGoogleFile(data->time_, g_his_data_type_en[data_type], g_his_data_suffix[data_type], in_data); } else { LOG_ERROR2("symbol:%s HIS_L2_MMPEX GoogleProtoBuffer Error length:%d", static_->symbol_, in_data.length()); } if (packet_length) SetIndexPos(data->time_, packet_length, data_type); index++; data_ptr_ = data_ptr_ + data_head_->item_size_; } WriteIndexPosFile(last_pos_index_.time_index(), data_type); } void FlwHisStk::SetIndexPos(int32 tt_time, const int32 packet_length, HIS_DATA_TYPE data_type) { //写入序列文件 /*LOG_MSG2("=======>time:%d,packet_length %d, start_pos:%d,end_pos:%d", last_pos_index_.time_index(), packet_length, last_pos_index_.start_pos(), last_pos_index_.end_pos());*/ int32 s_time = (tt_time / 60) * 60; if (last_pos_index_.time_index() != s_time) { if (last_pos_index_.end_pos() != 0) WriteIndexPosFile(tt_time, data_type); last_pos_index_.set_time_index(s_time); last_pos_index_.set_start_pos(last_pos_index_.end_pos()); last_pos_index_.set_end_pos(last_pos_index_.start_pos() + packet_length); } else { last_pos_index_.set_end_pos(last_pos_index_.end_pos() + packet_length); } /* LOG_MSG2("time:%d,packet_length %d, start_pos:%d,end_pos:%d<======", last_pos_index_.time_index(),packet_length, last_pos_index_.start_pos(), last_pos_index_.end_pos());*/ } void FlwHisStk::WriteIndexPosFile(const int64 unix_time, HIS_DATA_TYPE data_type) { std::string in_data; bool r = last_pos_index_.SerializeToString(&in_data); if (r && !in_data.empty()) { //写入文件 WriteGoogleFile(unix_time, g_his_data_type_en[data_type], ".ipos", in_data); //LOG_MSG2("symbol:%s,time:%d,start_pos:%d,end_pos:%d", // static_->symbol_,unix_time,last_pos_index_.start_pos(), // last_pos_index_.end_pos()); } else { LOG_ERROR2("symbol:%s IndexPos GoogleProtoBuffer Error length:%d", static_->symbol_, in_data.length()); } //chaos_data::SymbolPosIndex ll_pos_index; //r = ll_pos_index.ParseFromString(in_data); //printf("time:%d,start_pos:%d,end_pos:%d\n", ll_pos_index.time_index(), // ll_pos_index.start_pos(), ll_pos_index.end_pos()); } int16 FlwHisStk::WriteGoogleFile(const int64 unix_time, const char* his_data_type, const char* his_data_suffix,/*HIS_DATA_TYPE data_type,*/ const std::string& content) { //time_t u_time = unix_time; //struct tm *local_time = localtime(&u_time); /* * market_date_ / 10000, (market_date_ / 100) % 100, market_date_ % 100 * */ int16 packet_length = content.length() + sizeof(int16); packet::DataOutPacket out(true, packet_length); out.Write16(packet_length); out.WriteData(content.c_str(), content.length()); std::string dir = out_dir_ + "/" + std::string(s_stk_type_en[static_->ctype_]) + "/" + std::string(SecType(market_mtk_)) + "/" + std::string(static_->symbol_) + "/" + std::string(his_data_type) + "/" + base::BasicUtil::StringUtil::Int64ToString(market_date_ / 10000) + "/" + base::BasicUtil::StringUtil::Int64ToString((market_date_ / 100) % 100); //+ "/" + base::BasicUtil::StringUtil::Int64ToString(day); file::FilePath current_dir_path(dir); if (!file::DirectoryExists(current_dir_path)) file::CreateDirectory(current_dir_path); std::string file_name = std::string(SecType(market_mtk_)) + "_" + std::string(static_->symbol_) + "_" + base::BasicUtil::StringUtil::Int64ToString(market_date_ / 10000) + base::BasicUtil::StringUtil::Int64ToString((market_date_ / 100) % 100) + base::BasicUtil::StringUtil::Int64ToString(market_date_ % 100); std::string temp_path = current_dir_path.value() + "/" + file_name + std::string(his_data_suffix) + ".chspb"; file::FilePath temp_file_path(temp_path); //檢測是否存在 file::DirectoryExists(temp_file_path); int32 bytes_writen = file::WriteFile(temp_file_path, out.GetData(), out.GetLength()); return bytes_writen; } void FlwHisStk::ProcessTypeData(fc_data::FlwHisData* flw_data) { int buffer_length = flw_data->ReadData(NULL, 0); if (buffer_length > 0) { std::string src_buf; src_buf.resize(buffer_length); int32 nread = flw_data->ReadData((char*) src_buf.c_str(), buffer_length); if (nread) { const struct HIS_DATA_HEAD* data_head = (const struct HIS_DATA_HEAD*) (src_buf.c_str()); if (data_head->package_flag_ & CT_MASK) { int32 nbuff_length = fc_data::UnCompressData( (const unsigned char*) src_buf.c_str(), NULL, 0); if (nbuff_length) { data_buffer_.resize(0); data_buffer_.resize(nbuff_length); char* buf = (char*) data_buffer_.c_str(); if (fc_data::UnCompressData((const unsigned char*) src_buf.c_str(), buf, nbuff_length) > 0) { data_head_ = (struct HIS_DATA_HEAD*) buf; data_ptr_ = buf + data_head_->head_size_; } } } else { data_buffer_.resize(0); data_buffer_.resize(buffer_length); char* buf = (char*) data_buffer_.c_str(); memcpy(buf, src_buf.c_str(), buffer_length); data_head_ = (struct HIS_DATA_HEAD*) buf; data_ptr_ = buf + data_head_->head_size_; } } src_buf.resize(0); } //存储静态数据 WriteStatic(flw_data->his_data_type_, market_date_ / 10000, (market_date_ / 100) % 100, market_date_ % 100); switch (flw_data->his_data_type_) { case _DYNA_DATA: WriteDynaData(flw_data->his_data_type_); break; case _L2_MMPEX: WriteL2MMPEX(flw_data->his_data_type_); break; case _L2_REPORT: WriteL2Report(flw_data->his_data_type_); break; case _L2_ORDER_STAT: WriteOrderStat(flw_data->his_data_type_); break; case _IOPV: WriteIOPV(flw_data->his_data_type_); break; case _MATU_YLD: WriteMatuYld(flw_data->his_data_type_); break; default: break; } } chaos_data::SymbolStatic_SYMBOL_SUBTYPE FlwHisStk::GetSymbolSubType( const char sub_type) { int8 c_sub_type = sub_type; switch (c_sub_type) { case chaos_data::SymbolStatic_SYMBOL_SUBTYPE_ASHARE: return chaos_data::SymbolStatic_SYMBOL_SUBTYPE_ASHARE; case chaos_data::SymbolStatic_SYMBOL_SUBTYPE_BSHARE: return chaos_data::SymbolStatic_SYMBOL_SUBTYPE_BSHARE; case chaos_data::SymbolStatic_SYMBOL_SUBTYPE_GOV_BOND: return chaos_data::SymbolStatic_SYMBOL_SUBTYPE_GOV_BOND; case chaos_data::SymbolStatic_SYMBOL_SUBTYPE_ENT_BOND: return chaos_data::SymbolStatic_SYMBOL_SUBTYPE_ENT_BOND; case chaos_data::SymbolStatic_SYMBOL_SUBTYPE_FIN_BOND: return chaos_data::SymbolStatic_SYMBOL_SUBTYPE_FIN_BOND; default: return chaos_data::SymbolStatic_SYMBOL_SUBTYPE_NILTYPE; } } chaos_data::SymbolStatic_SYMBOL_SP FlwHisStk::GetSymbolSP(const char sp) { int8 c_sp = sp; switch (c_sp) { case chaos_data::SymbolStatic_SYMBOL_SP_NSP: return chaos_data::SymbolStatic_SYMBOL_SP_NSP; case chaos_data::SymbolStatic_SYMBOL_SP_SSP: return chaos_data::SymbolStatic_SYMBOL_SP_SSP; case chaos_data::SymbolStatic_SYMBOL_SP_PSP: return chaos_data::SymbolStatic_SYMBOL_SP_PSP; case chaos_data::SymbolStatic_SYMBOL_SP_TSP: return chaos_data::SymbolStatic_SYMBOL_SP_TSP; case chaos_data::SymbolStatic_SYMBOL_SP_LSP: return chaos_data::SymbolStatic_SYMBOL_SP_LSP; case chaos_data::SymbolStatic_SYMBOL_SP_OSP: return chaos_data::SymbolStatic_SYMBOL_SP_OSP; case chaos_data::SymbolStatic_SYMBOL_SP_FSP: return chaos_data::SymbolStatic_SYMBOL_SP_FSP; case chaos_data::SymbolStatic_SYMBOL_SP_ESP: return chaos_data::SymbolStatic_SYMBOL_SP_ESP; case chaos_data::SymbolStatic_SYMBOL_SP_ZSP: return chaos_data::SymbolStatic_SYMBOL_SP_ZSP; default: return chaos_data::SymbolStatic_SYMBOL_SP_NULLSP; } } }
<filename>catalog/bindings/gmd/vector.py from dataclasses import dataclass from bindings.gmd.vector_type import VectorType __NAMESPACE__ = "http://www.opengis.net/gml" @dataclass class Vector(VectorType): class Meta: name = "vector" namespace = "http://www.opengis.net/gml"
Design of decentralized proportionalintegralderivative controller based on decoupler matrix for two-input/two-output process with active disturbance rejection structure The framework of the active disturbance rejection internal model control is proposed to solve the problem of the model reduced-order error in the process of the controller design for two-input/two-output system with time delay. In the controller design process of the two-input/two-output system, the decoupler matrix method is used to decompose a multi-loop control system into a set of equivalent independent single loops. Then, a complex equivalent model is obtained, and its order should be reduced for each individual loop. Maclaurin series method is used to reduce the order of the decoupling model. After reducing model order, the proposed method is applied to lessen the effect of the reduced-order error and improve the anti-interference ability and robustness for the control system. Simulation results show that the proposed method possesses a good disturbance rejection performance.
package bio.terra.service.iam.exception; import bio.terra.common.exception.NotFoundException; public class IamNotFoundException extends NotFoundException { public IamNotFoundException(String message, Throwable cause) { super(message, cause); } public IamNotFoundException(Throwable cause) { super(cause); } }
Positions in finance are some of the most competitive jobs in the UK today—and for good reason. Salaries in the financial sector are high, the benefits are considerable, and the work puts you at the forefront of today’s fast-changing global economy. Many positions in the sector also demand a high level of performance and provide a fast-paced working environment, which makes the job engaging and fulfilling. At Telegraph Jobs, we compile an extensive list of job offerings from around the UK. In our listings, you’ll find career opportunities for entry-level professionals and seasoned veterans alike, and the salaries you’ll see listed in our catalogue reflect some of the most competitive in the nation. Typically, you can expect to earn more than £30k per annum. If you are looking for a non manager financial jobs you have come to the right job board. Browse our listings below to find the latest vacancies.
Finite Element Analysis for the Influence of the Clamping Holder Corner on the Bulging of Thin Metal Shells Peripherally clamped thin shallow hyperbolic metal shells under internal pressure are widely used as rupture discs, quick opening devices and the structures in metal plastic processing. In the bulging process of shells, if the corner radius of the up-holder is too large, negative-curvature zone close to boundary will be enlarged. Contrarily, if the radius is too small, shear rupture will happen in the clamped rim. The contact between the shell and the up-holder corner in deformation is explored by elasto-plastic finite element analysis, and the results are verified with experiments. Influence of the up-holder corner on the mechanical behavior of bulging shells is closely related to the non-dimensional parameter ru/s0 (ratio of the corner radius ru to the original thickness s0). The influence can be partitioned into four regions by three demarcation points, ru/s0 = 0.52, 1.50, and 2.00. The four regions are respectively full effect region, unstable region, near-stable region, and no effect region.
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include <aws/ssm/model/LabelParameterVersionResult.h> #include <aws/core/utils/json/JsonSerializer.h> #include <aws/core/AmazonWebServiceResult.h> #include <aws/core/utils/StringUtils.h> #include <aws/core/utils/UnreferencedParam.h> #include <utility> using namespace Aws::SSM::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; using namespace Aws; LabelParameterVersionResult::LabelParameterVersionResult() : m_parameterVersion(0) { } LabelParameterVersionResult::LabelParameterVersionResult(const Aws::AmazonWebServiceResult<JsonValue>& result) : m_parameterVersion(0) { *this = result; } LabelParameterVersionResult& LabelParameterVersionResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result) { JsonView jsonValue = result.GetPayload().View(); if(jsonValue.ValueExists("InvalidLabels")) { Array<JsonView> invalidLabelsJsonList = jsonValue.GetArray("InvalidLabels"); for(unsigned invalidLabelsIndex = 0; invalidLabelsIndex < invalidLabelsJsonList.GetLength(); ++invalidLabelsIndex) { m_invalidLabels.push_back(invalidLabelsJsonList[invalidLabelsIndex].AsString()); } } if(jsonValue.ValueExists("ParameterVersion")) { m_parameterVersion = jsonValue.GetInt64("ParameterVersion"); } return *this; }
Featuring among the essential qualities which may be expected of transmission equipment are of course its resistance to various disturbances and its capacity to transmit data error-free which are of major importance, and also its behaviour in the event of a breakdown. It is customary to double up all or part of the equipment in order to minimize interruptions to service. In particular, it is conventional to cater for a failure of a supply source by using a second identical supply source connected in redundant mode with the first, that is to say connected in parallel with respect to the load which is connected to the output of the two sources. In practice, electrical energy converters are generally used as supply sources. FIG.1 represents the structure of an item of conventional transmission equipment, which item comprises two energy converters 10 and 20 intended to supply three modules 30, 40 and 50 of the equipment. The two converters constitute the supply device of the equipment. The modules 30 and 50 are supplied by the converters 10 and 20 respectively while the module 40 is supplied by both converters at once. The converter 10 (respectively 20) is supplied between a positive-voltage terminal 11 and a negative-voltage terminal 12 (21 and 22 respectively). The converters are connected in parallel with the module 40, their coupling being effected through blocking diodes 13 (23) from whose cathode a DC supply voltage V0 stems. For this purpose, each converter comprises a common output terminal 14 (24) linked to the input of the module 40 and on which it delivers the supply voltage V0. Furthermore, each converter comprises a voltage regulator 15 (25) for example of the pulse width modulation (PWM) type. A slaving loop 16 (26) maintains the voltage on the common output 14 (24) at the value V0. Each converter also comprises a local output terminal 17 (27) for providing a DC supply voltage V1 (V2) to the module 30 (50) which is not backed-up. In the example of FIG. 1, a voltage V1 or V2 equal to V0 is sought. Accordingly, each converter comprises a diode 18 (28) connected between the output of the regulator and the local output terminal in order to restore on the latter the same voltage as on the common output. Such a structure, although commonly used, nevertheless poses some problems. Thus, the two converters supply the module 40 simultaneously with a DC voltage V0 which is kept constant by the two slaving loops. The two slaving loops having a node in common, they therefore influence one another and may bring about a misbalance of operation between the two converters. Thus, if for example the converter 10 delivers a rising voltage V0, the converter 20 will detect this rise in the voltage V0 and the slaving loop 26 will react so as to lower the output voltage of the regulator 25. At some stage the blocking diode 23 turns off and, the slaving loop 26 being unable to operate, the output of the regulator falls to zero. If the converter 10 then suffers a failure, the converter 20 will start operating normally again, however there will be a transient period during which the module 40 will not be supplied. This period corresponding to an interruption of service of the equipment is not acceptable. Another drawback is that, in the above configuration, the converter 20 is not able to provide the voltage V2 expected on the local output 27 when its slaving loop cannot operate. Finally, such an arrangement ignores the fact that the voltage drop in the diodes of the device varies greatly according to temperature and may therefore introduce disparities between the voltages V0, V1 and V2 which are assumed to be equal in the example of FIG. 1. To remedy these drawbacks, various solutions have been described in the state of the art. A known converter is described in FIG. 2. It differs from the converter 10 of FIG. 1 through its mechanism 16 for slaving the voltage of the common output. The slaving mechanism described in this document takes account of the state (off or on) of the blocking diode in order to control the regulator. To this end, the slaving mechanism 16 taps the voltage either side of the blocking diode 13 by means of two resistor bridges 31, 32 and 33, 34. The midpoint 35 of the resistor bridge 31, 32 is linked to the midpoint 36 of the resistor bridge 33, 34 via a diode 37. The cathode of this diode is connected to the node 35 while the anode is connected to the node 36. The node 36 is moreover connected to the inverting input of an operational amplifier 38 which additionally receives a reference voltage Vref on its non-inverting input. Finally, the output of the amplifier 38 is linked to a control input of the regulator 15. This converter operates as follows: as long as the blocking diode 13 is on, a fraction of the common supply voltage V0 is compared with the reference voltage Vref in order to control the regulator 15. During this phase, the diode 37 is off. On the other hand, as soon as the blocking diode 13 switches off, the diode 37 comes on and the voltage on the node 36 will fall owing to the parallel mounting of the resistors 32 and 34. The operational amplifier 38 therefore receives a falling voltage on its inverting input and its output will therefore act on the regulator in such a way that it increases its output voltage and thus switches the blocking diode 13 back on. Such a converter only partially solves the problems mentioned earlier. Thus, the voltage V1 or V2, delivered on the local output of the converter 10 or 20, of smaller rating is not sufficient when the latter's blocking diode is off or at its turn-off limit. Thus, if the blocking diode switches off, it is because the regulator is not delivering enough to yield the voltage V0 on its common output. Also, since the diodes 13 (23) and 18 (28) are identical, the converter is then unable to deliver enough voltage V1 or V2 on its local output. Moreover this converter does not solve the problem of the spread in the values of the voltage drop in the diodes as a function of temperature.
But will 2016 be even bigger? It looks like it. Disney has been dominating the box office so far this year. It's already crossed $1 billion at the international box office, thanks to the continued success of "Star Wars: The Force Awakens" and the better-than-expected global strength of Walt Disney Animation's hit "Zootopia." Passing the $1 billion milestone in March is the earliest Disney has marked that achievement. Domestically, things are great, too, as Disney leads all studios with over $830 million in grosses. That's up $149% from this time last year for the company. A big reason for its early 2016 success is the dominance by titles "Zootopia" and "The Jungle Book." "Zootopia" opened to incredible reviews, which were then matched by the movie hitting No. 1 at the domestic box office for three straight weeks. It's been even more impressive overseas, claiming the studio's biggest animated debut in numerous territories and becoming the highest-grossing animated film in China. Word that "The Jungle Book" already had a sequel in the works before its release was a good sign, but then it blew away all expectations with a $103 million domestic opening. It then dipped only 41% with $60.8 million in its second weekend in theaters. Overseas, the movie has already surpassed its domestic total with over $340 million (the film now has a worldwide total of $533.5 million). The bad news for other Hollywood studios? Disney is just getting started. Its latest Marvel release, "Captain America: Civil War," which many critics are calling the best Marvel movie yet, comes out May 6 and is projected to open domestically at a whopping $175 million. It's likely "The Jungle Book" will stay at No. 1 at the domestic box office until then. And with competition for "Civil War" weak until the release of "X-Men: Apocalypse" on May 27, a Disney movie could possibly be No. 1 at the domestic box office for six straight weeks. And by the time "Apocalypse" comes around, it's certainly possible that "Alice Through the Looking Glass" (yes, a Disney title), which goes up against the superhero flick, could actually win out. "Don't count out 'Alice,'" Jeff Bock, senior box-office analyst at Exhibitor Relations, told Business Insider. "The original debut was $116 million," he noted, while the last X-Men movie, "X-Men: Days of Future Past," opened at $90.8 million, so it could be a photo finish that weekend. After "Alice," the Disney lineup looks impressive: "Finding Dory" (June 17), "The BFG" (July 1), "Doctor Strange" (November 4), "Rogue One: A Star Wars Story" (December 16). "Every single big-budget Disney film on the release calendar in 2016 looks like a bona-fide hit," Bock said. And if smaller movies like "Pete's Dragon" (August 12) and "Moana" (November 23) perform well, it's just more fuel for the studio. Though last year Universal edged out Disney with a $6.7 billion worldwide take, if things work out this year, the house that Mickey built and now Marvel protects will hit that coveted $6 billion mark and be the studio atop the mountain. "What we're dealing with here is a super-studio, while all other competition are mere mortals," Bock said of Disney.
/** * This class holds grid column filter value to save and reload. * * @author Faruk.Bozan */ public class ColumnFilterValue implements Serializable { private static final long serialVersionUID = 1L; /** * Column id. */ private String columnId; /** * Filter value. */ private Object filterValue; /** * Data type of column. */ private DataType dataType; public ColumnFilterValue() { } public ColumnFilterValue(String columnId, Object filterValue, DataType dataType) { this.columnId = columnId; this.filterValue = filterValue; this.dataType = dataType; } /** * @return the columnId */ public String getColumnId() { return columnId; } /** * @param columnId the columnId to set */ public void setColumnId(String columnId) { this.columnId = columnId; } /** * @return the filterValue */ public Object getFilterValue() { return filterValue; } /** * @param filterValue the filterValue to set */ public void setFilterValue(Object filterValue) { this.filterValue = filterValue; } /** * @return the dataType */ public DataType getDataType() { return dataType; } /** * @param dataType the dataType to set */ public void setDataType(DataType dataType) { this.dataType = dataType; } }
Educational differences in healthy, environmentally sustainable and safe food consumption among adults in the Netherlands Abstract Objective: To assess the differences in healthy, environmentally sustainable and safe food consumption by education levels among adults aged 1969 in the Netherlands. Design: This study used data from the Dutch National Food Consumption Survey 200710. Food consumption data were obtained via two 24-h recalls. Food consumption data were linked to data on food composition, greenhouse gas emissions (GHGe) and concentrations of contaminants. The Dutch dietary guidelines, dietary GHGe and dietary exposure to contaminants were used as indicators for healthy, environmentally sustainable and safe food consumption, respectively. Setting: The Netherlands. Participants: 2106 adults aged 1969 years. Results: High education groups consumed significantly more fruit (+28 g), vegetables (men +22 g; women +27 g) and fish (men +6 g; women +7 g), and significantly less meat (men 33 g; women 14 g) compared with low education groups. Overall, no educational differences were found in total GHGe, although its food sources differed. Exposure to contaminants showed some differences between education groups. Conclusions: The consumption patterns differed by education groups, resulting in a more healthy diet, but equally environmentally sustainable diet among high compared with low education groups. Exposure to food contaminants differed between education groups, but was not above safe levels, except for acrylamide and aflatoxin B1. For these substances, a health risk could not be excluded for all education groups. These insights may be used in policy measures focusing on the improvement of a healthy diet for all.
<reponame>LlucBonet/asor-repo<filename>practica2.4/ejercicio05.c #include <stdio.h> #include <unistd.h> #include <fcntl.h> #include <sys/types.h> #include <sys/stat.h> #include <sys/select.h> int main(){ char buffer[256]; int fd1, fd2; int cambios = 0; int nfds; int size; fd_set set; if((fd1 = open("tuberia1", O_RDONLY | O_NONBLOCK)) == -1){ perror("Error abriendo la tuberia1.\n"); return -1; } if((fd2 = open("tuberia2", O_RDONLY | O_NONBLOCK)) == -1){ perror("Error abriendo la tuberia2.\n"); } while(cambios != -1){ FD_ZERO(&set); FD_SET(fd1, &set); FD_SET(fd2, &set); if(fd1 > fd2) nfds = fd1 + 1; else nfds = fd2 + 1; cambios = select(nfds, &set, NULL, NULL, NULL); if(cambios == -1){ perror("Error en select().\n"); return -1; } else if(cambios > 0){ if(FD_ISSET(fd1, &set)){ size = read(fd1, buffer, sizeof(buffer)-1); buffer[size] = '\0'; printf("Tuberia1: %s", buffer); close(fd1); fd1 = open("tuberia1", O_RDONLY | O_NONBLOCK); } if(FD_ISSET(fd2, &set)){ size = read(fd2, buffer, sizeof(buffer)-1); buffer[size] = '\0'; printf("Tuberia2: %s", buffer); close(fd2); fd2 = open("tuberia2", O_RDONLY | O_NONBLOCK); } } } close(fd1); close(fd2); return 0; }
<reponame>wasmColonies/core use crate::ColonyEvent; use eventsourcing::{Aggregate, AggregateState}; use wasmcolonies_protocol::{ColonyCommand, UnitType}; pub struct ConstructionSite; impl Aggregate for ConstructionSite { type Event = ColonyEvent; type Command = ColonyCommand; type State = ConstructionSiteData; fn apply_event(state: &Self::State, evt: &Self::Event) -> eventsourcing::Result<Self::State> { Ok(match evt { ColonyEvent::TickFinished(_t) => ConstructionSiteData { remaining: state.remaining.saturating_sub(1), ..state.clone() }, ColonyEvent::UnitConstructionBegan { tick, utype, yield_in, } => ConstructionSiteData { began: *tick, yields: utype.clone(), remaining: *yield_in, ..state.clone() }, _ => state.clone(), }) } fn handle_command( _state: &Self::State, cmd: &Self::Command, ) -> eventsourcing::Result<Vec<Self::Event>> { Ok(match cmd { ColonyCommand::ConstructUnit(tick, ut) => { vec![ColonyEvent::UnitConstructionBegan { tick: *tick, utype: ut.clone(), yield_in: 1000, // TODO: TURN THIS INTO A GAME PARAMETER }] } _ => vec![], }) } } #[derive(Debug, Clone)] pub struct ConstructionSiteData { id: u64, began: u64, generation: u64, remaining: u64, yields: UnitType, } impl AggregateState for ConstructionSiteData { fn generation(&self) -> u64 { self.generation } }
Nick and Caroline Savage on recreating Red Dwarf using LEGO. Red Dwarf X is airing from 4 October 2012 on Dave What prompted you to create the Red Dwarf cast? Red Dwarf is a British institution – everyone above a certain age remembers the programme with such fondness and nostalgia that their resurrection in a new series needed celebrating! The thing is, those same people remember LEGO with the same fondness and nostalgia, so it seemed only right that we combine the two in some kind of freakish experiment. Which was the hardest character to customise and why? That’s a toss-up between Lister and Kryton. Lister was hard to do because it’s hard to get his trademark gross-ity (which is a word) into LEGO. There was a lot of experimentation with curry stain colours. Besides, LEGO don’t make his dreadlocks, so we had to use a hat instead. Kryton’s head is also a pretty tough thing to make, given that we had to draw angles on a cylindrical head! The challenge is to balance lots of details against keeping the ‘LEGO-ness’. You need lots of bold lines, which makes designing them pretty tough. How does the process work? Do you sit down with reference photos and go through your bits box looking for things you can cannibalise? Pretty much! We find the best, most iconic photos we can of what we want to make. We’re just a husband and wife team, so I do all the design and Photoshop work, while Caroline works on the customisation and actual LEGO side, ripping poor LEGO minifigs to bits. She knows LEGO inside out and back to front! Lister’s hat used to belong to a LEGO detective, I think. It gets confusing. It leads to some pretty weird one-liners that other married couples probably don’t ever say. Like “Do you have the box of heads?” Customising minifigs seems quite popular on the internet. Is there a bit of a community behind it? There’s a really strong LEGO community out there, and more people are having a bit of fun by customising their minifigs. We have a good relationship with quite a lot of them – such as http://www.customminifig.co.uk/ – but we started fairly independently when we made our team mates for Roller Derby, our other love! What other sci-fi shows would you like to turn your talents to? We’ve already made some Doctor Whos – clearly! We’re working our way through them. Besides that, I’m sure we’ll end up doing Star Trek and Battlestar Galactica at some point. Personally, I’m dying to make some Blade Runner figs, too. So much possibility! See what Nick and Caroline Savage do next at minifigs.me and facebook.com/customminifigs. Red Dwarf X will air on Dave from 4 October 2012, and is available to pre-order on DVD for £14.00 andBlu-ray for £17.00 from Amazon.co.uk
Cataract Blindness in Osun State, Nigeria: Results of a Survey Purpose: To estimate the burden of blindness and visual impairment due to cataract in Egbedore Local Government Area of Osun State, Nigeria. Materials and Methods: Twenty clusters of 60 individuals who were 50 years or older were selected by systematic random sampling from the entire community. A total of 1,183 persons were examined. Results: The age- and sex-adjusted prevalence of bilateral cataract-related blindness (visual acuity (VA) < 3/60) in people of 50 years and older was 2.0% (95% confidence interval (CI): 1.62.4%). The Cataract Surgical Coverage (CSC) (persons) was 12.1% and Couching Coverage (persons) was 11.8%. The age- and sex-adjusted prevalence of bilateral operable cataract (VA < 6/60) in people of 50 years and older was 2.7% (95% CI: 2.33.1%). In this last group, the cataract intervention (surgery + couching) coverage was 22.2%. The proportion of patients who could not attain 6/60 vision after surgery were 12.5, 87.5, and 92.9%, respectively, for patients who underwent intraocular lens (IOL) implantation, cataract surgery without IOL implantation and those who underwent couching. Lack of awareness (30.4%), no need for surgery (17.6%), cost (14.6%), fear (10.2%), waiting for cataract to mature (8.8%), AND surgical services not available (5.8%) were reasons why individuals with operable cataract did not undergo cataract surgery. Conclusions: Over 600 operable cataracts exist in this region of Nigeria. There is an urgent need for an effective, affordable, and accessible cataract outreach program. Sustained efforts have to be made to increase the number of IOL surgeries, by making IOL surgery available locally at an affordable cost, if not completely free.
#include<stdio.h> int main(){ int m,b; long long sum,t,x; t=0; scanf("%d%d",&m,&b); for(int y = 0;y <= b;y++){ x=(b-y)*m; sum=(x+1)*(1+y)*y/2+(y+1)*(1+x)*x/2; if(t<sum) t=sum; } printf("%lld\n",t); return 0; }
<reponame>bkahlert/api-usability-analyzer package de.fu_berlin.imp.apiua.diff.model; import de.fu_berlin.imp.apiua.core.model.TimeZoneDate; import de.fu_berlin.imp.apiua.diff.model.impl.DiffRecord; import de.fu_berlin.imp.apiua.diff.model.impl.DiffRecords; public interface IDiffRecords extends Iterable<IDiffRecord> { /** * Creates a {@link DiffRecord} and add it to this {@link DiffRecords} * * @param filename * @param date */ public IDiffRecord createAndAddRecord(String filename, TimeZoneDate dtae); /** * Creates a {@link DiffRecord} and add it to this {@link DiffRecords} * * @param commandLine * @param metaOldLine * @param metaNewLine * @param contentStart * @param contentEnd */ public IDiffRecord createAndAddRecord(String commandLine, String metaOldLine, String metaNewLine, long contentStart, long contentEnd); public IDiffRecord get(int i); public int size(); public Object[] toArray(); }
Analysis of the concept of resurrection in Sezai Karako's poem "Taha'nn Dirilii" in the context of conceptual metaphor In this study, the poem Taha'nn Dirili, which is included in the work of Sezai Karako's Taha'nn Kitab, was analyzed with the metaphor of resurrection and the metaphorical expressions in this poem were tried to be revealed. First of all, in the study, the concept of metaphor was tried to be clarified, then the concept of resurrection in the poem was handled on a metaphorical plane. To better understand the concept of "Resurrection", the thought writings of Sezai Karako were also used. This study, it is aimed to determine the metaphors used by examining Sezai Karako's poem Taha'nn Dirilisi. In the study, an effort was made to reveal the metaphors used in the Taha'nn Dirilisi poem by using the document analysis technique, which is one of the descriptive analysis methods.
In an age of information overload, it is increasingly becoming difficult to take a right decision whether it be to get a new broadband connection or to apply for a car loan. Taking advantage of such a scenario, different startups are offering services and helping customers to make informed choices. One such startup is SmartChoice. The portal, which was among the first batch of startups incubated at the Google-backed Nest i/O, was launched in January 2015 with broadband comparison. It now offers comparison of different products and services, including credit cards, broadband connection (both home and corporate), health, car and travel insurance. Sibtain Jiwani, the co-founder and CEO of SmartChoice, told The Express Tribune he wanted to launch the startup soon after moving back from England after completing his education in 2008 but couldn’t due to slow adoption of technology. SmartChoice is not the only one providing such services in the country. KarloCompare, a personal finance aggregation platform of CompareOn Pakistan Private Limited, also offers similar services. Co-founded by Sumair Farooqui and Ali Ladhubhai, the website went live on April 1, 2016 and became transactional on in June 2016. Prior to launching the startup, both Sumair and Ali worked in the banking sector. “KarloCompare is dedicated to personal finance (i.e. credit cards, personal loans, and auto loans), general insurance and broadband services. In the coming quarter we will be adding deposits, investments and other consumer oriented insurance products,” said Sumair. Both Sibtain and Sumair feel that there’s a market for such business in Pakistan. “Customers are always looking for a professional suggestion,” Sibtain commented adding that consumer can make the informed choice only if they are aware of all the options. The basic purpose of every business is to make money. So if these startups serve consumers for free, how do they sustain. Additionally, the startup also runs promotional campaigns for their partners to advertise their products to generate revenue. KarloCompare also generates revenue through similar means. “We work on a few different pricing models depending on the product category and generate income through conversions from our service partners (i.e. banks, insurance, and broadband companies),” said Sumair.
Superhydrophobic Candle Soot as a Low Fouling Stable Coating on Water Treatment Membrane Feed Spacers. Membrane separation processes including reverse osmosis are now considered essential techniques for water and wastewater treatment, especially in water-scarce areas where desalination and water reuse can augment the water supply. However, biofouling remains a significant challenge for these processes and in general for marine biological fouling, which results in increased energy consumption and high operational costs. Especially in flat sheet membrane modules, intense biofilm growth occurs on the feed spacer at points of contact to the membrane surface. Here, we developed an ultrastable superhydrophobic antibiofouling feed spacer that resists biofilm growth. A commercial polypropylene feed spacer was coated with poly(dimethylsiloxane) (PDMS), and then, candle soot nanoparticles (CSNPs) were embedded into the ultrathin layer of PDMS, which resulted in a superhydrophobic nanostructured surface with a contact angle >150°. The CSNP-coated spacer was examined for inhibition of biofilm growth by a cross-flow membrane channel using Pseudomonas aeruginosa (PA01), and the coating was examined for effectiveness in marine fouling by testing the adhesion of marine bacterium Cobetia marina and diatom Navicula perminuta in a dynamic accumulation assay. In all cases, the CSNP coatings showed almost complete elimination of biofilm growth under the conditions tested. Confocal laser scanning microscopy and scanning electron microscopy indicated a 99% reduction in biofilm growth on the modified spacers compared to the uncoated controls. This effect was attributed to the superhydrophobic nanostructured surface, where trapped gasses formed a plastron on the coating. This plastron was observed to be extremely stable over time and could even be replenished at elevated temperatures. Development of similar antibiofouling coatings on feed spacers or other marine applications might lead to improvements in many industrial processes including membrane filtration where increased membrane life span and reduced energy consumption are key to implementation.
// Public Resource ℗ 2021 <NAME> // Public Resource ℗ 2021 𝖡𝗂𝗍𝖼𝗈𝗂𝗇 𝖣𝖾𝗏𝖾𝗅𝗈𝗉𝖾𝗋𝗌 // Public Resource ℗ 2020 𝖠𝗆𝖾𝗋𝗈 𝖣𝖾𝗏𝖾𝗅𝗈𝗉𝖾𝗋𝗌 // THIS REPOSITORY IS LICENSED UNDER THE AMERO PUBLIC RESOURCE LICENSE. #ifndef BITCOIN_LOGGING_H #define BITCOIN_LOGGING_H #include <fs.h> #include <tinyformat.h> #include <atomic> #include <cstdint> #include <string> #include <vector> static const bool DEFAULT_LOGTIMEMICROS = false; static const bool DEFAULT_LOGIPS = false; static const bool DEFAULT_LOGTIMESTAMPS = true; static const bool DEFAULT_LOGTHREADNAMES = false; extern const char * const DEFAULT_DEBUGLOGFILE; extern bool fPrintToConsole; extern bool fPrintToDebugLog; extern bool fLogTimestamps; extern bool fLogTimeMicros; extern bool fLogThreadNames; extern bool fLogIPs; extern std::atomic<bool> fReopenDebugLog; extern std::atomic<uint64_t> logCategories; struct CLogCategoryActive { std::string category; bool active; }; namespace BCLog { enum LogFlags : uint64_t { NONE = 0, NET = (1 << 0), TOR = (1 << 1), MEMPOOL = (1 << 2), HTTP = (1 << 3), BENCHMARK = (1 << 4), ZMQ = (1 << 5), DB = (1 << 6), RPC = (1 << 7), ESTIMATEFEE = (1 << 8), ADDRMAN = (1 << 9), SELECTCOINS = (1 << 10), REINDEX = (1 << 11), CMPCTBLOCK = (1 << 12), RANDOM = (1 << 13), PRUNE = (1 << 14), PROXY = (1 << 15), MEMPOOLREJ = (1 << 16), LIBEVENT = (1 << 17), COINDB = (1 << 18), QT = (1 << 19), LEVELDB = (1 << 20), //Start Amero CHAINLOCKS = ((uint64_t)1 << 32), GOBJECT = ((uint64_t)1 << 33), INSTANTSEND = ((uint64_t)1 << 34), KEEPASS = ((uint64_t)1 << 35), LLMQ = ((uint64_t)1 << 36), LLMQ_DKG = ((uint64_t)1 << 37), LLMQ_SIGS = ((uint64_t)1 << 38), MNPAYMENTS = ((uint64_t)1 << 39), MNSYNC = ((uint64_t)1 << 40), COINJOIN = ((uint64_t)1 << 41), SPORK = ((uint64_t)1 << 42), NETCONN = ((uint64_t)1 << 43), //End Amero NET_NETCONN = NET | NETCONN, // use this to have something logged in NET and NETCONN as well ALL = ~(uint64_t)0, }; } /** Return true if log accepts specified category */ static inline bool LogAcceptCategory(uint64_t category) { return (logCategories.load(std::memory_order_relaxed) & category) != 0; } /** Returns a string with the log categories. */ std::string ListLogCategories(); /** Returns a string with the list of active log categories */ std::string ListActiveLogCategoriesString(); /** Returns a vector of the active log categories. */ std::vector<CLogCategoryActive> ListActiveLogCategories(); /** Return true if str parses as a log category and set the flags in f */ bool GetLogCategory(uint64_t *f, const std::string *str); /** Send a string to the log output */ int LogPrintStr(const std::string &str); /** Formats a string without throwing exceptions. Instead, it'll return an error string instead of formatted string. */ template<typename... Args> std::string SafeStringFormat(const std::string& fmt, const Args&... args) { try { return tinyformat::format(fmt, args...); } catch (std::runtime_error& fmterr) { std::string message = tinyformat::format("\n****TINYFORMAT ERROR****\n err=\"%s\"\n fmt=\"%s\"\n", fmterr.what(), fmt); fprintf(stderr, "%s", message.c_str()); return message; } } /** Get format string from VA_ARGS for error reporting */ template<typename... Args> std::string FormatStringFromLogArgs(const char *fmt, const Args&... args) { return fmt; } static inline void MarkUsed() {} template<typename T, typename... Args> static inline void MarkUsed(const T& t, const Args&... args) { (void)t; MarkUsed(args...); } // Be conservative when using LogPrintf/error or other things which // unconditionally log to debug.log! It should not be the case that an inbound // peer can fill up a user's disk with debug.log entries. #ifdef USE_COVERAGE #define LogPrintf(...) do { MarkUsed(__VA_ARGS__); } while(0) #define LogPrint(category, ...) do { MarkUsed(__VA_ARGS__); } while(0) #else #define LogPrintf(...) do { \ if (fPrintToConsole || fPrintToDebugLog) { \ std::string _log_msg_; /* Unlikely name to avoid shadowing variables */ \ try { \ _log_msg_ = tfm::format(__VA_ARGS__); \ } catch (tinyformat::format_error &e) { \ /* Original format string will have newline so don't add one here */ \ _log_msg_ = "Error \"" + std::string(e.what()) + "\" while formatting log message: " + FormatStringFromLogArgs(__VA_ARGS__); \ } \ LogPrintStr(_log_msg_); \ } \ } while(0) #define LogPrint(category, ...) do { \ if (LogAcceptCategory((category))) { \ LogPrintf(__VA_ARGS__); \ } \ } while(0) #endif // USE_COVERAGE fs::path GetDebugLogPath(); bool OpenDebugLog(); void ShrinkDebugFile(); #endif // BITCOIN_LOGGING_H
Nest was not the first smart thermostat to reach the hands of consumers. But it was the first that made our parents (and maybe even some of our grandparents) raise an eyebrow. Its cylindrical form and simple GUI are nothing, if not inviting to use, and its ability to learn from your usage habits not only offers convenience, but possible savings when it comes to the power bill. Now with the second generation iteration of Nest—one that is slimmer and guaranteed to work with 95% of home heating systems—the product wants to go from being a buzzy new product to a mainstream, must-have home gadget. Thermostat Automagically Learns Your Heating Habits Winter is coming. Why not keep you and your dire wolves warm with a temperature gauge that learns… Read more Read Advertisement In addition to being 20 percent thinner, Nest says that the redesigned stainless steel ring was engineered to reflect the color of the wall it sits on, helping to camouflage it in the home. And thanks to the 3.0 software update, Nest also now knows what type of heating system you have in the home, and will optimize the time it kicks on at to deliver the temperature you want, when you want. And nest is now compatible with more Android devices—specifically tablets—so that you can easily control the thermostat from anywhere in the house. Expect to see the latest version of Nest popping up in stores (including Lowe's, Apple stores, and Amazon) later this month for $250. And you can snag an older Nest—which will have all the same functionality as the new one, just in a slightly bulkier body—for $230 at Lowe's while they're still in stock. [Nest]
<reponame>megmogmog1965/awscostchart<gh_stars>0 #!/usr/bin/env python # encoding: utf-8 ''' Created on Aug 4, 2016 @author: <NAME> ''' class _HttpError(Exception): ''' :see: http://flask.pocoo.org/docs/0.10/patterns/apierrors/ ''' def __init__(self, message=None, status_code=500, payload=None): Exception.__init__(self, message) self._message = message self._status_code = status_code self._payload = payload @property def message(self): return self._message @property def status_code(self): return self._status_code def to_dict(self): rv = dict(self._payload or ()) rv['message'] = self.message return rv def make_httperror(status_code, message): ''' :rtype: :class:`flaskserver.utils.http_error._HttpError` ''' return _HttpError(message=message, status_code=status_code)
line=input().split() n=int(line[0]) w=int(line[1]) minsum=0 a=input().split() for i in range (n): a[i]=int(a[i]) minsum+=(a[i]+1)//2 if (minsum>w): print ("-1") else: vols=[str((a[i]+1)//2) for i in range(n)] extra=w-minsum while (extra>0): maxcup=-1 maxsize=0 for i in range (n): if a[i]>maxsize: maxcup=i maxsize=a[i] if maxcup==-1: print (1+" ") vols[maxcup]=str(min(maxsize, (maxsize+1)//2 + extra)) extra -= int(vols[maxcup])-(maxsize+1)//2 a[maxcup]=-1 print (" ".join(vols))
Differential expansion of neural projection systems in primate brain evolution. Whole brain MRI scans from 11 primate species (43 individuals) spanning more than a 50-fold range in brain volume were used to determine whether the corpus callosum keeps pace with the growth of the forebrain among living anthropoid primates. Interhemispheric connectivity via the corpus callosum and anterior commissure was reduced in larger primate brains, whereas intrahemispheric connectivity was augmented. We also show that the splenium constitutes an increasing proportion of callosal area with increasing brain size. This may function to maintain rapid integration of the left and right visual space as brain size increases. These results indicate that the evolution of larger brain size in primates results in increasingly independent hemispheres.
Fabrication and Use of a Veterinary Dental Teaching Model --gently and at the right time, the form can be preserved and reused to make another model (Fig. 4). Once the model has hardened completely, rough edges can be smoothed using an acry lic bur or similar device. The model is rinsed and is then ready for use. Simulated Calculus: Cement patch or filling materials simulate the physical properties of calculus. A cement coloring compound can be used to shade the cement to a natural color (Fig. 5). These materials can be found at home improvement or hardware stores. The coloring compound is mixed with the cement and then applied to the teeth of the model and allowed to dry (Figs. 6, 7). Dental Prophylaxis: A complete dental prophylaxis procedure can be dernonstrat....._~---'-~O= ed and performed on a model of this type (Fig. 8). A comm ercially available laboratory spill tray> makes a handy portable work area that can be used in a wet laboratory setting (Fig. 9).
People are strengthening resistance to imperialist intervention in Venezuela while imperialists’ design is being exposed. Tension has increased with the arrival of imperialist “aid requested” by Guaido. US has called on Venezuelan military leaders to back the “aid” plan. Venezuelan authorities have warned that the attempt with the so-called aid represented a provocation, pointing out that the amount of aid being sent pales in comparison to the Venezuelan assets and accounts frozen outside the country. “Humanitarian aid should never be used as a political pawn,” UN Secretary General Antonio Guterres said on Thursday. Large numbers of Venezuelan citizens are signing a petition against imperialist intervention. Anti-imperialist activists are gathering signatures for a campaign to show “support for peace”. Maduro announced Tuesday that 10 million signatures would be collected. In Caracas, people lined up to sign the petition, which was greeted by a large-scale rally amid anti-U.S. slogan Yankees Go Home. In order to sign, citizens are required to show valid identification. The UN has warned against using aid as a pawn in Venezuela after the U.S. sent food and medicine to the country’s border. U.S. officials claimed trucks carrying aid had arrived in Colombia for delivery to Venezuela at the request of Guaido, the self-declared “interim president” after an attempted coup on January 23. On Sunday, Guaido illegally called a multinational coalition to send humanitarian aid through third parties in Brazil, Colombia, and the Caribbean. However, in a statement, the Colombian branch of The International Red Cross and Red Crescent Movement denounced the international coalition as counterintuitive. “Humanitarian action needs to be independent of political, military or other objectives,” U.N. spokesperson Stephane Dujarric told reporters in New York. “When we see the present stand-off it becomes even more clear that serious political negotiations between the parties are necessary to find a solution […],” he said. “What is important is that humanitarian aid be depoliticized and that the needs of the people should lead in terms of when and how humanitarian aid is used,” Dujarric said. There have been whispers in Washington that the Trump administration is “seriously considering” a military intervention in Venezuela if Maduro does not step down or be ousted internally. The U.S. and right wing governments in the region have been calling on the Venezuelan military to oust Maduro. However, the military has stayed at Maduro’s side throughout the last few weeks, in full support of his legitimate claim to the presidency and rejected such interventionist demands and a breach of the Venezuelan sovereignty. As European and Latin American leaders met on Thursday to seek a peaceful and political solution to Venezuela’s situation, the final declaration of the International Contact Group (ICG) was not eventually adopted by all the countries attending the international conference, with Bolivia, Mexico and the Community of the Caribbeans (Caricom) declining to sign the EU-backed agreement calling for elections in Venezuela “as soon as possible”. According to the Uruguayan Foreign Minister, Rodolfo Nin Novoa, Bolivia, Mexico and the member states of the Community of the Caricom, have not signed the text, which suggested new elections, the coordination of a humanitarian and a technical mission on Venezuelan territory. During the meeting, the EU-backed ICG on Venezuela called for a more hands-off approach than that advocated by the U.S. and some of their Latin American conservative allies. The conference was convened by the governments of Mexico and Uruguay, which decided to adopt a neutral and non-interventionist. The objectives of the final declaration of Thursday’s ICG were different from the Montevideo Mechanism proposed by the foreign ministers of Uruguay and Mexico a day earlier in which four phases were established to achieve dialogue in Venezuela between the parties involved. 1: An immediate dialogue and the generation of necessary conditions to achieve contact between the parties involved in the conflict. 2: Negotiation, presentation of the results of the dialogue and a space for the positions that allow for finding points in common between the parties. 3: Commitment and subscription of the agreements. 4: Implementation and realization of the agreements with the support of international accompaniment. The representatives of Mexico and Bolivia stressed that the declaration of the IGC poses interference points in the internal affairs of Venezuela since it intends to impose actions that are not within its competence. He also urged countries that have carried out illegal sanctions against Venezuela, including the EU itself, to lift them, since he considers that “the blockade against Venezuela is what is affecting the economy” of the nation. For his part, President of Venezuela Maduro spoke in favor of the Montevideo Mechanism, which was agreed at the meeting on February 6 between 14 CARICOM countries, Mexico, Bolivia and Uruguay. The United States and its right-wing allies in Latin America have come out in support of a right-wing coup attempt against the Venezuelan government of socialist President Maduro. Peruvian President Martin Vizcarra told the press that his government is against any military intervention in Venezuela since it’s up to its citizens to resolve the political situation in Venezuela. Peru is a founding member of the Lima Group bloc meant to pressure Maduro out of office. Some 500 luminaries from 27 Latin American and European countries are signatories to a letter of support for the initiative to promote a negotiated solution and dialogue for peace in Venezuela. The document will be sent to Uruguayan President Tabare Vazquez and Mexican President Andres Manuel Lopez Obrador (AMLO). The letter was also signed by Dilma Rousseff, former president of Brazil; Estela de Carlotto, president of Grandmothers of Plaza de Mayo; Angela Maria Robledo, former candidate for the vice presidency of Colombia; Leonardo Boff, theologian from Brazil; Dimitrios Papadimoulis, vice president of the European parliament; Adriana Salvatierra, president of the Chamber of the Senate of Bolivia; Joao Pedro Stedile, leader of Brazil’s Landless Movement; Gleisi Hoffmann, president of the Brazilian Workers’ Party; Arantxa Izurdiaga Osinaga, member of the parliament of Navarre; Bill Bowring, president of the European Lawyers for Democracy and Human Rights; Daniel Caggiani, president of the Mercosur parliament; and parliamentarians Camila Vallejo from Chile and Irene Montero of Spain. “From our spaces and roles we accompany and adhere to the initiatives of dialogue and political negotiations aimed at peace in the region and the world […]” the letter concludes. Britain’s opposition Labour Party’s foreign affairs policy chief Emily Thornberry said Wednesday, that her party is against the move by EU states to recognize Guaido as the “interim president” of Venezuela saying that diplomacy and dialogue should be the way forward instead of taking sides. “You begin the dialogue and that offer has been made internally and externally,” the shadow foreign minister said. Thornberry said if in power, the party would pursue diplomacy that put values above commercial gain. She went on to say that she would support the idea of new elections to end the standoff between the Venezuelan government and the right-wing opposition. Maduro has repeatedly called for the restoration of talks between his government and the opposition in order to maintain peace and avoid a U.S.-backed coup, or even military intervention by the U.S. The UN has also stressed its recognition for the government of Nicolas Maduro and refused to recognize Guaido’s actions. The official revealed that thanks to a Venezuelan intelligence operation, retired Colonel Palomo was arrested after he wanted to enter the country to organize a military coup. He denounced that the U.S. and Colombian governments supported the coup attempts, once in May 2018 in the framework of the presidential elections; and another in January 2019, which have already been defeated. Rodriguez reported that Palomo coordinated from Cucuta the regime change operation and had had numerous trips to Miami, despite an Interpol’s request for capture by the Venezuelan government. After his capture, Palomo has given statements and in view of the seriousness of his confessions, the Venezuelan prosecutor approved showing part of his confessions to the public and the media. Venezuelan authorities seized a bunch of U.S-made weapons during an operation in the Aducarga storage yard at the Arturo Michelena International Airport, in the state of Valencia. The Deputy Minister of Prevention and Citizen Security of Venezuela, Endes Palencia wrote on Twitter that the arms came from Miami. During the operation, members of Command of Area 41 of the Bolivarian National Guard and officials of the National Integrated Service of Customs and Tax Administration were present. The Prosecutor’s Office ordered the investigation to find those responsible for financing groups that want to threaten the peace and order of the Bolivarian Republic. “19 rifles, 118 rifle chargers, 4 rifle holders 3 gun sights, 90 radio antennas, 6 telephones were found in the storage yard of the Valencia airport which entered the country # 3Feb in the Air Bus N881YV from Miami, USA # 5Feb,” the deputy minister wrote. The arms were allegedly linked to groups attempting a failed coup in Venezuela. This operation came at a time when the U.S. President Trump expressed full support for the Venezuelan opposition among whom Guaido illegally declared himself an interim president of the country. Anyway, Russia and China don’t care about US sanctions,” he said. Protesters in London gathered outside of the Bank of England (BoE) to demand it give Venezuela back 31 tons of gold that belong to the Latin American country. It comes as the self-styled leader Guaido wrote to UK Prime Minister Theresa May requesting she send the gold, worth almost £1 billion, to him instead of the government of elected President Maduro. Venezuela Solidarity Campaign (VSC) vice-chairman Doug Nicholls said piracy seems to be “up and running” at the Bank. “On the one hand British politicians cry crocodile tears over what they see as impoverishment and hunger in Venezuela, on the other they ignore even the UN’s recognition that much of this has been caused by US sanctions, and to rub salt into the wound they’re trying to steal Venezuela’s gold,” he said. Labour MP Chris Williamson, who attended the demonstration, told that for the British government to be “falling in line behind” and “behaving like Trump’s poodle” is “completely unacceptable,” as is the bank’s seizure of assets belonging to a sovereign foreign nation. “Therefore, we need to speak out as loudly as we can against the warmongers who are beating the drums of war very clearly”, he said. Former Mayor of London Ken Livingstone also attended the protest and said Britain should be supporting dialogue instead of “kowtowing” to the US. As the protest was taking place, Labour’s shadow Foreign Office minister Liz McInnes urged ministers in Parliament to rule out the prospect of military intervention. Demonstrators rallied in support of the government of Venezuelan President Maduro in Montevideo on Thursday as European and Latin American leaders gathered in the Uruguayan capital to discuss a plan to solve the political situation in Venezuela. The demonstrators carried signs and chanted slogans saying “Yankees get out,” referring to the U.S. Other signs and slogans voiced their support for Maduro’s government. Demonstrators also got together in Miami, Florida to show solidarity with the Venezuelan people, saying that they hope to support the sovereignty of the Venezuelan people, and to protest against U.S. interventions in Latin America generally. Two actions were held in New York last weekend in opposition to Trump’s efforts to overthrow the democratically-elected government of President Maduro. Several groups came together Saturday, January 26 in Union Square and on 38th Street and Lexington, opposite the Cuban mission to the United Nations. “My family is from Peru — Andean people, of Native and African descent, so, one of the first people that are always attacked by these right-wing governments in Latin America and in the United States,” Kayla Kireeva, an organizer of the event at Union Square, told WBAI Radio. Kireeva is a young worker with two jobs, and a student at LaGuardia Community College. “We are people that are living in the United States because of the results of U.S. intervention in…our home countries,” Kireeva said.
Simple dough, made from flour and water is used for everything from feeding the masses to making toys in China. Highly personalised toys. Personalised toys made out of what can be cooked and eaten. Across China, a special type of sculpting has been passed down from generations to generations. It's basically taking a lump of dough and kneading it into a dummy or cartoonish version of a person. This type of "cultural" art has been used in China as a forms of cheap entertainment. Beijing based "dough kneading" master Mr. Li has been making sculptures out of dough for over three decades, even appearing on Beijing TV. Working out of a tiny stall in the Wangfujing Snack street, Mr. Li shows offs finished models, everything from tiny Obamas to adorable Governators. What makes Mr. Li special is that his dough sculptures are slightly different. Instead of having completely new bodies made up on the fly, he has predetermined bodies. These bodies are also made of dough, just not on the fly. Li's bodies come from the world of video games, manga, anime, and general pop culture. Want to see your head on the body of a big-chested anime character? Can do. Want your giant head on the body of Detective Conan? It can be done. All it takes is about 20 minutes and $45. Li says that he sculpts ten to fifteen people a day and that the foreigners tend to go bigger and more extravagant while the Chinese tourists tend to go for the more reserved looks. Li also sells sculptures with normal bodies. Custom orders are available on request. Li doesn't explain what's added to the dough to make sure it doesn't go bad, or how it keeps shape even though it's completely dried out. The art of making toys out of dough can supposedly be traced back to using dough as effigies. Tales of what Zhuge Kongming did with dough during the Three Kingdom Era come to mind—but people have been playing with their food for ages. My statue looks good enough to eat. I think maybe I'll get a sugar sculpture made of myself the next time I'm looking to stroke my ego.
E COMMISSION ON GENETIC RESOURCES FOR FOOD AND AGRICULTURE MICRO-ORGANISMS AND RUMINANT DIGESTION : STATE OF KNOWLEDGE, TRENDS AND FUTURE PROSPECTS Food and Agriculture Organization of the United Nations Organizacin de las Naciones Unidas para la Alimentacin y la Agric u lt u ra Organisation Nations Unies pour l'alimentation et l'agriculture des c This document is printed in limited numbers to minimize the environmental impact of FAO's processes and contribute to climate neutrality. Delegates and observers are kindly requested to bring their copies to meetings and to avoid asking for additional copies. Most FAO meeting documents are available on the Internet at The content of this document is entirely the responsibility of the authors, and does not necessarily represent the views of the FAO or its Members.
<filename>orly/sabot/compare_types.test.cc /* <orly/sabot/compare_types.test.cc> Unit test for <orly/sabot/compare_types.h>. Copyright 2010-2014 OrlyAtomics, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #include <orly/sabot/compare_types.h> #include <sstream> #include <string> #include <orly/native/all.h> #include <orly/native/point.h> #include <orly/sabot/all.h> #include <test/kit.h> using namespace std; using namespace Base; using namespace Orly; using namespace Orly::Atom; using namespace Orly::Native; using namespace Orly::Sabot; template <typename TLhs, typename TRhs> TComparison CheckTypes() { void *lhs_type_alloc = alloca(Sabot::Type::GetMaxTypeSize() * 2); void *rhs_type_alloc = reinterpret_cast<uint8_t *>(lhs_type_alloc) + Sabot::Type::GetMaxTypeSize(); return CompareTypes(*Sabot::Type::TAny::TWrapper(Native::Type::For<TLhs>::GetType(lhs_type_alloc)), *Sabot::Type::TAny::TWrapper(Native::Type::For<TRhs>::GetType(rhs_type_alloc))); } FIXTURE(Int8) { EXPECT_TRUE(IsEq(CheckTypes<int8_t, int8_t>())); EXPECT_TRUE(IsLt(CheckTypes<int8_t, int16_t>())); EXPECT_TRUE(IsLt(CheckTypes<int8_t, int32_t>())); EXPECT_TRUE(IsLt(CheckTypes<int8_t, int64_t>())); EXPECT_TRUE(IsLt(CheckTypes<int8_t, uint8_t>())); EXPECT_TRUE(IsLt(CheckTypes<int8_t, uint16_t>())); EXPECT_TRUE(IsLt(CheckTypes<int8_t, uint32_t>())); EXPECT_TRUE(IsLt(CheckTypes<int8_t, uint64_t>())); EXPECT_TRUE(IsLt(CheckTypes<int8_t, bool>())); EXPECT_TRUE(IsLt(CheckTypes<int8_t, char>())); EXPECT_TRUE(IsLt(CheckTypes<int8_t, float>())); EXPECT_TRUE(IsLt(CheckTypes<int8_t, double>())); EXPECT_TRUE(IsLt(CheckTypes<int8_t, TStdDuration>())); EXPECT_TRUE(IsLt(CheckTypes<int8_t, TStdTimePoint>())); EXPECT_TRUE(IsLt(CheckTypes<int8_t, TUuid>())); EXPECT_TRUE(IsLt(CheckTypes<int8_t, TBlob>())); EXPECT_TRUE(IsLt(CheckTypes<int8_t, string>())); EXPECT_TRUE(IsLt(CheckTypes<int8_t, TTombstone>())); EXPECT_TRUE(IsLt(CheckTypes<int8_t, void>())); EXPECT_TRUE(IsLt(CheckTypes<int8_t, TDesc<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<int8_t, TFree<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<int8_t, TOpt<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<int8_t, set<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<int8_t, vector<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<int8_t, map<bool, char>>())); EXPECT_TRUE(IsLt(CheckTypes<int8_t, TPoint>())); EXPECT_TRUE(IsLt(CheckTypes<int8_t, tuple<bool>>())); } FIXTURE(Int16) { EXPECT_TRUE(IsGt(CheckTypes<int16_t, int8_t>())); EXPECT_TRUE(IsEq(CheckTypes<int16_t, int16_t>())); EXPECT_TRUE(IsLt(CheckTypes<int16_t, int32_t>())); EXPECT_TRUE(IsLt(CheckTypes<int16_t, int64_t>())); EXPECT_TRUE(IsLt(CheckTypes<int16_t, uint8_t>())); EXPECT_TRUE(IsLt(CheckTypes<int16_t, uint16_t>())); EXPECT_TRUE(IsLt(CheckTypes<int16_t, uint32_t>())); EXPECT_TRUE(IsLt(CheckTypes<int16_t, uint64_t>())); EXPECT_TRUE(IsLt(CheckTypes<int16_t, bool>())); EXPECT_TRUE(IsLt(CheckTypes<int16_t, char>())); EXPECT_TRUE(IsLt(CheckTypes<int16_t, float>())); EXPECT_TRUE(IsLt(CheckTypes<int16_t, double>())); EXPECT_TRUE(IsLt(CheckTypes<int16_t, TStdDuration>())); EXPECT_TRUE(IsLt(CheckTypes<int16_t, TStdTimePoint>())); EXPECT_TRUE(IsLt(CheckTypes<int16_t, TUuid>())); EXPECT_TRUE(IsLt(CheckTypes<int16_t, TBlob>())); EXPECT_TRUE(IsLt(CheckTypes<int16_t, string>())); EXPECT_TRUE(IsLt(CheckTypes<int16_t, TTombstone>())); EXPECT_TRUE(IsLt(CheckTypes<int16_t, void>())); EXPECT_TRUE(IsLt(CheckTypes<int16_t, TDesc<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<int16_t, TFree<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<int16_t, TOpt<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<int16_t, set<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<int16_t, vector<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<int16_t, map<bool, char>>())); EXPECT_TRUE(IsLt(CheckTypes<int16_t, TPoint>())); EXPECT_TRUE(IsLt(CheckTypes<int16_t, tuple<bool>>())); } FIXTURE(Int32) { EXPECT_TRUE(IsGt(CheckTypes<int32_t, int8_t>())); EXPECT_TRUE(IsGt(CheckTypes<int32_t, int16_t>())); EXPECT_TRUE(IsEq(CheckTypes<int32_t, int32_t>())); EXPECT_TRUE(IsLt(CheckTypes<int32_t, int64_t>())); EXPECT_TRUE(IsLt(CheckTypes<int32_t, uint8_t>())); EXPECT_TRUE(IsLt(CheckTypes<int32_t, uint16_t>())); EXPECT_TRUE(IsLt(CheckTypes<int32_t, uint32_t>())); EXPECT_TRUE(IsLt(CheckTypes<int32_t, uint64_t>())); EXPECT_TRUE(IsLt(CheckTypes<int32_t, bool>())); EXPECT_TRUE(IsLt(CheckTypes<int32_t, char>())); EXPECT_TRUE(IsLt(CheckTypes<int32_t, float>())); EXPECT_TRUE(IsLt(CheckTypes<int32_t, double>())); EXPECT_TRUE(IsLt(CheckTypes<int32_t, TStdDuration>())); EXPECT_TRUE(IsLt(CheckTypes<int32_t, TStdTimePoint>())); EXPECT_TRUE(IsLt(CheckTypes<int32_t, TUuid>())); EXPECT_TRUE(IsLt(CheckTypes<int32_t, TBlob>())); EXPECT_TRUE(IsLt(CheckTypes<int32_t, string>())); EXPECT_TRUE(IsLt(CheckTypes<int32_t, TTombstone>())); EXPECT_TRUE(IsLt(CheckTypes<int32_t, void>())); EXPECT_TRUE(IsLt(CheckTypes<int32_t, TDesc<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<int32_t, TFree<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<int32_t, TOpt<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<int32_t, set<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<int32_t, vector<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<int32_t, map<bool, char>>())); EXPECT_TRUE(IsLt(CheckTypes<int32_t, TPoint>())); EXPECT_TRUE(IsLt(CheckTypes<int32_t, tuple<bool>>())); } FIXTURE(Int64) { EXPECT_TRUE(IsGt(CheckTypes<int64_t, int8_t>())); EXPECT_TRUE(IsGt(CheckTypes<int64_t, int16_t>())); EXPECT_TRUE(IsGt(CheckTypes<int64_t, int32_t>())); EXPECT_TRUE(IsEq(CheckTypes<int64_t, int64_t>())); EXPECT_TRUE(IsLt(CheckTypes<int64_t, uint8_t>())); EXPECT_TRUE(IsLt(CheckTypes<int64_t, uint16_t>())); EXPECT_TRUE(IsLt(CheckTypes<int64_t, uint32_t>())); EXPECT_TRUE(IsLt(CheckTypes<int64_t, uint64_t>())); EXPECT_TRUE(IsLt(CheckTypes<int64_t, bool>())); EXPECT_TRUE(IsLt(CheckTypes<int64_t, char>())); EXPECT_TRUE(IsLt(CheckTypes<int64_t, float>())); EXPECT_TRUE(IsLt(CheckTypes<int64_t, double>())); EXPECT_TRUE(IsLt(CheckTypes<int64_t, TStdDuration>())); EXPECT_TRUE(IsLt(CheckTypes<int64_t, TStdTimePoint>())); EXPECT_TRUE(IsLt(CheckTypes<int64_t, TUuid>())); EXPECT_TRUE(IsLt(CheckTypes<int64_t, TBlob>())); EXPECT_TRUE(IsLt(CheckTypes<int64_t, string>())); EXPECT_TRUE(IsLt(CheckTypes<int64_t, TTombstone>())); EXPECT_TRUE(IsLt(CheckTypes<int64_t, void>())); EXPECT_TRUE(IsLt(CheckTypes<int64_t, TDesc<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<int64_t, TFree<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<int64_t, TOpt<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<int64_t, set<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<int64_t, vector<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<int64_t, map<bool, char>>())); EXPECT_TRUE(IsLt(CheckTypes<int64_t, TPoint>())); EXPECT_TRUE(IsLt(CheckTypes<int64_t, tuple<bool>>())); } FIXTURE(UInt8) { EXPECT_TRUE(IsGt(CheckTypes<uint8_t, int8_t>())); EXPECT_TRUE(IsGt(CheckTypes<uint8_t, int16_t>())); EXPECT_TRUE(IsGt(CheckTypes<uint8_t, int32_t>())); EXPECT_TRUE(IsGt(CheckTypes<uint8_t, int64_t>())); EXPECT_TRUE(IsEq(CheckTypes<uint8_t, uint8_t>())); EXPECT_TRUE(IsLt(CheckTypes<uint8_t, uint16_t>())); EXPECT_TRUE(IsLt(CheckTypes<uint8_t, uint32_t>())); EXPECT_TRUE(IsLt(CheckTypes<uint8_t, uint64_t>())); EXPECT_TRUE(IsLt(CheckTypes<uint8_t, bool>())); EXPECT_TRUE(IsLt(CheckTypes<uint8_t, char>())); EXPECT_TRUE(IsLt(CheckTypes<uint8_t, float>())); EXPECT_TRUE(IsLt(CheckTypes<uint8_t, double>())); EXPECT_TRUE(IsLt(CheckTypes<uint8_t, TStdDuration>())); EXPECT_TRUE(IsLt(CheckTypes<uint8_t, TStdTimePoint>())); EXPECT_TRUE(IsLt(CheckTypes<uint8_t, TUuid>())); EXPECT_TRUE(IsLt(CheckTypes<uint8_t, TBlob>())); EXPECT_TRUE(IsLt(CheckTypes<uint8_t, string>())); EXPECT_TRUE(IsLt(CheckTypes<uint8_t, TTombstone>())); EXPECT_TRUE(IsLt(CheckTypes<uint8_t, void>())); EXPECT_TRUE(IsLt(CheckTypes<uint8_t, TDesc<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<uint8_t, TFree<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<uint8_t, TOpt<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<uint8_t, set<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<uint8_t, vector<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<uint8_t, map<bool, char>>())); EXPECT_TRUE(IsLt(CheckTypes<uint8_t, TPoint>())); EXPECT_TRUE(IsLt(CheckTypes<uint8_t, tuple<bool>>())); } FIXTURE(UInt16) { EXPECT_TRUE(IsGt(CheckTypes<uint16_t, int8_t>())); EXPECT_TRUE(IsGt(CheckTypes<uint16_t, int16_t>())); EXPECT_TRUE(IsGt(CheckTypes<uint16_t, int32_t>())); EXPECT_TRUE(IsGt(CheckTypes<uint16_t, int64_t>())); EXPECT_TRUE(IsGt(CheckTypes<uint16_t, uint8_t>())); EXPECT_TRUE(IsEq(CheckTypes<uint16_t, uint16_t>())); EXPECT_TRUE(IsLt(CheckTypes<uint16_t, uint32_t>())); EXPECT_TRUE(IsLt(CheckTypes<uint16_t, uint64_t>())); EXPECT_TRUE(IsLt(CheckTypes<uint16_t, bool>())); EXPECT_TRUE(IsLt(CheckTypes<uint16_t, char>())); EXPECT_TRUE(IsLt(CheckTypes<uint16_t, float>())); EXPECT_TRUE(IsLt(CheckTypes<uint16_t, double>())); EXPECT_TRUE(IsLt(CheckTypes<uint16_t, TStdDuration>())); EXPECT_TRUE(IsLt(CheckTypes<uint16_t, TStdTimePoint>())); EXPECT_TRUE(IsLt(CheckTypes<uint16_t, TUuid>())); EXPECT_TRUE(IsLt(CheckTypes<uint16_t, TBlob>())); EXPECT_TRUE(IsLt(CheckTypes<uint16_t, string>())); EXPECT_TRUE(IsLt(CheckTypes<uint16_t, TTombstone>())); EXPECT_TRUE(IsLt(CheckTypes<uint16_t, void>())); EXPECT_TRUE(IsLt(CheckTypes<uint16_t, TDesc<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<uint16_t, TFree<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<uint16_t, TOpt<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<uint16_t, set<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<uint16_t, vector<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<uint16_t, map<bool, char>>())); EXPECT_TRUE(IsLt(CheckTypes<uint16_t, TPoint>())); EXPECT_TRUE(IsLt(CheckTypes<uint16_t, tuple<bool>>())); } FIXTURE(UInt32) { EXPECT_TRUE(IsGt(CheckTypes<uint32_t, int8_t>())); EXPECT_TRUE(IsGt(CheckTypes<uint32_t, int16_t>())); EXPECT_TRUE(IsGt(CheckTypes<uint32_t, int32_t>())); EXPECT_TRUE(IsGt(CheckTypes<uint32_t, int64_t>())); EXPECT_TRUE(IsGt(CheckTypes<uint32_t, uint8_t>())); EXPECT_TRUE(IsGt(CheckTypes<uint32_t, uint16_t>())); EXPECT_TRUE(IsEq(CheckTypes<uint32_t, uint32_t>())); EXPECT_TRUE(IsLt(CheckTypes<uint32_t, uint64_t>())); EXPECT_TRUE(IsLt(CheckTypes<uint32_t, bool>())); EXPECT_TRUE(IsLt(CheckTypes<uint32_t, char>())); EXPECT_TRUE(IsLt(CheckTypes<uint32_t, float>())); EXPECT_TRUE(IsLt(CheckTypes<uint32_t, double>())); EXPECT_TRUE(IsLt(CheckTypes<uint32_t, TStdDuration>())); EXPECT_TRUE(IsLt(CheckTypes<uint32_t, TStdTimePoint>())); EXPECT_TRUE(IsLt(CheckTypes<uint32_t, TUuid>())); EXPECT_TRUE(IsLt(CheckTypes<uint32_t, TBlob>())); EXPECT_TRUE(IsLt(CheckTypes<uint32_t, string>())); EXPECT_TRUE(IsLt(CheckTypes<uint32_t, TTombstone>())); EXPECT_TRUE(IsLt(CheckTypes<uint32_t, void>())); EXPECT_TRUE(IsLt(CheckTypes<uint32_t, TDesc<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<uint32_t, TFree<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<uint32_t, TOpt<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<uint32_t, set<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<uint32_t, vector<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<uint32_t, map<bool, char>>())); EXPECT_TRUE(IsLt(CheckTypes<uint32_t, TPoint>())); EXPECT_TRUE(IsLt(CheckTypes<uint32_t, tuple<bool>>())); } FIXTURE(UInt64) { EXPECT_TRUE(IsGt(CheckTypes<uint64_t, int8_t>())); EXPECT_TRUE(IsGt(CheckTypes<uint64_t, int16_t>())); EXPECT_TRUE(IsGt(CheckTypes<uint64_t, int32_t>())); EXPECT_TRUE(IsGt(CheckTypes<uint64_t, int64_t>())); EXPECT_TRUE(IsGt(CheckTypes<uint64_t, uint8_t>())); EXPECT_TRUE(IsGt(CheckTypes<uint64_t, uint16_t>())); EXPECT_TRUE(IsGt(CheckTypes<uint64_t, uint32_t>())); EXPECT_TRUE(IsEq(CheckTypes<uint64_t, uint64_t>())); EXPECT_TRUE(IsLt(CheckTypes<uint64_t, bool>())); EXPECT_TRUE(IsLt(CheckTypes<uint64_t, char>())); EXPECT_TRUE(IsLt(CheckTypes<uint64_t, float>())); EXPECT_TRUE(IsLt(CheckTypes<uint64_t, double>())); EXPECT_TRUE(IsLt(CheckTypes<uint64_t, TStdDuration>())); EXPECT_TRUE(IsLt(CheckTypes<uint64_t, TStdTimePoint>())); EXPECT_TRUE(IsLt(CheckTypes<uint64_t, TUuid>())); EXPECT_TRUE(IsLt(CheckTypes<uint64_t, TBlob>())); EXPECT_TRUE(IsLt(CheckTypes<uint64_t, string>())); EXPECT_TRUE(IsLt(CheckTypes<uint64_t, TTombstone>())); EXPECT_TRUE(IsLt(CheckTypes<uint64_t, void>())); EXPECT_TRUE(IsLt(CheckTypes<uint64_t, TDesc<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<uint64_t, TFree<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<uint64_t, TOpt<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<uint64_t, set<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<uint64_t, vector<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<uint64_t, map<bool, char>>())); EXPECT_TRUE(IsLt(CheckTypes<uint64_t, TPoint>())); EXPECT_TRUE(IsLt(CheckTypes<uint64_t, tuple<bool>>())); } FIXTURE(Bool) { EXPECT_TRUE(IsGt(CheckTypes<bool, int8_t>())); EXPECT_TRUE(IsGt(CheckTypes<bool, int16_t>())); EXPECT_TRUE(IsGt(CheckTypes<bool, int32_t>())); EXPECT_TRUE(IsGt(CheckTypes<bool, int64_t>())); EXPECT_TRUE(IsGt(CheckTypes<bool, uint8_t>())); EXPECT_TRUE(IsGt(CheckTypes<bool, uint16_t>())); EXPECT_TRUE(IsGt(CheckTypes<bool, uint32_t>())); EXPECT_TRUE(IsGt(CheckTypes<bool, uint64_t>())); EXPECT_TRUE(IsEq(CheckTypes<bool, bool>())); EXPECT_TRUE(IsLt(CheckTypes<bool, char>())); EXPECT_TRUE(IsLt(CheckTypes<bool, float>())); EXPECT_TRUE(IsLt(CheckTypes<bool, double>())); EXPECT_TRUE(IsLt(CheckTypes<bool, TStdDuration>())); EXPECT_TRUE(IsLt(CheckTypes<bool, TStdTimePoint>())); EXPECT_TRUE(IsLt(CheckTypes<bool, TUuid>())); EXPECT_TRUE(IsLt(CheckTypes<bool, TBlob>())); EXPECT_TRUE(IsLt(CheckTypes<bool, string>())); EXPECT_TRUE(IsLt(CheckTypes<bool, TTombstone>())); EXPECT_TRUE(IsLt(CheckTypes<bool, void>())); EXPECT_TRUE(IsLt(CheckTypes<bool, TDesc<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<bool, TFree<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<bool, TOpt<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<bool, set<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<bool, vector<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<bool, map<bool, char>>())); EXPECT_TRUE(IsLt(CheckTypes<bool, TPoint>())); EXPECT_TRUE(IsLt(CheckTypes<bool, tuple<bool>>())); } FIXTURE(Char) { EXPECT_TRUE(IsGt(CheckTypes<char, int8_t>())); EXPECT_TRUE(IsGt(CheckTypes<char, int16_t>())); EXPECT_TRUE(IsGt(CheckTypes<char, int32_t>())); EXPECT_TRUE(IsGt(CheckTypes<char, int64_t>())); EXPECT_TRUE(IsGt(CheckTypes<char, uint8_t>())); EXPECT_TRUE(IsGt(CheckTypes<char, uint16_t>())); EXPECT_TRUE(IsGt(CheckTypes<char, uint32_t>())); EXPECT_TRUE(IsGt(CheckTypes<char, uint64_t>())); EXPECT_TRUE(IsGt(CheckTypes<char, bool>())); EXPECT_TRUE(IsEq(CheckTypes<char, char>())); EXPECT_TRUE(IsLt(CheckTypes<char, float>())); EXPECT_TRUE(IsLt(CheckTypes<char, double>())); EXPECT_TRUE(IsLt(CheckTypes<char, TStdDuration>())); EXPECT_TRUE(IsLt(CheckTypes<char, TStdTimePoint>())); EXPECT_TRUE(IsLt(CheckTypes<char, TUuid>())); EXPECT_TRUE(IsLt(CheckTypes<char, TBlob>())); EXPECT_TRUE(IsLt(CheckTypes<char, string>())); EXPECT_TRUE(IsLt(CheckTypes<char, TTombstone>())); EXPECT_TRUE(IsLt(CheckTypes<char, void>())); EXPECT_TRUE(IsLt(CheckTypes<char, TDesc<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<char, TFree<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<char, TOpt<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<char, set<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<char, vector<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<char, map<bool, char>>())); EXPECT_TRUE(IsLt(CheckTypes<char, TPoint>())); EXPECT_TRUE(IsLt(CheckTypes<char, tuple<bool>>())); } FIXTURE(Float) { EXPECT_TRUE(IsGt(CheckTypes<float, int8_t>())); EXPECT_TRUE(IsGt(CheckTypes<float, int16_t>())); EXPECT_TRUE(IsGt(CheckTypes<float, int32_t>())); EXPECT_TRUE(IsGt(CheckTypes<float, int64_t>())); EXPECT_TRUE(IsGt(CheckTypes<float, uint8_t>())); EXPECT_TRUE(IsGt(CheckTypes<float, uint16_t>())); EXPECT_TRUE(IsGt(CheckTypes<float, uint32_t>())); EXPECT_TRUE(IsGt(CheckTypes<float, uint64_t>())); EXPECT_TRUE(IsGt(CheckTypes<float, bool>())); EXPECT_TRUE(IsGt(CheckTypes<float, char>())); EXPECT_TRUE(IsEq(CheckTypes<float, float>())); EXPECT_TRUE(IsLt(CheckTypes<float, double>())); EXPECT_TRUE(IsLt(CheckTypes<float, TStdDuration>())); EXPECT_TRUE(IsLt(CheckTypes<float, TStdTimePoint>())); EXPECT_TRUE(IsLt(CheckTypes<float, TUuid>())); EXPECT_TRUE(IsLt(CheckTypes<float, TBlob>())); EXPECT_TRUE(IsLt(CheckTypes<float, string>())); EXPECT_TRUE(IsLt(CheckTypes<float, TTombstone>())); EXPECT_TRUE(IsLt(CheckTypes<float, void>())); EXPECT_TRUE(IsLt(CheckTypes<float, TDesc<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<float, TFree<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<float, TOpt<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<float, set<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<float, vector<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<float, map<bool, char>>())); EXPECT_TRUE(IsLt(CheckTypes<float, TPoint>())); EXPECT_TRUE(IsLt(CheckTypes<float, tuple<bool>>())); } FIXTURE(Double) { EXPECT_TRUE(IsGt(CheckTypes<double, int8_t>())); EXPECT_TRUE(IsGt(CheckTypes<double, int16_t>())); EXPECT_TRUE(IsGt(CheckTypes<double, int32_t>())); EXPECT_TRUE(IsGt(CheckTypes<double, int64_t>())); EXPECT_TRUE(IsGt(CheckTypes<double, uint8_t>())); EXPECT_TRUE(IsGt(CheckTypes<double, uint16_t>())); EXPECT_TRUE(IsGt(CheckTypes<double, uint32_t>())); EXPECT_TRUE(IsGt(CheckTypes<double, uint64_t>())); EXPECT_TRUE(IsGt(CheckTypes<double, bool>())); EXPECT_TRUE(IsGt(CheckTypes<double, char>())); EXPECT_TRUE(IsGt(CheckTypes<double, float>())); EXPECT_TRUE(IsEq(CheckTypes<double, double>())); EXPECT_TRUE(IsLt(CheckTypes<double, TStdDuration>())); EXPECT_TRUE(IsLt(CheckTypes<double, TStdTimePoint>())); EXPECT_TRUE(IsLt(CheckTypes<double, TUuid>())); EXPECT_TRUE(IsLt(CheckTypes<double, TBlob>())); EXPECT_TRUE(IsLt(CheckTypes<double, string>())); EXPECT_TRUE(IsLt(CheckTypes<double, TTombstone>())); EXPECT_TRUE(IsLt(CheckTypes<double, void>())); EXPECT_TRUE(IsLt(CheckTypes<double, TDesc<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<double, TFree<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<double, TOpt<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<double, set<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<double, vector<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<double, map<bool, char>>())); EXPECT_TRUE(IsLt(CheckTypes<double, TPoint>())); EXPECT_TRUE(IsLt(CheckTypes<double, tuple<bool>>())); } FIXTURE(Duration) { EXPECT_TRUE(IsGt(CheckTypes<TStdDuration, int8_t>())); EXPECT_TRUE(IsGt(CheckTypes<TStdDuration, int16_t>())); EXPECT_TRUE(IsGt(CheckTypes<TStdDuration, int32_t>())); EXPECT_TRUE(IsGt(CheckTypes<TStdDuration, int64_t>())); EXPECT_TRUE(IsGt(CheckTypes<TStdDuration, uint8_t>())); EXPECT_TRUE(IsGt(CheckTypes<TStdDuration, uint16_t>())); EXPECT_TRUE(IsGt(CheckTypes<TStdDuration, uint32_t>())); EXPECT_TRUE(IsGt(CheckTypes<TStdDuration, uint64_t>())); EXPECT_TRUE(IsGt(CheckTypes<TStdDuration, bool>())); EXPECT_TRUE(IsGt(CheckTypes<TStdDuration, char>())); EXPECT_TRUE(IsGt(CheckTypes<TStdDuration, float>())); EXPECT_TRUE(IsGt(CheckTypes<TStdDuration, double>())); EXPECT_TRUE(IsEq(CheckTypes<TStdDuration, TStdDuration>())); EXPECT_TRUE(IsLt(CheckTypes<TStdDuration, TStdTimePoint>())); EXPECT_TRUE(IsLt(CheckTypes<TStdDuration, TUuid>())); EXPECT_TRUE(IsLt(CheckTypes<TStdDuration, TBlob>())); EXPECT_TRUE(IsLt(CheckTypes<TStdDuration, string>())); EXPECT_TRUE(IsLt(CheckTypes<TStdDuration, TTombstone>())); EXPECT_TRUE(IsLt(CheckTypes<TStdDuration, void>())); EXPECT_TRUE(IsLt(CheckTypes<TStdDuration, TDesc<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<TStdDuration, TFree<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<TStdDuration, TOpt<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<TStdDuration, set<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<TStdDuration, vector<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<TStdDuration, map<bool, char>>())); EXPECT_TRUE(IsLt(CheckTypes<TStdDuration, TPoint>())); EXPECT_TRUE(IsLt(CheckTypes<TStdDuration, tuple<bool>>())); } FIXTURE(TimePoint) { EXPECT_TRUE(IsGt(CheckTypes<TStdDuration, int8_t>())); EXPECT_TRUE(IsGt(CheckTypes<TStdDuration, int16_t>())); EXPECT_TRUE(IsGt(CheckTypes<TStdDuration, int32_t>())); EXPECT_TRUE(IsGt(CheckTypes<TStdDuration, int64_t>())); EXPECT_TRUE(IsGt(CheckTypes<TStdDuration, uint8_t>())); EXPECT_TRUE(IsGt(CheckTypes<TStdDuration, uint16_t>())); EXPECT_TRUE(IsGt(CheckTypes<TStdDuration, uint32_t>())); EXPECT_TRUE(IsGt(CheckTypes<TStdDuration, uint64_t>())); EXPECT_TRUE(IsGt(CheckTypes<TStdDuration, bool>())); EXPECT_TRUE(IsGt(CheckTypes<TStdDuration, char>())); EXPECT_TRUE(IsGt(CheckTypes<TStdDuration, float>())); EXPECT_TRUE(IsGt(CheckTypes<TStdDuration, double>())); EXPECT_TRUE(IsEq(CheckTypes<TStdDuration, TStdDuration>())); EXPECT_TRUE(IsLt(CheckTypes<TStdDuration, TStdTimePoint>())); EXPECT_TRUE(IsLt(CheckTypes<TStdDuration, TUuid>())); EXPECT_TRUE(IsLt(CheckTypes<TStdDuration, TBlob>())); EXPECT_TRUE(IsLt(CheckTypes<TStdDuration, string>())); EXPECT_TRUE(IsLt(CheckTypes<TStdDuration, TTombstone>())); EXPECT_TRUE(IsLt(CheckTypes<TStdDuration, void>())); EXPECT_TRUE(IsLt(CheckTypes<TStdDuration, TDesc<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<TStdDuration, TFree<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<TStdDuration, TOpt<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<TStdDuration, set<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<TStdDuration, vector<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<TStdDuration, map<bool, char>>())); EXPECT_TRUE(IsLt(CheckTypes<TStdDuration, TPoint>())); EXPECT_TRUE(IsLt(CheckTypes<TStdDuration, tuple<bool>>())); } FIXTURE(Uuid) { EXPECT_TRUE(IsGt(CheckTypes<TUuid, int8_t>())); EXPECT_TRUE(IsGt(CheckTypes<TUuid, int16_t>())); EXPECT_TRUE(IsGt(CheckTypes<TUuid, int32_t>())); EXPECT_TRUE(IsGt(CheckTypes<TUuid, int64_t>())); EXPECT_TRUE(IsGt(CheckTypes<TUuid, uint8_t>())); EXPECT_TRUE(IsGt(CheckTypes<TUuid, uint16_t>())); EXPECT_TRUE(IsGt(CheckTypes<TUuid, uint32_t>())); EXPECT_TRUE(IsGt(CheckTypes<TUuid, uint64_t>())); EXPECT_TRUE(IsGt(CheckTypes<TUuid, bool>())); EXPECT_TRUE(IsGt(CheckTypes<TUuid, char>())); EXPECT_TRUE(IsGt(CheckTypes<TUuid, float>())); EXPECT_TRUE(IsGt(CheckTypes<TUuid, double>())); EXPECT_TRUE(IsGt(CheckTypes<TUuid, TStdDuration>())); EXPECT_TRUE(IsGt(CheckTypes<TUuid, TStdTimePoint>())); EXPECT_TRUE(IsEq(CheckTypes<TUuid, TUuid>())); EXPECT_TRUE(IsLt(CheckTypes<TUuid, TBlob>())); EXPECT_TRUE(IsLt(CheckTypes<TUuid, string>())); EXPECT_TRUE(IsLt(CheckTypes<TUuid, TTombstone>())); EXPECT_TRUE(IsLt(CheckTypes<TUuid, void>())); EXPECT_TRUE(IsLt(CheckTypes<TUuid, TDesc<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<TUuid, TFree<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<TUuid, TOpt<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<TUuid, set<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<TUuid, vector<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<TUuid, map<bool, char>>())); EXPECT_TRUE(IsLt(CheckTypes<TUuid, TPoint>())); EXPECT_TRUE(IsLt(CheckTypes<TUuid, tuple<bool>>())); } FIXTURE(Blob) { EXPECT_TRUE(IsGt(CheckTypes<TBlob, int8_t>())); EXPECT_TRUE(IsGt(CheckTypes<TBlob, int16_t>())); EXPECT_TRUE(IsGt(CheckTypes<TBlob, int32_t>())); EXPECT_TRUE(IsGt(CheckTypes<TBlob, int64_t>())); EXPECT_TRUE(IsGt(CheckTypes<TBlob, uint8_t>())); EXPECT_TRUE(IsGt(CheckTypes<TBlob, uint16_t>())); EXPECT_TRUE(IsGt(CheckTypes<TBlob, uint32_t>())); EXPECT_TRUE(IsGt(CheckTypes<TBlob, uint64_t>())); EXPECT_TRUE(IsGt(CheckTypes<TBlob, bool>())); EXPECT_TRUE(IsGt(CheckTypes<TBlob, char>())); EXPECT_TRUE(IsGt(CheckTypes<TBlob, float>())); EXPECT_TRUE(IsGt(CheckTypes<TBlob, double>())); EXPECT_TRUE(IsGt(CheckTypes<TBlob, TStdDuration>())); EXPECT_TRUE(IsGt(CheckTypes<TBlob, TStdTimePoint>())); EXPECT_TRUE(IsGt(CheckTypes<TBlob, TUuid>())); EXPECT_TRUE(IsEq(CheckTypes<TBlob, TBlob>())); EXPECT_TRUE(IsLt(CheckTypes<TBlob, string>())); EXPECT_TRUE(IsLt(CheckTypes<TBlob, TTombstone>())); EXPECT_TRUE(IsLt(CheckTypes<TBlob, void>())); EXPECT_TRUE(IsLt(CheckTypes<TBlob, TDesc<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<TBlob, TFree<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<TBlob, TOpt<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<TBlob, set<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<TBlob, vector<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<TBlob, map<bool, char>>())); EXPECT_TRUE(IsLt(CheckTypes<TBlob, TPoint>())); EXPECT_TRUE(IsLt(CheckTypes<TBlob, tuple<bool>>())); } FIXTURE(String) { EXPECT_TRUE(IsGt(CheckTypes<string, int8_t>())); EXPECT_TRUE(IsGt(CheckTypes<string, int16_t>())); EXPECT_TRUE(IsGt(CheckTypes<string, int32_t>())); EXPECT_TRUE(IsGt(CheckTypes<string, int64_t>())); EXPECT_TRUE(IsGt(CheckTypes<string, uint8_t>())); EXPECT_TRUE(IsGt(CheckTypes<string, uint16_t>())); EXPECT_TRUE(IsGt(CheckTypes<string, uint32_t>())); EXPECT_TRUE(IsGt(CheckTypes<string, uint64_t>())); EXPECT_TRUE(IsGt(CheckTypes<string, bool>())); EXPECT_TRUE(IsGt(CheckTypes<string, char>())); EXPECT_TRUE(IsGt(CheckTypes<string, float>())); EXPECT_TRUE(IsGt(CheckTypes<string, double>())); EXPECT_TRUE(IsGt(CheckTypes<string, TStdDuration>())); EXPECT_TRUE(IsGt(CheckTypes<string, TStdTimePoint>())); EXPECT_TRUE(IsGt(CheckTypes<string, TUuid>())); EXPECT_TRUE(IsGt(CheckTypes<string, TBlob>())); EXPECT_TRUE(IsEq(CheckTypes<string, string>())); EXPECT_TRUE(IsLt(CheckTypes<string, TTombstone>())); EXPECT_TRUE(IsLt(CheckTypes<string, void>())); EXPECT_TRUE(IsLt(CheckTypes<string, TDesc<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<string, TFree<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<string, TOpt<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<string, set<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<string, vector<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<string, map<bool, char>>())); EXPECT_TRUE(IsLt(CheckTypes<string, TPoint>())); EXPECT_TRUE(IsLt(CheckTypes<string, tuple<bool>>())); } FIXTURE(Tombstone) { EXPECT_TRUE(IsGt(CheckTypes<TTombstone, int8_t>())); EXPECT_TRUE(IsGt(CheckTypes<TTombstone, int16_t>())); EXPECT_TRUE(IsGt(CheckTypes<TTombstone, int32_t>())); EXPECT_TRUE(IsGt(CheckTypes<TTombstone, int64_t>())); EXPECT_TRUE(IsGt(CheckTypes<TTombstone, uint8_t>())); EXPECT_TRUE(IsGt(CheckTypes<TTombstone, uint16_t>())); EXPECT_TRUE(IsGt(CheckTypes<TTombstone, uint32_t>())); EXPECT_TRUE(IsGt(CheckTypes<TTombstone, uint64_t>())); EXPECT_TRUE(IsGt(CheckTypes<TTombstone, bool>())); EXPECT_TRUE(IsGt(CheckTypes<TTombstone, char>())); EXPECT_TRUE(IsGt(CheckTypes<TTombstone, float>())); EXPECT_TRUE(IsGt(CheckTypes<TTombstone, double>())); EXPECT_TRUE(IsGt(CheckTypes<TTombstone, TStdDuration>())); EXPECT_TRUE(IsGt(CheckTypes<TTombstone, TStdTimePoint>())); EXPECT_TRUE(IsGt(CheckTypes<TTombstone, TUuid>())); EXPECT_TRUE(IsGt(CheckTypes<TTombstone, TBlob>())); EXPECT_TRUE(IsGt(CheckTypes<TTombstone, string>())); EXPECT_TRUE(IsEq(CheckTypes<TTombstone, TTombstone>())); EXPECT_TRUE(IsLt(CheckTypes<TTombstone, void>())); EXPECT_TRUE(IsLt(CheckTypes<TTombstone, TDesc<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<TTombstone, TFree<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<TTombstone, TOpt<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<TTombstone, set<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<TTombstone, vector<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<TTombstone, map<bool, char>>())); EXPECT_TRUE(IsLt(CheckTypes<TTombstone, TPoint>())); EXPECT_TRUE(IsLt(CheckTypes<TTombstone, tuple<bool>>())); } FIXTURE(Void) { EXPECT_TRUE(IsGt(CheckTypes<void, int8_t>())); EXPECT_TRUE(IsGt(CheckTypes<void, int16_t>())); EXPECT_TRUE(IsGt(CheckTypes<void, int32_t>())); EXPECT_TRUE(IsGt(CheckTypes<void, int64_t>())); EXPECT_TRUE(IsGt(CheckTypes<void, uint8_t>())); EXPECT_TRUE(IsGt(CheckTypes<void, uint16_t>())); EXPECT_TRUE(IsGt(CheckTypes<void, uint32_t>())); EXPECT_TRUE(IsGt(CheckTypes<void, uint64_t>())); EXPECT_TRUE(IsGt(CheckTypes<void, bool>())); EXPECT_TRUE(IsGt(CheckTypes<void, char>())); EXPECT_TRUE(IsGt(CheckTypes<void, float>())); EXPECT_TRUE(IsGt(CheckTypes<void, double>())); EXPECT_TRUE(IsGt(CheckTypes<void, TStdDuration>())); EXPECT_TRUE(IsGt(CheckTypes<void, TStdTimePoint>())); EXPECT_TRUE(IsGt(CheckTypes<void, TUuid>())); EXPECT_TRUE(IsGt(CheckTypes<void, TBlob>())); EXPECT_TRUE(IsGt(CheckTypes<void, string>())); EXPECT_TRUE(IsGt(CheckTypes<void, TTombstone>())); EXPECT_TRUE(IsEq(CheckTypes<void, void>())); EXPECT_TRUE(IsLt(CheckTypes<void, TDesc<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<void, TFree<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<void, TOpt<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<void, set<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<void, vector<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<void, map<bool, char>>())); EXPECT_TRUE(IsLt(CheckTypes<void, TPoint>())); EXPECT_TRUE(IsLt(CheckTypes<void, tuple<bool>>())); } FIXTURE(Desc) { EXPECT_TRUE(IsGt(CheckTypes<TDesc<bool>, int8_t>())); EXPECT_TRUE(IsGt(CheckTypes<TDesc<bool>, int16_t>())); EXPECT_TRUE(IsGt(CheckTypes<TDesc<bool>, int32_t>())); EXPECT_TRUE(IsGt(CheckTypes<TDesc<bool>, int64_t>())); EXPECT_TRUE(IsGt(CheckTypes<TDesc<bool>, uint8_t>())); EXPECT_TRUE(IsGt(CheckTypes<TDesc<bool>, uint16_t>())); EXPECT_TRUE(IsGt(CheckTypes<TDesc<bool>, uint32_t>())); EXPECT_TRUE(IsGt(CheckTypes<TDesc<bool>, uint64_t>())); EXPECT_TRUE(IsGt(CheckTypes<TDesc<bool>, bool>())); EXPECT_TRUE(IsGt(CheckTypes<TDesc<bool>, char>())); EXPECT_TRUE(IsGt(CheckTypes<TDesc<bool>, float>())); EXPECT_TRUE(IsGt(CheckTypes<TDesc<bool>, double>())); EXPECT_TRUE(IsGt(CheckTypes<TDesc<bool>, TStdDuration>())); EXPECT_TRUE(IsGt(CheckTypes<TDesc<bool>, TStdTimePoint>())); EXPECT_TRUE(IsGt(CheckTypes<TDesc<bool>, TUuid>())); EXPECT_TRUE(IsGt(CheckTypes<TDesc<bool>, TBlob>())); EXPECT_TRUE(IsGt(CheckTypes<TDesc<bool>, string>())); EXPECT_TRUE(IsGt(CheckTypes<TDesc<bool>, TTombstone>())); EXPECT_TRUE(IsGt(CheckTypes<TDesc<bool>, void>())); EXPECT_TRUE(IsLt(CheckTypes<TDesc<int8_t>, TDesc<bool>>())); EXPECT_TRUE(IsEq(CheckTypes<TDesc<bool>, TDesc<bool>>())); EXPECT_TRUE(IsGt(CheckTypes<TDesc<string>, TDesc<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<TDesc<bool>, TFree<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<TDesc<bool>, TOpt<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<TDesc<bool>, set<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<TDesc<bool>, vector<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<TDesc<bool>, map<bool, char>>())); EXPECT_TRUE(IsLt(CheckTypes<TDesc<bool>, TPoint>())); EXPECT_TRUE(IsLt(CheckTypes<TDesc<bool>, tuple<bool>>())); } FIXTURE(Free) { EXPECT_TRUE(IsGt(CheckTypes<TFree<bool>, int8_t>())); EXPECT_TRUE(IsGt(CheckTypes<TFree<bool>, int16_t>())); EXPECT_TRUE(IsGt(CheckTypes<TFree<bool>, int32_t>())); EXPECT_TRUE(IsGt(CheckTypes<TFree<bool>, int64_t>())); EXPECT_TRUE(IsGt(CheckTypes<TFree<bool>, uint8_t>())); EXPECT_TRUE(IsGt(CheckTypes<TFree<bool>, uint16_t>())); EXPECT_TRUE(IsGt(CheckTypes<TFree<bool>, uint32_t>())); EXPECT_TRUE(IsGt(CheckTypes<TFree<bool>, uint64_t>())); EXPECT_TRUE(IsGt(CheckTypes<TFree<bool>, bool>())); EXPECT_TRUE(IsGt(CheckTypes<TFree<bool>, char>())); EXPECT_TRUE(IsGt(CheckTypes<TFree<bool>, float>())); EXPECT_TRUE(IsGt(CheckTypes<TFree<bool>, double>())); EXPECT_TRUE(IsGt(CheckTypes<TFree<bool>, TStdDuration>())); EXPECT_TRUE(IsGt(CheckTypes<TFree<bool>, TStdTimePoint>())); EXPECT_TRUE(IsGt(CheckTypes<TFree<bool>, TUuid>())); EXPECT_TRUE(IsGt(CheckTypes<TFree<bool>, TBlob>())); EXPECT_TRUE(IsGt(CheckTypes<TFree<bool>, string>())); EXPECT_TRUE(IsGt(CheckTypes<TFree<bool>, TTombstone>())); EXPECT_TRUE(IsGt(CheckTypes<TFree<bool>, void>())); EXPECT_TRUE(IsGt(CheckTypes<TFree<bool>, TDesc<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<TFree<int8_t>, TFree<bool>>())); EXPECT_TRUE(IsEq(CheckTypes<TFree<bool>, TFree<bool>>())); EXPECT_TRUE(IsGt(CheckTypes<TFree<string>, TFree<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<TFree<bool>, TOpt<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<TFree<bool>, set<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<TFree<bool>, vector<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<TFree<bool>, map<bool, char>>())); EXPECT_TRUE(IsLt(CheckTypes<TFree<bool>, TPoint>())); EXPECT_TRUE(IsLt(CheckTypes<TFree<bool>, tuple<bool>>())); } FIXTURE(Opt) { EXPECT_TRUE(IsGt(CheckTypes<TOpt<bool>, int8_t>())); EXPECT_TRUE(IsGt(CheckTypes<TOpt<bool>, int16_t>())); EXPECT_TRUE(IsGt(CheckTypes<TOpt<bool>, int32_t>())); EXPECT_TRUE(IsGt(CheckTypes<TOpt<bool>, int64_t>())); EXPECT_TRUE(IsGt(CheckTypes<TOpt<bool>, uint8_t>())); EXPECT_TRUE(IsGt(CheckTypes<TOpt<bool>, uint16_t>())); EXPECT_TRUE(IsGt(CheckTypes<TOpt<bool>, uint32_t>())); EXPECT_TRUE(IsGt(CheckTypes<TOpt<bool>, uint64_t>())); EXPECT_TRUE(IsGt(CheckTypes<TOpt<bool>, bool>())); EXPECT_TRUE(IsGt(CheckTypes<TOpt<bool>, char>())); EXPECT_TRUE(IsGt(CheckTypes<TOpt<bool>, float>())); EXPECT_TRUE(IsGt(CheckTypes<TOpt<bool>, double>())); EXPECT_TRUE(IsGt(CheckTypes<TOpt<bool>, TStdDuration>())); EXPECT_TRUE(IsGt(CheckTypes<TOpt<bool>, TStdTimePoint>())); EXPECT_TRUE(IsGt(CheckTypes<TOpt<bool>, TUuid>())); EXPECT_TRUE(IsGt(CheckTypes<TOpt<bool>, TBlob>())); EXPECT_TRUE(IsGt(CheckTypes<TOpt<bool>, string>())); EXPECT_TRUE(IsGt(CheckTypes<TOpt<bool>, TTombstone>())); EXPECT_TRUE(IsGt(CheckTypes<TOpt<bool>, void>())); EXPECT_TRUE(IsGt(CheckTypes<TOpt<bool>, TDesc<bool>>())); EXPECT_TRUE(IsGt(CheckTypes<TOpt<bool>, TFree<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<TOpt<int8_t>, TOpt<bool>>())); EXPECT_TRUE(IsEq(CheckTypes<TOpt<bool>, TOpt<bool>>())); EXPECT_TRUE(IsGt(CheckTypes<TOpt<string>, TOpt<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<TOpt<bool>, set<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<TOpt<bool>, vector<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<TOpt<bool>, map<bool, char>>())); EXPECT_TRUE(IsLt(CheckTypes<TOpt<bool>, TPoint>())); EXPECT_TRUE(IsLt(CheckTypes<TOpt<bool>, tuple<bool>>())); } FIXTURE(Set) { EXPECT_TRUE(IsGt(CheckTypes<set<bool>, int8_t>())); EXPECT_TRUE(IsGt(CheckTypes<set<bool>, int16_t>())); EXPECT_TRUE(IsGt(CheckTypes<set<bool>, int32_t>())); EXPECT_TRUE(IsGt(CheckTypes<set<bool>, int64_t>())); EXPECT_TRUE(IsGt(CheckTypes<set<bool>, uint8_t>())); EXPECT_TRUE(IsGt(CheckTypes<set<bool>, uint16_t>())); EXPECT_TRUE(IsGt(CheckTypes<set<bool>, uint32_t>())); EXPECT_TRUE(IsGt(CheckTypes<set<bool>, uint64_t>())); EXPECT_TRUE(IsGt(CheckTypes<set<bool>, bool>())); EXPECT_TRUE(IsGt(CheckTypes<set<bool>, char>())); EXPECT_TRUE(IsGt(CheckTypes<set<bool>, float>())); EXPECT_TRUE(IsGt(CheckTypes<set<bool>, double>())); EXPECT_TRUE(IsGt(CheckTypes<set<bool>, TStdDuration>())); EXPECT_TRUE(IsGt(CheckTypes<set<bool>, TStdTimePoint>())); EXPECT_TRUE(IsGt(CheckTypes<set<bool>, TUuid>())); EXPECT_TRUE(IsGt(CheckTypes<set<bool>, TBlob>())); EXPECT_TRUE(IsGt(CheckTypes<set<bool>, string>())); EXPECT_TRUE(IsGt(CheckTypes<set<bool>, TTombstone>())); EXPECT_TRUE(IsGt(CheckTypes<set<bool>, void>())); EXPECT_TRUE(IsGt(CheckTypes<set<bool>, TDesc<bool>>())); EXPECT_TRUE(IsGt(CheckTypes<set<bool>, TFree<bool>>())); EXPECT_TRUE(IsGt(CheckTypes<set<bool>, TOpt<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<set<int8_t>, set<bool>>())); EXPECT_TRUE(IsEq(CheckTypes<set<bool>, set<bool>>())); EXPECT_TRUE(IsGt(CheckTypes<set<string>, set<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<set<bool>, vector<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<set<bool>, map<bool, char>>())); EXPECT_TRUE(IsLt(CheckTypes<set<bool>, TPoint>())); EXPECT_TRUE(IsLt(CheckTypes<set<bool>, tuple<bool>>())); } FIXTURE(Vector) { EXPECT_TRUE(IsGt(CheckTypes<vector<bool>, int8_t>())); EXPECT_TRUE(IsGt(CheckTypes<vector<bool>, int16_t>())); EXPECT_TRUE(IsGt(CheckTypes<vector<bool>, int32_t>())); EXPECT_TRUE(IsGt(CheckTypes<vector<bool>, int64_t>())); EXPECT_TRUE(IsGt(CheckTypes<vector<bool>, uint8_t>())); EXPECT_TRUE(IsGt(CheckTypes<vector<bool>, uint16_t>())); EXPECT_TRUE(IsGt(CheckTypes<vector<bool>, uint32_t>())); EXPECT_TRUE(IsGt(CheckTypes<vector<bool>, uint64_t>())); EXPECT_TRUE(IsGt(CheckTypes<vector<bool>, bool>())); EXPECT_TRUE(IsGt(CheckTypes<vector<bool>, char>())); EXPECT_TRUE(IsGt(CheckTypes<vector<bool>, float>())); EXPECT_TRUE(IsGt(CheckTypes<vector<bool>, double>())); EXPECT_TRUE(IsGt(CheckTypes<vector<bool>, TStdDuration>())); EXPECT_TRUE(IsGt(CheckTypes<vector<bool>, TStdTimePoint>())); EXPECT_TRUE(IsGt(CheckTypes<vector<bool>, TUuid>())); EXPECT_TRUE(IsGt(CheckTypes<vector<bool>, TBlob>())); EXPECT_TRUE(IsGt(CheckTypes<vector<bool>, string>())); EXPECT_TRUE(IsGt(CheckTypes<vector<bool>, TTombstone>())); EXPECT_TRUE(IsGt(CheckTypes<vector<bool>, void>())); EXPECT_TRUE(IsGt(CheckTypes<vector<bool>, TDesc<bool>>())); EXPECT_TRUE(IsGt(CheckTypes<vector<bool>, TFree<bool>>())); EXPECT_TRUE(IsGt(CheckTypes<vector<bool>, TOpt<bool>>())); EXPECT_TRUE(IsGt(CheckTypes<vector<bool>, set<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<vector<int8_t>, vector<bool>>())); EXPECT_TRUE(IsEq(CheckTypes<vector<bool>, vector<bool>>())); EXPECT_TRUE(IsGt(CheckTypes<vector<string>, vector<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<vector<bool>, map<bool, char>>())); EXPECT_TRUE(IsLt(CheckTypes<vector<bool>, TPoint>())); EXPECT_TRUE(IsLt(CheckTypes<vector<bool>, tuple<bool>>())); } FIXTURE(Map) { EXPECT_TRUE(IsGt(CheckTypes<map<bool, char>, int8_t>())); EXPECT_TRUE(IsGt(CheckTypes<map<bool, char>, int16_t>())); EXPECT_TRUE(IsGt(CheckTypes<map<bool, char>, int32_t>())); EXPECT_TRUE(IsGt(CheckTypes<map<bool, char>, int64_t>())); EXPECT_TRUE(IsGt(CheckTypes<map<bool, char>, uint8_t>())); EXPECT_TRUE(IsGt(CheckTypes<map<bool, char>, uint16_t>())); EXPECT_TRUE(IsGt(CheckTypes<map<bool, char>, uint32_t>())); EXPECT_TRUE(IsGt(CheckTypes<map<bool, char>, uint64_t>())); EXPECT_TRUE(IsGt(CheckTypes<map<bool, char>, bool>())); EXPECT_TRUE(IsGt(CheckTypes<map<bool, char>, char>())); EXPECT_TRUE(IsGt(CheckTypes<map<bool, char>, float>())); EXPECT_TRUE(IsGt(CheckTypes<map<bool, char>, double>())); EXPECT_TRUE(IsGt(CheckTypes<map<bool, char>, TStdDuration>())); EXPECT_TRUE(IsGt(CheckTypes<map<bool, char>, TStdTimePoint>())); EXPECT_TRUE(IsGt(CheckTypes<map<bool, char>, TUuid>())); EXPECT_TRUE(IsGt(CheckTypes<map<bool, char>, TBlob>())); EXPECT_TRUE(IsGt(CheckTypes<map<bool, char>, string>())); EXPECT_TRUE(IsGt(CheckTypes<map<bool, char>, TTombstone>())); EXPECT_TRUE(IsGt(CheckTypes<map<bool, char>, void>())); EXPECT_TRUE(IsGt(CheckTypes<map<bool, char>, TDesc<bool>>())); EXPECT_TRUE(IsGt(CheckTypes<map<bool, char>, TFree<bool>>())); EXPECT_TRUE(IsGt(CheckTypes<map<bool, char>, TOpt<bool>>())); EXPECT_TRUE(IsGt(CheckTypes<map<bool, char>, set<bool>>())); EXPECT_TRUE(IsGt(CheckTypes<map<bool, char>, vector<bool>>())); EXPECT_TRUE(IsLt(CheckTypes<map<int8_t, char>, map<bool, char>>())); EXPECT_TRUE(IsLt(CheckTypes<map<bool, int8_t>, map<bool, char>>())); EXPECT_TRUE(IsEq(CheckTypes<map<bool, char>, map<bool, char>>())); EXPECT_TRUE(IsGt(CheckTypes<map<bool, string>, map<bool, char>>())); EXPECT_TRUE(IsGt(CheckTypes<map<string, char>, map<bool, char>>())); EXPECT_TRUE(IsLt(CheckTypes<map<bool, char>, TPoint>())); EXPECT_TRUE(IsLt(CheckTypes<map<bool, char>, tuple<bool>>())); } class TObjL { private: int8_t X; double Y; }; RECORD_ELEM(TObjL, int8_t, X); RECORD_ELEM(TObjL, double, Y); class TObjG { private: double X; string Y; }; RECORD_ELEM(TObjG, double, X); RECORD_ELEM(TObjG, string, Y); class T3DPoint { private: double X; double Y; double Z; }; RECORD_ELEM(T3DPoint, double, X); RECORD_ELEM(T3DPoint, double, Y); RECORD_ELEM(T3DPoint, double, Z); FIXTURE(Record) { EXPECT_TRUE(IsGt(CheckTypes<TPoint, int8_t>())); EXPECT_TRUE(IsGt(CheckTypes<TPoint, int16_t>())); EXPECT_TRUE(IsGt(CheckTypes<TPoint, int32_t>())); EXPECT_TRUE(IsGt(CheckTypes<TPoint, int64_t>())); EXPECT_TRUE(IsGt(CheckTypes<TPoint, uint8_t>())); EXPECT_TRUE(IsGt(CheckTypes<TPoint, uint16_t>())); EXPECT_TRUE(IsGt(CheckTypes<TPoint, uint32_t>())); EXPECT_TRUE(IsGt(CheckTypes<TPoint, uint64_t>())); EXPECT_TRUE(IsGt(CheckTypes<TPoint, bool>())); EXPECT_TRUE(IsGt(CheckTypes<TPoint, char>())); EXPECT_TRUE(IsGt(CheckTypes<TPoint, float>())); EXPECT_TRUE(IsGt(CheckTypes<TPoint, double>())); EXPECT_TRUE(IsGt(CheckTypes<TPoint, TStdDuration>())); EXPECT_TRUE(IsGt(CheckTypes<TPoint, TStdTimePoint>())); EXPECT_TRUE(IsGt(CheckTypes<TPoint, TUuid>())); EXPECT_TRUE(IsGt(CheckTypes<TPoint, TBlob>())); EXPECT_TRUE(IsGt(CheckTypes<TPoint, string>())); EXPECT_TRUE(IsGt(CheckTypes<TPoint, TTombstone>())); EXPECT_TRUE(IsGt(CheckTypes<TPoint, void>())); EXPECT_TRUE(IsGt(CheckTypes<TPoint, TDesc<bool>>())); EXPECT_TRUE(IsGt(CheckTypes<TPoint, TFree<bool>>())); EXPECT_TRUE(IsGt(CheckTypes<TPoint, TOpt<bool>>())); EXPECT_TRUE(IsGt(CheckTypes<TPoint, set<bool>>())); EXPECT_TRUE(IsGt(CheckTypes<TPoint, vector<bool>>())); EXPECT_TRUE(IsGt(CheckTypes<TPoint, map<bool, char>>())); EXPECT_TRUE(IsLt(CheckTypes<TObjL, TPoint>())); EXPECT_TRUE(IsEq(CheckTypes<TPoint, TPoint>())); EXPECT_TRUE(IsGt(CheckTypes<T3DPoint, TPoint>())); EXPECT_TRUE(IsGt(CheckTypes<TObjG, TPoint>())); EXPECT_TRUE(IsGt(CheckTypes<TObjG, T3DPoint>())); EXPECT_TRUE(IsLt(CheckTypes<TPoint, tuple<bool>>())); } FIXTURE(Tuple) { EXPECT_TRUE(IsGt(CheckTypes<tuple<bool>, int8_t>())); EXPECT_TRUE(IsGt(CheckTypes<tuple<bool>, int16_t>())); EXPECT_TRUE(IsGt(CheckTypes<tuple<bool>, int32_t>())); EXPECT_TRUE(IsGt(CheckTypes<tuple<bool>, int64_t>())); EXPECT_TRUE(IsGt(CheckTypes<tuple<bool>, uint8_t>())); EXPECT_TRUE(IsGt(CheckTypes<tuple<bool>, uint16_t>())); EXPECT_TRUE(IsGt(CheckTypes<tuple<bool>, uint32_t>())); EXPECT_TRUE(IsGt(CheckTypes<tuple<bool>, uint64_t>())); EXPECT_TRUE(IsGt(CheckTypes<tuple<bool>, bool>())); EXPECT_TRUE(IsGt(CheckTypes<tuple<bool>, char>())); EXPECT_TRUE(IsGt(CheckTypes<tuple<bool>, float>())); EXPECT_TRUE(IsGt(CheckTypes<tuple<bool>, double>())); EXPECT_TRUE(IsGt(CheckTypes<tuple<bool>, TStdDuration>())); EXPECT_TRUE(IsGt(CheckTypes<tuple<bool>, TStdTimePoint>())); EXPECT_TRUE(IsGt(CheckTypes<tuple<bool>, TUuid>())); EXPECT_TRUE(IsGt(CheckTypes<tuple<bool>, TBlob>())); EXPECT_TRUE(IsGt(CheckTypes<tuple<bool>, string>())); EXPECT_TRUE(IsGt(CheckTypes<tuple<bool>, TTombstone>())); EXPECT_TRUE(IsGt(CheckTypes<tuple<bool>, void>())); EXPECT_TRUE(IsGt(CheckTypes<tuple<bool>, TDesc<bool>>())); EXPECT_TRUE(IsGt(CheckTypes<tuple<bool>, TFree<bool>>())); EXPECT_TRUE(IsGt(CheckTypes<tuple<bool>, TOpt<bool>>())); EXPECT_TRUE(IsGt(CheckTypes<tuple<bool>, set<bool>>())); EXPECT_TRUE(IsGt(CheckTypes<tuple<bool>, vector<bool>>())); EXPECT_TRUE(IsGt(CheckTypes<tuple<bool>, map<bool, char>>())); EXPECT_TRUE(IsGt(CheckTypes<tuple<bool>, TPoint>())); EXPECT_TRUE(IsLt(CheckTypes<tuple<int8_t>, tuple<bool>>())); EXPECT_TRUE(IsEq(CheckTypes<tuple<bool>, tuple<bool>>())); EXPECT_TRUE(IsGt(CheckTypes<tuple<bool, bool>, tuple<bool>>())); EXPECT_TRUE(IsGt(CheckTypes<tuple<char>, tuple<bool>>())); EXPECT_TRUE(IsGt(CheckTypes<tuple<char>, tuple<bool, bool>>())); }
Kanye West may want to heed the advice he offers on one of his records: Drive slow. West Hollywood police stopped the rapper and dad-to-be late Wednesday night outside the posh Chateau Marmont for allegedly speeding and having tinted windows. West was apparently behind the wheel of baby mama Kim Kardashian's Mercedes Benz G63 SUV, which she purchased some months back. Officers ultimately decided to let him off with a warning and he drove off. Perhaps they just wanted to do something nice for Kanye since he broke the news during a recent concert that he and his ladylove are expecting their first child together. Whatever the reason, he's off the hook.
import { ApiProperty } from '@nestjs/swagger'; import { IsArray, IsEnum, IsString, Matches, MaxLength, MinLength, } from 'class-validator'; export class CampRegistList { @IsString() camp_name: string; @IsString() zip_code: string; @IsString() jibun_addr: string; @IsString() dets_addr: string; @IsString() intro: string; @IsString() mobile: string; } export class UserRegistIncludeCampDto { @IsString() user_id: string; @IsString() password: string; @IsString() user_name: string; @IsString() user_phone: string; @IsArray() camp_list: CampRegistList[]; }
<gh_stars>0 package figaro.oklab.com.figaro.data; /** * Created by olgakuklina on 8/4/17. */ public class LocationData { private final double latitude; private final double longitude; private final String locationName; public LocationData(double latitude, double longitude, String locationName) { this.latitude = latitude; this.longitude = longitude; this.locationName = locationName; } public double getLatitude() { return latitude; } public double getLongitude() { return longitude; } public String getLocationName() { return locationName; } }
The site chosen by Poland’s defense ministry for the deployment of the US “Patriot” air defense system is only 100 km from the Russian border, according to a report in Polish media. The information initially published in Polish political daily Gazeta Wyborcza was later confirmed by Polish officials. The city of Morag in northern Poland will be used to host the battery of Patriot missiles, which means they will be located very close to Russia’s enclave region of Kaliningrad. The initial plans were to place the air defense unit near capital Warsaw, but the Polish military chose Morag instead. They assure that the decision was not influenced by military strategy but rather due to the economy and convenience. “In Morag, we offer the best conditions for US troops and the best technical facilities for the equipment,” said Defense Minister Bogdan Klich. The battery will consist of eight launchers and will be manned by around 100 US soldiers. The exact date of the arrival of American troops and weapons to Poland is not yet fixed. The newspaper says it is expected to be in April. In 2008, Warsaw convinced Washington to deploy Patriot missiles in its territory as part of an agreement to host elements of the planned antiballistic missile system in Eastern Europe. The Bush-era plans have been downsized by the Obama administration, but the Patriot deal remains in force. At the height of tension between Russia and the US over the ABM shield President Medvedev announced that, if the system is built, Moscow will deploy Iskander short-range missiles in the Kaliningrad region to maintain strategic balance. This was never done, however, and after the antimissile system plans were overhauled, Russia said it no longer saw any need to move its Iskander missiles. Moscow has not yet commented on the latest move, but as military journalist Viktor Litovkin says, the Patriot missiles present no real danger to Russia's security. Whereas, political analyst Vladimir Kozin says the decision deals a direct blow to Russia’s strategic arms plans. Kozin also believes the “unfriendly gesture” could be just the first step on the part of the US, with more antiballistic missiles to follow.
def process(self): if self._url is None: print 'URL parameter missing' return False else: self.check() if self.captcha_result is True: self.solvecaptcha() if self.cap is None: print 'Failed to solve captcha' return False self.submitcaptcha() if self._html is not False: print 'Got it' return self._html else: print 'Not this time' return False else: print 'Evaded detection?' print 'self.cap: ' + self.cap return False print 'ended up here somehow - now what?' return False
Approximate localised dihedral patterns near a Turing instability Fully localised patterns involving cellular hexagons or squares have been found experimentally and numerically in various continuum models. However, there is currently no mathematical theory for the emergence of these localised cellular patterns from a quiescent state. A key issue is that standard techniques for one-dimensional patterns have proven insufficient for understanding localisation in higher dimensions. In this work, we present a comprehensive approach to this problem by using techniques developed in the study of radially-symmetric patterns. Our analysis covers localised planar patterns equipped with a wide range of dihedral symmetries, thereby avoiding a restriction to solutions on a predetermined lattice. The context in this paper is a theory for the emergence of such patterns near a Turing instability for a general class of planar reaction-diffusion equations. Posing the reaction-diffusion system in polar coordinates, we carry out a finite-mode Fourier decomposition in the angular variable to yield a large system of coupled radial ordinary differential equations. We then perform radial invariant-manifold and normal form analysis, leading to an algebraic matching condition for localised patterns to exist in the finite-mode reduction. This algebraic matching condition is nontrivial, and solving it reveals the existence of a plethora of localised dihedral patterns. These results capture the essence of the emergent localised hexagonal patterns witnessed in experiments. Moreover, we combine rigorous numerics and a Newton-Kantorovich procedure to prove the existence of localised patches with 6m-fold symmetry for arbitrarily large Fourier decompositions. This includes the localised hexagon patches that have been elusive to analytical treatment. Introduction In this work, we are interested in stationary localised patches of planar patterns embedded in a quiescent state bifurcating from a Turing instability. These patterns have the fascinating property that outside of some compact region in the plane they resemble a homogeneous, or background, state, while inside the compact region they can take on intricate and striking spatial arrangements. Particular examples of such spatial arrangements that continually arise in applications are those of cellular hexagons and squares, as illustrated in Figure 1(a). These localised structures are known to occur in the quadratic-cubic Swift-Hohenberg equation (SHE) given by where u = u(r, ) is a function of the polar coordinates (r, ) in the plane, ∆ := ∂ rr + 1 r ∂ r + 1 r 2 ∂ is the polar Laplacian operator, 0 < 1 acts as the bifurcation parameter, and ∈ R \ {0} is fixed, as well as in two-component reaction-diffusion (RD) systems near a Turing instability of the form (d) where D is the diffusion matrix, f is a nonlinear function and is the bifurcation parameter. For example, in the von Hardenberg RD model for dryland vegetation one can find localised hexagon patches, as depicted in Figure 1(b), which represent the density of vegetation in a water-scarce environment. Such localised cellular patterns are similarly found for other models of vegetation in arid climates, nonlinear optics, phase-field crystals, water waves, neural field equations, granular dynamics, binary fluid convection, and peaks on the surface of a ferrofluid. Despite the prevalence and importance of localised planar patterns, little is known about them from a mathematical perspective. To understand why this problem remains elusive, we first explore the theory of localised patterns in one spatial dimension. In one dimension, the existence of localised structures can be explained using spatial dynamics or symmetry arguments, and even more complicated behaviour can be understood from bifurcation theory and energy arguments. Naturally, one might question whether the aforementioned techniques could be extended to higher dimensions. Such an approach has yielded success in the study of localised planar fronts, where we now have a two-dimensional pattern (such as stripes or hexagons) but the localisation remains restricted to a single direction. For example, Doelman et al. proved the existence of modulated hexagon fronts connected to an unstable flat, or patterned, state. Proving this result required a centre-manifold reduction as well as finding connecting orbits to the resultant amplitude equations, utilising techniques from spatial dynamics, bifurcation theory, and geometric singular perturbation. However, this approach still requires that the localisation is in a single direction, such that the interface between states is a straight line. In fact, in the authors note the difficulty in rigorously explaining the existence of fully-localised patches of hexagons, acknowledging that 'the approach used in this paper certainly fails'. Alternatively, one could formally impose an ansatz on a fixed hexagon spatial lattice and derive 2D amplitude equations. However, trying to find connecting orbits in these equations is even more difficult than the planar hexagon equations. Furthermore, this formal reduction still results in trying to find fully-localised solutions to a two-dimensional equation, and so does not serve to simplify the problem. Despite this pessimistic outlook, recent attempts at understanding fully-localised planar patterns have yielded significant progress by focusing on patterns that are radially-symmetric. In particular, the works rigorously establish the existence of radially-symmetric solutions in the SHE (1.1). We note that, since we are exclusively interested in time-independent solutions, the SHE (1.1) takes the form of an RD equation as in (1.2) by simply setting u = (u, (1 + ∆)u). In the radially-symmetric case, i.e. u = u(r), the SHE (1.1) reduces to a fourth order ordinary differential equation (ODE) in r, meaning that one may interpret localised radially-symmetric patterns as ODE solutions which decay to zero as r → ∞. Using radial centre manifold theory, three types of stationary radially localised patterns have been shown to exist in (1.1) : spot A which has a maximum at the core, spot B which has a minimum at the core, and rings which have their maximum/minimum away from the core. These patterns are shown to bifurcate from = 0 and for 0 < 1 each pattern is constructed via asymptotic matching of solutions in a core manifold, containing all small-amplitude solutions that remain bounded as r → 0, and a far-field manifold, which contains all small-amplitude solutions with exponential decay to zero as r → ∞. The construction of the spot A solution is the simplest to understand as a quadratic order expansion of the core manifold is matched with solutions to the linear flow in the far-field. We refer the reader to Figure 1(c) for a visualisation of the nondegenerate quadratic tangency between the core and far-field manifolds at = 0. In this manuscript we attempt to move beyond the radially-symmetric case of u = u(r) by searching for steady-state solutions to two-component RD systems, including the SHE, that have a nontrivial dependence on the phase variable. To this end, we focus on localised dihedral patterns which depend on through a rotational m-fold symmetry. Precisely, such a pattern is comprised of peaks arranged in a compact region of the plane such that it is symmetric with respect to reflection in the x-axis and rotations of angle 2/m about its centre, r = 0. We term these solutions D m patches, in reference to the dihedral symmetry group generated by the above rotations and reflections, and note that a localised square pattern would be a D 4 patch whereas a localised hexagon pattern would be D 6 patch. In, Lloyd et al. numerically observed localised D 6 solutions to (1.1) bifurcating from the flat state, which then connects to the curve of a spot A solution, as shown in Figure 1(d). Such numerical schemes involve solving a Galerkin system coming from an N -term truncated Fourier expansion of the solution in the phase variable. In Figure 1(e) we observe that different choices of N possess distinct solution curves of localised D 6 patches bifurcating from the flat state at = 0, which is a key motivation of this work. We emphasise that our work herein goes beyond just localised square and hexagonal patterns and accounts for both even and odd m. Here we leverage the radially-symmetric analysis in by following a similar approach to find D m patches bifurcating from the flat state at a Turing bifurcation point. We study approximations of small amplitude localised dihedral patterns by expanding a D m patch solution as the truncated Fourier series u(r, ) = u 0 (r) + 2 N n=1 u n (r) cos (mn), (1.3) where N ∈ N is the truncation order. It should of course be pointed out that by definition a D m -lattice pattern is invariant under rotations of 2/m about its centre, meaning u(r, + 2/m) = u(r, ) for all (r, ), as well as under reflection in the x-axis, meaning u(r, −) = u(r, ) for all (r, ), and so any such solution of (1.2) is captured by the Fourier cosine-series (1.3) upon letting N → ∞. However, the truncation to order N in the above Fourier series is necessary for our analysis, thus leading to the stipulation that we study approximate localised dihedral patterns here. Putting (1.3) into the RD system (1.2) results in a nonlinearly coupled system of non-autonomous ODEs in the radial variable r in terms of the Fourier coefficients u n (r). Our goal in this work is to use the radial centre-manifold theory developed in to demonstrate the existence of exponentially decaying solutions u n (r) to our coupled ODEs, which through (1.3) lead to approximate localised planar patterns in the planar RD equations of the form (1.2). In particular, our analysis will be restricted to parameter values in the neighbourhood of a Turing instability and we will show that our planar patterns bifurcate from the homogeneous state undergoing such an instability. We will exclusively look for localised D m patch solutions that are analogous to the radially-symmetric spot A solutions from and do not attempt to prove the existence of all types of small amplitude localised radial solutions. The major difference between our work and the work on radially-symmetric patterns is that our asymptotic matching between the core and far-field manifolds requires solving (N + 1) ≥ 2 nonlinearly coupled algebraic equations, while the latter has only a single nonlinear equation (N = 0). Our main results in the following section make this connection precise, and we show that these matching equations can be solved explicitly for N ≤ 4, while in the case that m is a multiple of 6 we employ a computer-assisted proof to help demonstrate the existence of solutions for all finite N 1. Our approach possesses a number of advantages in studying the emergence of localised planar patterns. Firstly, our choice of Fourier decomposition (1.3) allows for patterns with a wide choice of possible symmetries. Instead of restricting to solutions on a predetermined lattice, this approach provides a theory for all dihedral patterns, including those without any associated domain-filling lattice. Moreover, through this approach we are able to reduce a planar PDE problem to an algebraic matching condition, which can be solved numerically with relative ease. Even at small truncation orders, which we demonstrate can be solved without numerical assistance, our approximate solutions provide excellent initial conditions for numerical continuation and exhibit a strong likeness to examples of localised patterns observed in experiments. Finally, this approach has value not just in its results, but also in its limitations. We derive an upper bound for the bifurcation parameter in terms of the truncation order N, providing useful intuition for the difficulties encountered as N → ∞. We observe infinitely many localised patterns bifurcating from the trivial state, which highlights an issue in understanding fully-localised planar patterns and helps to motivate further study in this area. The key limitation of this approach is that we cannot hope to explain the emergence of D m localised patterns in full planar RD systems. However, our solutions closely resemble those that have been documented in the literature, thus leading to the belief that they closely resemble true solutions of RD systems. Furthermore, we are able to say when localised patches of cellular patterns exist and bifurcate from the trivial state in a numerical scheme based on the finite mode Fourier decomposition (1.3). Through our analysis we are able to uncover new approximate localised solutions which can be used as initial conditions for numerical path-following routines, allowing one to continue localised solutions further into > 0 where the finitemode decomposition becomes a good approximation for the fully localised numerical solutions, and we observe exponential decay in the maximum of the amplitudes of u n. Numerically, we find these patches then undergo a process similar to homoclinic snaking, as discussed in. See also the special issue on Homoclinic snaking for a proper introduction to the topic and review of the literature. In this work, we demonstrate that a local change of variables brings distinct RD equations into a normal form in the neighbourhood of a Turing bifurcation. Notably, the SHE (1.1) is a specific instance of the general RD equations (1.2) which can be written in this canonical form without any change of variables, where the only difference is that now the nonlinearity in (1.1) should be considered as a truncated Taylor expansion about u = 0, representing the deviation from the homogeneous state that undergoes a Turing instability. This instance in which the SHE arises allows it to be considered as a truncated normal form for systems undergoing a Turing bifurcation, and is exactly why so many pattern formation investigations have employed the SHE in the first place. Turing instabilities have been documented in spatially-extended models from chemistry, biology, ecology, and fluid dynamics, to name a few, and so our results may be applicable to more complicated systems if a suitable normal form reduction can be found. There has been some progress in this direction for radially-symmetric localised solutions, such as in neural-field equations and on the surface of a ferrofluid, which suggests the approach presented here may also be extended in these cases. Hence, our work in this manuscript provides evidence for the emergence of localised dihedral patterns resulting from Turing bifurcations on planar domains, while also giving explicit forms for finding such patterns numerically. This paper is organised as follows. In Section 2 we present our main results. We begin with the necessary hypotheses to assume a non-degenerate Turing bifurcation is taking place in system (1.2) at some parameter value and then proceed to state our results for the Galerkin truncated system arising from assuming the form (1.3). In Section 3 we present our numerical findings, beginning with numerical verification of our analysis in §3.1 and then in §3.2 we provide numerical continuations of the localised dihedral patterns far into > 0 where they develop larger amplitudes and greater localisation. In Section 4 we define and quantify the core and far-field manifolds of our coupled radial ODE resulting from introducing (1.3) into (1.2). Furthermore, we reduce the problem of asymptotically matching these manifolds when 0 < 1 to solving a system of nonlinear matching equations in N + 1 variables. Section 5 is entirely dedicated to solving these matching equations. We begin by explicitly solving them for small values of N and then we demonstrate the existence of solutions to these matching equations for N 1. The latter is achieved by first employing a computerassisted proof (whose details are left to the appendix) to solve a limiting nonlocal integral equation and then using this solution to demonstrate the existence of solutions for large, but finite, N. The results of Sections 4 and 5 together are the proofs of our main results for the RD systems near a Turing instability, Theorems 2.2 and 2.3 below. Finally, we conclude in Section 6 with a discussion of our findings and some future areas of work. Main Results We begin with steady planar two-component RD equations, which we express as where u = u(r, ) ∈ R 2 for the standard planar polar coordinates r ∈ R + and ∈ (−, ]. Throughout we will assume that D ∈ R 22 is an invertible matrix and f ∈ C k R 2 R, R 2, k ≥ 3, describes the reaction kinetics of the system. The parameter plays the role of the bifurcation parameter. We assume that f (0, ) = 0 for all ∈ R such that u(r, ) ≡ 0 is a homogeneous equilibrium for all ∈ R. Since D is invertible, we can apply D −1 to (2.1) to normalise the diffusive term ∆u. With the following hypothesis we make the assumption that (2.1) undergoes a Turing instability from the homogeneous equilibrium u = 0 with non-zero wave number. In what follows 1 n will denote the n n identity matrix and for simplicity we will assume that this bifurcation takes place at = 0. Hypothesis 1 (Turing Instability). We assume that f (u, ) satisfies the following condition: for some fixed k c ∈ R +. Furthermore, the eigenvalue = −k 2 c of D −1 D u f is algebraically double and geometrically simple with generalised eigenvectors 0, 1 ∈ R 2, defined such that We now proceed by expanding D −1 f (u, ) as a Taylor expansion about (u, ) = to write (2.1) as In the above we have where Q and C are symmetric bilinear and trilinear maps, respectively. We note that any remainder terms do not affect the subsequent analysis since we are in the region where |u| and || are small, and so we have neglected them in h.o.t., representing the higher order terms. Notice that Hypothesis 1 gives that the linearization of the right-hand-side of (2.2) about (u, ) = has a zero eigenvalue, giving way to the Turing bifurcation. Let us now make the following non-degeneracy assumptions regarding this bifurcation. Hypothesis 2 (Non-degeneracy condition). We assume that M 2 and Q satisfy the following conditions: where 0, 1 ∈ R 2 are generalised eigenvectors of M 1 defined in Hypothesis 1 with respective adjoint vector The non-degeneracy conditions in Hypothesis 2 are important for our proofs in Section 4 and so we will formally describe how they arise. We suppose u = A 0 + B 1 and project onto each eigenvector; then, (2.2) can be transformed into the following normal form where A := (A, B) T, and Assuming |B| |A| 1, (2.3) can be reduced to the leading-order PDE which is analogous to the SHE (1.1). Here we have defined := * 1, −C( 0, 0, 0 ) 2 with c 0 and as in Hypothesis 2. In spot A solutions were found to exist in the SHE if and only if c 0 > 0 and = 0. We note that (2.2) is invariant under the transformationT : (u, Q) → (−u, −Q), and so we the assumption = 0 is equivalent to assuming > 0, up to an application ofT. Hence, Hypothesis 2 provides nondegeneracy assumptions for the existence of localised spots in the SHE (2.4), which we relate to (2.2) in the neighbourhood of a Turing instability. Remark 2.1. The SHE (1.1) fits into our RD framework and satisfies Hypothesises 1 and 2 by setting We see that M 1 is identical toM 1 in the RD normal form (2.3) for patterns close to a Turing instability, and so we will focus exclusively on the SHE (1.1) for our numerical demonstrations. Under the above hypotheses, our goal in this work is to obtain approximate dihedral solutions to (2.1) for ≈ 0 that are bounded as r → 0, have lim r→∞ u(r, ) = 0, and satisfy u(r, + 2/m) = u(r, ) for all (r, ) and some m ∈ N. Previous works on the SHE have proven the existence of such solutions which are independent of the azimuthal component and having seen (2.4) one should be convinced that these results can be extended to the more general system (2.1) with little issue. We aim to initiate the study of solutions of (2.1) that exhibit a nontrivial dependence on the azimuthal component, resulting in the property u(r, + 2/m) = u(r, ). Such patterns are invariant with respect to the symmetry group D m, generated by rotations of 2/m in the plane about the origin and reflections over the horizontal axis. To this end, we introduce a D m, N -truncated Fourier approximation of solutions to (2.2) by Upon projecting onto each Fourier mode cos(mn), (2.2) is reduced to the (finite-dimensional) Galerkin system for all n ∈ and Since the case when N = 0 has already been thoroughly studied, we therefore restrict our analysis to the case when N ≥ 1 for the remainder of this manuscript and consider only nontrivial solutions of (2.6). We present our first main result of the manuscript detailing the existence of solutions to (2.6) for N = 1, 2, 3, 4, which represent approximate small patch solutions of the steady planar RD system (2.1). Theorem 2.2. Assume Hypotheses 1 and 2. Fix m, N ∈ N and assume the constants {a n } N n=0 are nondegenerate solutions of the nonlinear matching condition a n = 2 cos m(n − 2j) 3 a j a n−j, (2.8) for each n = 0, 1,..., N. Then, there exist constants 0, r 0, r 1 > 0 such that the Galerkin system (2.6) has a radially localised solution of the form for each ∈ (0, 0 ), n ∈ , where n (r) := k c r − mn 2 − 4 and J mn is the (mn) th order Bessel function of the first kind. In particular, such localised solutions exist for N = 1, 2, 3 with the a n given in Proposition 5.4. Furthermore, in the case that N = 4 and 6 | m, these results again hold with the a n given in Proposition 5.6. The proof of Theorem 2.2 is broken down over Sections 4 and 5. In particular, Section 4 decomposes the Galerkin system on r > 0 into three disjoint intervals, making up the three components of the solution presented in (2.9). In each of these regions the dynamics can be captured by geometric blow-up methods. Section 4 presents the analysis for general N ≥ 1 and concludes by showing that solutions in the three distinct regions of the Galerkin system can be patched together by finding nondegenerate solutions of (2.8). The resulting values of a n that satisfy these matching equations are exactly the a n presented in Theorem 2.2. Section 5 is entirely dedicated to further understanding and solving these matching equations. We present a number of symmetry results that help to eliminate redundant solutions of (2.8) and then proceed to solve these equations for small N by hand. The result of this work is the proof of Theorem 2.2. As one can see, the matching condition (2.8) depends on the value of cos( m 3 ) and so there are four distinct cases depending on whether m is divisible by 2 and 3. In the case of N = 1, Proposition 5.4 below shows that there is a unique localised D m solution to (2.6) so long as 3 | m or 2 | m, up to a half-period rotation, with a peak at its centre if 6 | m and a depression otherwise. We emphasise that, although the a n are equivalent for any two choices of m leading to the same value of cos( m 3 ), the full solution u n (r) defined in (2.9) has a distinct m-dependent radial profile for each n = 0,..., N. This is evident in Figure 2 where we present the N = 1 solutions for rhombic (D 2 ), triangular (D 3 ), square (D 4 ) and hexagonal (D 6 ) patterns; although the rhombic and square patterns possess the same a n since cos( 2 3 ) = cos( 4 3 ) = − 1 2, they produce fundamentally different solutions as a result of the Bessel functions J mn (r) in (2.9). For N > 1, we note that matching condition (2.8) possesses an extra symmetry when 6 | m, which is analogous to associating 'bright' solutions u * (r, ) with their 'dark' counterparts v * (r, ) := U 0 (r) − u * (r, ), where U 0 (r) is the localised axisymmetric solution found in . This means that the full set of solutions to (2.8) for 6 | m are described by a smaller subset of solutions than in the case when 6 m because more solutions can be recovered from their respective symmetries. We emphasise that our work in Section 5 shows that the matching condition (2.8) does not have a unique solution for 2 ≤ N ≤ 4, even after we quotient by those related by symmetry. Solutions given by Theorem 2.2 for N = 2 are presented in Figure 3. As in the case N = 1, there are again no D m solutions for m = 5, 7, 11, 13,..., i.e. satisfying 2 m and 3 m. In contrast, there are exactly two solutions for each other value of m, with m = 2, 3, 4, 6 presented in the figure. Both D 6 solutions have an elevation at the centre, where (H 2 ) is the 'dark' solution associated to the standard cellular lattice solution (H 1 ). Notice that for 6 m the pair of D m solutions are such that one has a depression at its centre while the other has an elevation. Moreover, those solutions for 6 m with a depression at the centre can be seen as a natural extension of the N = 1 solution, whereas the latter is fundamentally different from its lower-dimension counterpart. This suggests that the second solution is not related to the 'standard' localised D m pattern. Such a solution may be a transitory state that connects to another solution, such as the radial spot, or an artefact of our Galerkin approximation which only appears for a given finite truncation N. We leave such questions for a follow-up investigation. For N = 3, Theorem 2.2 gives five distinct solutions to (2.6) when m is even or equal to 3. These distinct solutions can be seen in Figure 4 for m = 2, 3, 4, 6, as well as m = 5. Notice that we now find the emergence of a single D 5 solution. We further note that super-lattice structures, caused by a superposition of lattice symmetries, begin to emerge as solutions of (2.8). This is most apparent in the D 6 patterns of Figure 4 where, as well as the standard cellular lattice solution (H 1 ), we obtain solutions comprised of a hexagon patch surrounded by other hexagon patches (H 2 ) or faint triangular patches (H 3 ), respectively. As N increases, it becomes more difficult to solve (2.8) explicitly, and so our analysis of N = 4 is focused on the simpler case when 6 | m. Theorem 2.2 (via Proposition 5.6 below) gives five distinct solutions to (2.6) which are presented in Figure 5 for the SHE. The super-lattice structures seen in N = 3 are more apparent, including a very striking pattern of localised triangular patches surrounding a hexagon in (H 3 ). Solving the matching equations (2.8) for general N is a difficult task, especially if one seeks to identify all such solutions for a given N. To provide a more general result, we will restrict ourselves to the case 6 | m, which includes the case of hexagonal symmetries coming from the group D 6. In this case the matching equations are slightly simplified since cos( m(n−j) 3 ) = cos( m(n−2j) 3 ) = 1 for each integer n and j. For low truncation orders N = 1,..., 4 our results in Section 5 below prove that there is a unique solution for which a n > 0 for all n ∈ . In particular, for m = 6 this solution corresponds to the 'standard' cellular hexagon patch (H 1 ) in Figures 2-5, where peaks are arranged in a uniform hexagonal tiling. As N increases, we numerically observe that the strictly positive solution possesses a scaling of the form a n = O(N −1 ) for all n ∈ , and, as can be observed in Figure 6(a), we find that the rescaled positive solutions appear to converge to a continuous function as N becomes very large. Interestingly, for N 1 the matching equations (after rescaling the a n ) resemble a Riemann sum which in the limit as N → ∞ formally yields the nonlocal continuum matching equation for each t ∈. Hence, one expects that if * (t) satisfies (2.10) then there exists a solution of (2.8) such that a n ≈ * (n/(N + 1))/(N + 1), for each n = 0,..., N. We make this precise with the following theorem, for which the details of moving between the continuum equation (2.10) and the matching equation (2.8) are left to Section 5. Then, there is an N 0 ≥ 1 such that for all N ≥ N 0 there exists 0 > 0 so that the Galerkin system (2.6) has a radially localised solution of amplitude O( 1 2 ) for each ∈ (0, 0 ). Precisely, there exists r 0, r 1 > 0 such that where J 6m0n is the (6m 0 n) th order Bessel function of the first kind. The a n are such that for all > 0, there exists N > 0 such that for all N ≥ N we have where * (t) is a positive and continuous solution of (2.10) for all t ∈. Unlike Theorem 2.2, we are only able to identify a single solution of the Galerkin system (2.6) when N 1. This is limited by the fact that a n 's are obtained from a continuous solution to the continuum matching problem (2.10). To obtain the continuum solution we employ a computer-assisted proof, as detailed in Section 5.3, whose details are primarily left to the appendix. It is possible that similar computer-assisted proofs could produce other solutions to (2.10), in which case one can follow the work in Section 5.3 with relative ease to arrive at further solutions of the Galerkin system with large N. We emphasise that although the positive solution corresponds to standard localised cellular hexagons (H 1 ) when m = 6, Theorem 2.3 holds for any m = 6m 0 with m 0 ∈ N. For any m 0 > 1, the pattern given in Theorem 2.3 has 6m 0 -fold symmetry and so corresponds to a localised quasicrystalline structure, such as those seen in. We refer the reader to Figure 6 Numerical Investigation of Localised Patterns In this section we present our numerical results for the localised patterns from the previous section. Throughout we will exclusively focus on the SHE (1.1) and restrict our larger-N system to be N = 10. This allows us to investigate patches for N = 1,..., 4 embedded into a higher-dimensional system, while also maintaining computation efficiency. The choice of N can be made considerably higher, however for our chosen radial domain, we have found that the choice of N = 10 is sufficient. Our numerical procedure is described in Appendix A, which takes the radial domain to be 0 ≤ r ≤ r *, discretised into T mesh points {r i } T i=1 allowing us to numerically solve (1.1) using finite difference methods. Following this, we employ a secant continuation code similar to in order to continue solutions beyond the limited parameter regions from the results of the previous section. We fix = 1.6 in (1.1) as this is the same choice of parameters as seen in where localised hexagon patches are observed undergoing snaking behaviour. N=3 N=4 (a 2 ) In what follows we first verify our analytical results from the previous section by investigating numerical solutions to (1.1) as → 0 + for N = 1,..., 4 and N = 10. We then conclude this section by continuing localised dihedral patterns beyond the small > 0 parameter regimes of our main results to observe snaking bifurcation curves. Verification of Analysis We recall that the theoretical results presented in Section 2 are for the parameter region 0 < 1, and so here we aim to support our theoretical results by numerically investigating solutions of (1.1) in the limit as → 0. As decreases towards 0, any localisation effects become weaker, meaning that solutions begin to grow in width. As a result, solutions will inevitably be affected by the width of the radial boundary r = r * as → 0. In order to minimise these boundary effects, we choose r * = 2000, with T = 6000 mesh points, for the rest of this subsection. We begin by introducing the 'numerical amplitude' u * n of each v n, defined by We investigate the ratios of u * n /u * 0 as → 0 and compare with |a * n |/|a * 0 | for each n ∈ Figure 7. Notably absent are similar results for the standard D 4 pattern (S 1 ). The reason for this is that the predicted values of a * n for this D 4 pattern from Proposition 5.4 below are the same as for the D 2 pattern, and so their inclusion would clutter Figure 7. We do however comment that we have similarly confirmed our theoretical results for the D 4 case, despite them not being presented here. In, begins further away from the sparsely dotted line than (a n ) for moderate values. However, these solutions also appear to tend to their respective theoretical predictions as → 0 +, for each n ∈ . Finally, the ratio u * n /u * 0 of a D 6 solution, indicated by (c n ) in each figure, is plotted with respect to. We note that the values of (c n ) are less than 1, in contrast to the values of (a n ) and (b n ), and tend to their associated dashed lines from our theoretical results as → 0 +. In Figure 8 we present results for the 'standard' D 6 solution to (1.1) when N = 10. In Figure 8 (a) we plot N u * n against n/N, where u * n is defined in (3.1), and compare with N a n and * (n/N ), where a n are numerical solutions of the matching condition (2.8) for N = 10, m = 3, and * is a numerical solution of (2.10). The amplitudes are in quite good agreement, which could also be improved by further increasing r *. In Figure 8 (b) we plot v n T against n/N and observe exponential decay as n → N. This suggests that the coefficients of each Fourier mode cos(mn) decay exponentially as n increases, thus providing numerical evidence that the Fourier series (1.3) might converge to a continuous solution as N → ∞. Continuation of Solutions One of the major benefits of this work is its application to the numerical study of localised planar patterns. To illustrate, we can begin with an initial guess of the form Here is a scaling term that accounts for our choices of (, ), the values of a n are given by our theoretical solutions in Section 5.2, and the exponential term gives us an approximation for localisation in the far-field. In this parameter regime, solutions are more strongly localised and hence are smaller in width. Hence, for this subsection we choose r * = 100 with T = 1000 mesh points for computational speed. Then, by first solving the nonlinear matching condition (2.8) and substituting the subsequent solution a n into (3.2), we are able to construct very effective initial guesses for numerical continuation of such patterns. Furthermore, for moderate values of it is often sufficient to solve a low-dimension algebraic system, i.e. for N 0 = 1, 2, 3, which can be embedded into an initial guess of the form (3.2) with a higher dimension N 1, where a n = 0 for all N 0 < n ≤ N 1. We utilise this approach in order to find small-amplitude localised D m patterns and continue them to larger amplitudes. Three examples of continued localised D m patterns are presented in the Figures 9, 10, and 11 for m = 2, 3, 4, respectively. The continuation of localised D 6 solutions was extensively covered in, and so here we focus on the novel Figure 9, we present our numerical results for a localised D 2 solution to (1.1). We begin with an initial guess of the form (3.2) with a 0 = −1, a 1 = − √ 2 and a n = 0 for 1 < n ≤ 10 such that (a 0, a 1 ) satisfies the D 2 matching equation (2.8) when N = 1. Then, for = 0.1, the initial guess converges to a localised solution consisting of two spikes in close proximity, corresponding to the (R 1 ) solution in Figure 2. As increases in Figure 9, we observe that the D 2 solution undergoes snaking behaviour, where variations in cause solutions to gain extra peaks and grow in width. Similarly, in Figures 10 and 11 we present our numerical results for a localised D 3 and D 4 solution to (1.1), respectively. In each case we solve the matching equation (2.8) for N = 1 and substitute our solution in the initial guess (3.2); notably, the initial guess for the D 4 solution is identical to the D 2 solution, other than a change of the value of m in (3.2). Then, for = 0.1 the initial guess converges to a localised solution consisting to three (m = 3) or four (m = 4) spikes, which is predicted by (T 1 ) and (S 1 ), respectively, in Figure 2. As increases we again observe that the D 3 and D 4 solutions exhibit snaking behaviour. This behaviour appears to be quite robust for larger dihedral symmetries as we have similarly observed such snaking at least for D 6, D 8,..., D 14 solutions as well. However, these results are not presented here for brevity. In one spatial direction this snaking behaviour is known as homoclinic snaking, described by homoclinic cycles in phase space, and is now well-understood. However, in two or more spatial directions such snaking bifurcation curves are not well understood, and there continues to be significant interest in this area. We note that in Figures 9, 10, and 11 we see that emerging peaks also appear to be subject to hexagonal packing, suggesting that the domain-covering hexagonal lattice may have a pivotal role in the structure of any observed localised patterns. In the parameter regions of Figures 9-11 solutions continue into the strongly localised regime, where is moderately-valued, such that localised solutions resemble the N = 1 patterns in Figure 2. In order to capture more complicated patterns, we numerically solve (1.1) when N = 4 for localised D 6 solutions in the weakly localised regime with = 0.4. For this parameter choice, the hysteretic region of the bistable nonlinearity in the SHE is very small and solutions never become strongly localised. We present our results for localised D 6 patterns in Figure 12 where one can observe each of the distinct solutions (H j ) predicted in Figure 5 for j = 1,..., 5, and track the associated solution curves in -parameter space. Hence, we are able to numerically observe our theoretical solutions for (1.1) when N = 4 in a weakly localised parameter regime. Localised Solutions to the Galerkin System The goal of this section is to divide the dynamics of the Galerkin system (2.6) into separate regions over the independent variable r > 0 and then provide the necessary conditions for matching the solutions in each region together. We remark that satisfying the resulting matching conditions is left to the following section. We note that there exists a rescaling of the form for j = 1, 2, such that M 1 has a repeated eigenvalue of = −1 and (2.2) remains unchanged. Hence, without loss of generality, we will take = −1 throughout since the case when = −k 2 c can be recovered by inverting (4.1) at the end. To formulate the problem properly, we express (2.6) as the following first-order system, for each n ∈ , where we recall that O 2 and 1 2 are the 2 2 zero and identity matrices, respectively. Recall that the nonlinear sums in F n (U; ) can equivalently be written as Our goal is to obtain exponentially decaying solutions of (4.2), which give way to the u n (r) in the truncated Fourier expansion (2.5) of the approximate solution u(r, ). Since we are interested in solutions which decay as r → ∞, we begin by noting that for each n ∈ we have lim r→∞ A n (r) = A ∞. So, in the limit as r → ∞, the linearised dynamics of (4.2) decouple for each n and can be understood through the N + 1 identical eigenvalue problems The eigenvalue problem (4.4) reduces to solving the following equation for, which, after applying a suitable similarity transformation M → T −1 MT, where for any matrix M ∈ R 22, the determinant (4.5) can be written as Here, we have reintroduced the linearly independent vectors 0, 1 ∈ R 2 introduced in Hypothesis 1, defined by following the rescaling (4.1), and equipped with adjoint eigenvectors * 0, * 1 such that * i, j = i,j. The solutions of (4.7) are given by where the coefficient x ∈ R depends on M 2. Thus, for = 0 the linear system has spatial eigenvalues = ±i, with double algebraic multiplicity. By Hypothesis 2 we have that * 1, M 20 < 0 and so, as increases off of 0, the system undergoes a Hamilton-Hopf bifurcation such that the eigenvalues split off of the imaginary axis and into the complex plane. We then expect localised solutions to bifurcate from the homogeneous state in the region 0 < 1 since in this region each of the N + 1 linearised equations has a two-dimensional eigenspace of solutions that exponentially decay to zero as r → ∞. In order to construct localised solutions to (4.2), which correspond to localised solutions of (2.6), we utilise local invariant manifold theory for radial systems, as seen in. The general idea is as follows. In §4.1 we construct the set of all small-amplitude solutions to (4.2) that remain bounded as r → 0, which we call the 'core manifold'. This manifold is denoted by W cu − (), where we have used the notation for a local centreunstable manifold, and is constructed on the bounded sub-domain r ∈ , for some fixed r 0 1. Then, in §4.2 we construct the set of all small-amplitude solutions to (4.2) that decay exponentially as r → ∞, which we call the 'far-field manifold'. This manifold is denoted by W s + (), where we have used the notation for a local stable manifold, and can be constructed on r ≥ r ∞, for some fixed r ∞ > 0. The value of r 0 can be freely chosen as long as it is sufficiently large and so we choose r 0 ≥ r ∞ such that the core and far-field manifolds overlap and can be matched at the coincidental point r = r 0 ; see Figure 13. In § 4.5 we show that this matching can be done under the assumption that we have a nondegenerate solution to a nonlinear system of equations, which we refer to as the 'matching equations'. In Section 5 we provide the properties and some solutions to these matching equations; combining these results with the work in this section leads to our main results in Section 2, since any function that lies on the intersection of both W cu − () and W s + () is, by definition, a localised solution of (4.2). The Core Manifold Here we will characterise the core manifold, W cu − (), for 0 < 1, which contains all small-amplitude solutions to (2.6) that remain bounded as r → 0. This is a local invariant manifold, and so we determine it on some bounded interval r ∈ , for a large fixed r 0 > 0. We begin by noting that at the bifurcation point = 0 the linearised behaviour about U = 0 of (4.2), given by Figure 13: The local invariant manifolds W cu − () and W s + () are constructed over sub-domains 0 ≤ r ≤ r0 and r∞ ≤ r < ∞, respectively. We choose r0 > r∞ and look for intersections between W cu − () and W s + () at the point r = r0. and J (r), Y (r) are -th order Bessel functions of the first-and second-kind, respectively. To see how we arrive at the above solutions for v n, we recall that the system d dr v n = A n (r)v n is equivalent to where v n = (u n, ∂ r u n ) T. By decomposing u n by the generalised eigenvectors we arrive at the following radial ODEs 14) The second ODE in (4.14) is just the (mn) th -order Bessel equation, which has solutions of the form v (n) where the factor of 2 is included for future simplicity. Solutions to the first ODE in (4.14) can be written as v (n) where v p n (r) is the particular solution of (4.14) for v and so, after rescaling by a factor of 2, we see that the general solution to d dr v n = A n (r)v n is as stated in (4.11). Hence, the full 4(N + 1)-dimensional linear system (4.9) has solutions of the form Here we have used the notation n to denote the n th element of a vector v. Furthermore, from the asymptotic forms in Table 1, V 1,2 (r) remain bounded and V (n) 3,4 (r) blow up as r → 0, for each n ∈ . Hence, we expect the set of solutions to (4.2) that remain bounded as r → 0 to form a 2(N + 1) dimensional manifold in R 4(N +1) for each fixed r > 0. Let us denote by P cu − (r 0 ) the projection onto the subspace of In what follows we will use the Landau symbol O r0 () with the meaning of the standard Landau symbol O() expect that the bounding constants may depend on the value of r 0. where : Furthermore, the right-hand side of (4.20) depends smoothly on (d, ), and the nonlinear functions Q m n (d 1 ) are defined as Proof. This statement is proven in a similar way to . We first note that the linear adjoint To see this, we note that d dr W n = −A T n (r)W n can be written as 2 (r) * 0, and we arrive at the following ODEs Hence, we see that 1 r w (n) 1 solve (4.14), and so solutions take the form stated in (4.22). We choose the particular ordering and scaling of our adjoint solutions W holds for all r ∈ R, n ∈ , i, j ∈ {1, 2, 3, 4}, where, k denotes the Euclidean inner product for R k. We introduce W We first check that any solution U ∈ C(, R 4(N +1) ) of (4.25) gives a solution of (4.2) that is bounded on r ∈ . In the limit as r → 0, we see from Table 1 (4.22), is bounded by s (mn+3) for j = 3, and s (mn+1) for j = 4. Hence, the integrals multiplying the unbounded solutions V (n) j (r) are bounded by r (mn+4) for j = 3 and r (mn+2) for for both j = 3, 4 as r → 0, we see that the right-hand side of (4.25) is continuously differentiable on its domain whenever U ∈ C(, R 4(N +1) ). Since (4.25) is a specific case of a variation-of-constants formula, it is straightforward to check that U(r) satisfies (4.2). We now need to check that any bounded solution U(r) ∈ C(, R 4(N +1) ) of (4.2) satisfies (4.25). Taking a variation-of-constants formula for small solutions of (4.2), we find for an appropriate d : 4 = 0, which proves the assertion. Finally, we solve (4.25) by applying the uniform contraction mapping principle for sufficiently small d = (d 1, d 2 ) and. Evaluating (4.25) at r = r 0, we arrive at (4.26) Then, we introduce for j = 3, 4 so that we can write our small-amplitude core solution as In order to arrive at (4.20), we apply a Taylor expansion to (4.27) about |d 1 | = |d 2 | = = 0 and find c (n) where i,j,n := (2) Notably, |i|,|j|,n is invariant under permutations of its indices and, for the restriction i + j = n, one can always find some a, b ∈ N 0 such that |i|,|j|,n = a,b,a+b. Computing the explicit value for a,b,a+b, we find that giving c (n) where Q m n (d 1 ) is as defined in the statement of the lemma. This completes the proof. We conclude this section by noting the following. For sufficiently large r 0, we can use Table 1 to write (4.20) in terms of its elements u n (r 0 ), v n (r 0 ) ∈ R 2 for each n ∈ , where for each n ∈ . Here we have written y n := r 0 − mn 2 − 4, while the O r0 () remainders capture the higher order terms when |d| and || are taken to be small. The Far-Field Manifold We now turn to characterising the far-field manifold, W s + (). To this end, we will introduce the variable (r) ≥ 0 to take the place of the 1 r -terms in (4.2). The result is the extended autonomous system with the property that (r) = r −1 is an invariant manifold of (4.35), and by definition this invariant manifold recovers the non-autonomous system (4.2). To construct the far-field manifold W s + () we find the set of all small-amplitude solutions (U, )(r) to (4.35) such that U(r) decays exponentially as r → ∞. Following this, we evaluate at (r) = r −1 such that U(r) is an exponentially decaying solution of (4.2). Before attempting to find exponentially decaying solutions to (4.35), it is convenient to transform the system into the normal form for a Hamilton-Hopf bifurcation. We define complex amplitudes A := N n=0, B := N n=0, which satisfy the following relations for each n ∈ , such that (4.35) becomes We apply nonlinear normal form transformations to (4.37), as seen in, to remove the non-resonant terms from the right-hand side. such that (4.37) becomes Since the linearisation of (4.37) about ( A, B) = 0 decouples for each n ∈ , the derivation of these transformations follows in the same way as for the radial problem. We use matched asymptotics in order to calculate the following leading order expansions, where we have used the symmetry of (4.37) with respect to the reverser R : ( A, B,, r) → ( A, − B, −, −r) in order to write down the higher-order terms containing. Following , we note that there exist smooth homogeneous polynomials { n, n } N n=0 of degree 2 such that the change of coordinate An explicit calculation verifies that every type of quadratic monomial belongs to the range of (D − i), and so we conclude that { n, n } N n=0 exist. Hence, applying both (4.43) and (4.45) transforms (4.37) into Finally, we remove a relative phase from (A n, B n ) for each n ∈ . We define n (r) to be the solution of and employ the transformation (A n, B n ) → e in (A n, B n ) for each n ∈ . This transformation, after absorbing the higher order terms of k 2,n (, ) and c 0,n (, ) into the remainder, turns (4.48) into the desired form (4.40) and thus completes the proof. Having transformed our equations into the radial normal form (4.40) for a Hamilton-Hopf bifurcation, we also introduce the unconstrained variable (r) to take the place of √. Then, replacing with 2, the normal form (4.40) can be extended to the following system, The rest of this section is dedicated to finding a parametrisation for exponentially decaying solutions in the far-field region and matching this with the core manifold (4.34) at the point r = r 0. In order to find solutions to (4.50) where (A, B) decay exponentially as r → ∞, we consider the far-field region to be made up of two distinct sub-regions. These regions are the 'rescaling' region, where the radius r is sufficiently large such that r = O( − 1 2 ), and the 'transition' region, where the radius spans the gap between the rescaling region and the core region. We refer the reader to Figure 14 for a visualisation of these different regions. In the rescaling region, we perform a coordinate transformation in order to find exponentially decaying solutions to (4.40) for sufficiently small values of ; these solutions are tracked backwards through r to the boundary of the rescaling region where they provide an initial condition for solutions in the transition region. Following this, solutions are tracked backwards in r through the transition region, starting at the previously-found initial condition and staying sufficiently close to the linear algebraic flow of (4.50), until they arrive at the matching point r = r 0. See again, Figure 14 for visual reference. Finally, we perform asymptotic matching to find intersections between the core and far-field parametrisations at the point r = r 0, thus defining localised solutions to (2.6). The dynamics in the aforementioned regions are described in the following subsection, followed by a subsection devoted entirely to the asymptotic matching. The Rescaling Chart We now define rescaling coordinates in order to find exponentially decaying solutions for sufficiently large values of r; that is, we introduce These coordinates are of a similar form to the standard rescaling coordinates seen in, except with a higher -scaling of A and B. Then, we can write (4.50) in the rescaling chart as, for all n ∈ . We present the following lemma. for all < 0, where a ∈ R (N +1), a = 0, and Y ∈ R is arbitrary. Proof. To begin, note that R acts as a parameter, and the subspace { R = 0} is invariant under the flow of (4.53). In this invariant subspace the dynamics reduce to which has an exponentially decaying solution for s ∈ [r 1, ∞) of the form where a ∈ R (N +1), a = 0, and Y ∈ R. Evaluating (4.58) at s = r 1, this becomes (A R, B R, R, R )(r 1 ) = ar Any exponentially decaying solution for R (r) ≡ 1 remains sufficiently close to the invariant subspace { R (r) = 0} since introducing R is a regular perturbation of (4.57). Therefore, setting R (s) = 1 2, we can express exponentially decaying solutions to (4.53) evaluated at s = r 1 in the following form, where the O( 1 2 ) terms are due to the O(| R |) terms in (4.53). This completes the proof. We conclude this subsection by noting that upon inverting the rescaling transformation (4.52), exponentially decaying solutions to (4.50) evaluated at r = r 1 − 1 2 take the form, for sufficiently small values of. Hence, with the previous lemma we parametrised the far-field manifold W s + () at a transition point r = r 1 − 1 2, after which exponential decay is guaranteed to occur. By tracking the trajectories of (4.50) with initial condition (4.61) backwards in r, we are able to extend this parametrisation to the point r = r 0, where we can then perform asymptotic matching to find intersections with the core manifold W cu − (). This analysis of the transition chart is covered in the following subsection. The Transition Chart In the previous subsection we parametrised the set of exponentially decaying solutions to (4.50) for r > r 1 − 1 2. Now, in order to match these exponentially decaying solutions with the core manifold described in §4.1, we must track the trajectories associated with (4.61) backwards through the 'transition' region r 0 ≤ r ≤ r 1 − 1 2. We therefore look to solve the initial value problem ). This leads to the following result., and a ∈ R (N +1) and Y ∈ R were introduced in Lemma 4.6. Proof. We begin by solving (4.62) for (r) and (r) explicitly, giving (r) = r 1 − 1 2 = such that the initial value problem (4.62) becomes where for all n ∈ . Then, integrating over r 0 ≤ r ≤ r 1 − 1 2, (4.66) becomes the integral equation, dp. (4.69) For sufficiently small values of, we can apply the contraction mapping principle to show that (4.69) has a unique solution (A T, B T ) in an appropriate small ball centred at the origin in C(, C 2(N +1) ); see, for example,. Furthermore, we can express the unique solution to (4.69), evaluated at r = r 0, as With the previous lemma we parametrised the far-field manifold W s + () at the matching point r = r 0. This now allows us to perform the asymptotic matching in order to find intersections of the core manifold W cu − () with W s + () for sufficiently small. This matching is covered in the following subsection. Matching Core and Far Field We begin by applying (4.39) to the core parametrisation (4.38), such that the core manifold W cu − () can be expressed as Let us briefly summarise the variables and parameters included in (4.73). We recall that the core parametrisation is determined by the linear coefficients d 1, d 2 ∈ R (N +1), defined in Lemma 4.1, and the fixed complex phase Y 0 ∈ R. Similarly, the far-field parametrisation is determined by the linear coefficient a ∈ R (N +1) and phase parameter Y ∈ R, both introduced in Lemma 4.6. The other parameters in (4.73) are the matching points r 1, r 0 > 0, the bifurcation parameter ∈ R, and the quadratic coefficient = 1 2 6 * 1, Q( 0, 0 ) ∈ R; r 1 and r 0 are introduced during the construction of the core and far-field manifolds, whereas and Q(u, u) are given by the equation (2.2). Finally, we also note that the nonlinear terms Q m N = (Q m 0,..., Q m N ), R A/B, and are defined in (4.21), (4.72), and Lemma 4.7, respectively. Let us introduce the following coordinate transformations such that the leading order terms of (4.73) scale with the same order in. Eliminating common leading factors leads to for all n ∈ . When r 0 1 and 0 <, r 1 1, the leading-order system is given by Then, taking real and imaginary parts, solutions to the leading order expression (4.77) are equivalently expressed as the zeros of the functional where It should be noted that taking the imaginary part of the first equation in (4.77) results in the vector equation sin( Y ) a = 0. However, for a = 0, this reduces to obtaining Y such that sin( Y ) = 0, which is captured by the final component of G, defined in (4.80). The following lemma characterises the roots of G by relating them to fixed points of Q m N. Solving this fixed point problem is the focus of Section 5 which follows, but for the remainder of this subsection we show that these fixed points lead to matched solutions of (4.2) that are defined for all r ≥ 0 and decay exponentially to 0 as r → ∞. Proof. From the definition (4.79), roots of G correspond to having G 1 = 0, G 2 = 0, G 3 = 0, and G 4 = 0, as they are given in (4.80). Then, we immediately find that solving G 4 = 0 gives that Y =, for any ∈ Z. Substituting Y = into G 3, we find that d 2 = 0 is the unique choice that solves G 3 = 0. Then, solving G 1 = 0 results in d 1 = (−1) a, and so G 2 = 0 implies where we have defined a = (−1) a *. Hence, after applying the transformation (4.78), we conclude that (4.81) is a zero of G as long as a * = (a 0,..., a N ) T is a fixed point of Q m N, completing the proof. In order to match solutions from the core manifold to the far-field manifold for small values of, r 1 and r −1 0, we require the Jacobian of G, denoted throughout by DG, to be invertible at the solution (4.81). This follows from the fact that the higher order (, r 1, r −1 0 ) in the matching equations (4.75) constitute a regular perturbation of G when these parameters are taken to be small. Hence, when the Jacobian DG is invertible at V *, we can evoke the implicit function theorem to solve (4.75) uniquely for all 0 <, r 1, r −1 0 1. Inverting the coordinate transformation (4.74), we find that where a * = {a * n } N n=0 is a fixed point of Q m N. Following our chain of arguments here, nondegenerate roots of G are used to solve the matching problem for 0 <, r 1, r −1 0 1, which in turn leads to localised D m solutions to the Galerkin system (2.6). This therefore allows us to determine the leading order profile of u n (r) for these localised solutions in each region of r. For the core region, we substitute (4.83) into (4.25) to see that for r ∈ . For the transition region r 0 ≤ r ≤ r 1 − 1 2, solutions of (4.62) take the form Finally, for the rescaling region r ≥ r 1 − 1 2, solutions remain close to the connecting orbit (4.58) for A R (s), B R (s) such that when r ≥ r 1 − 1 2. To recover the case when M 1 has a repeated eigenvalue of = −k 2 c, we invert the rescaling (4.1) and transform the arbitrary values r 0, r 1 accordingly. Then, for each n ∈ the radial amplitude u n (r) has the following profile: uniformly as → 0 +. Hence, a localised D m solution to the Galerkin system (2.6) has a core profile of the form Hence, it remains to (i) identify fixed points of Q m N to give zeros of G, and (ii) verify that these zeros are nondegenerate to arrive at the main results in Section 2. The following lemma shows that nondegenerate roots of G lie in one-to-one correspondence with fixed points of Q m N, a * ∈ R N +1, such that the matrix That is, a * is a nondegenerate fixed point of Q m N. As stated above, the focus of Section 5 is to determine such fixed points, while in this section we provide the sufficient conditions that imply the existence of localised D m patches to the Galerkin system (2.6). We therefore conclude this section with the following result. Proof. The Jacobian DG can be written as where 0 ∈ R (N +1), O N ∈ R (N +1)(N +1) denote the zero vector and square matrix, respectively, and subscripts on the differential D denote what variable the derivative is taken with respect to. Evaluating at the solution V *, defined in (4.81), we find that (4.93) (4.94) Hence, the proof is complete. Satisfying the Matching Condition In Section 4, and in particular §4.5, we showed that to prove the existence of localised D m patch in the N -truncated Galerkin system (2.6) we are required to identify isolated solutions of the matching problem a n = 2 To this end, our goal in this section is to identify nontrivial solutions of (5.1) which in turn provide the results from Section 2. We recall the notation of where we recall that 1 N is the identity matrix of size (N + 1) (N + 1) and DQ m N denotes the Jacobian matrix of the nonlinear function Q m N. In the following subsections we detail the existence and general properties of nondegenerate fixed points of Q m N. We begin in §5.1 with some important properties of the mapping Q m N that allow us to quotient the search for fixed points by important symmetries coming from the system (2.5). Then, in §5.2 we provide explicit solutions up to these symmetries for small-layer patches, which completes the proof of Theorem 2.2. We then provide a theoretical analysis which details the existence of solutions to the matching problem with N 1 in §5.3, which completes the proof of Theorem 2.3. All proofs of solutions for the small-layer patches are left to §B in the Appendix. Properties of the Matching Equations We begin by noting some qualitative properties of the Fourier-polar decomposition (2.5), and how these affect the matching problem (5.1). These properties are summarised in the following lemmas and can be used to classify solutions of the matching equations up to symmetry. Transforming a fixed point of Q m N into another one by applying R is a consequence of the fact that one may rotate a localised pattern of (2.6) by /m to obtain the same localised pattern with a different orientation. Indeed, using the Fourier-polar decomposition we see that U m (r, + /m) = u 0 (r) + 2 N n=1 u n (r) cos(mn + n) = u 0 (r) + 2 N n=1 (−1) n u n (r) cos(mn). for each ∈ , such that any a * that satisfies Q m0 N0 (a * ) = a * also satisfies Q m Proof. Take b * := H i N a * to be as defined in the statement of the lemma. Then, if is not a multiple of i, On the other hand, if = ni for some n = 0, 1,..., N, we have where we have used the fact that a * is a fixed point of Q m0 Ni. This concludes the proof. Proof. We begin by noting that with m ∈ N such that 6 | m, we have for all integers n and j. Then, taking b * to be as defined in the statement of the lemma, for = 1,..., N we have where we have used the fact that a * is assumed to be a fixed point of Q m N. Turning to the case when = 0, we similarly have where we have again used the fact that Q m 0 (a * ) = a * 0. Hence, we have shown that Q m N (b * ) = b *, proving the claim. The result of Lemma 5.3 is less intuitive than those of Lemmas 5.1 and 5.2. From Lemma 5.3 we see that if a * is a fixed point of Q 6m N, then b * := a 1 − a * is also a fixed point of Q 6m N, where a 1 = (1, 0,..., 0). The fixed point a 1 corresponds to a radial spot U 0 (r) and so Lemma 5.3 implies that, for any localised pattern U 6m (r, ) of (2.6), there exists a corresponding localised pattern of the form V 6m (r, ) = U 0 (r) − U 6m (r, ). Such solutions are analogous to dark solitons in nonlinear optics, where localised solutions appear as 'holes' on a nontrivial uniform background state. If we think of U 6m (r, ) as a perturbation from the trivial state, which we could call a 'bright' solution, then V 6m (r, ) can be thought of as an inverse perturbation from the localised radial spot, which we correspondingly call a 'dark' solution. Small-Layer Patches Here we will provide the nontrivial solutions of the matching equations (5.1), up to the symmetries described in the previous subsection, for small-layered patches. In particular, we will focus on the cases when N ≤ 4. We note that for any N, m ≥ 1 we have that a = 0 and a = (1, 0,... ) are solutions of Q m N (a) = a, representing solutions U m (r, ) = 0 and U m (r, ) = u 0 (r), which lead to the well-studied radially-symmetric solutions of the Galerkin system and are therefore deemed to be trivial solutions of the matching equations. With N ≤ 4 the matching equations are of a low enough dimension that we can obtain nontrivial solutions of (5.1) explicitly. These investigations further give us information on the role of the lattice m in finding localised D m patches and the goal is to provide all solutions that are unique to the given value of N. That is, Lemma 5.2 shows that solutions for N = 1 can be extended to solutions with N = 2, 3, 4 and solutions for N = 2 can be extended to solutions with N = 4; hence, we only detail the solutions for the smallest value of N that they appear for. Similarly, Lemma 5.1 demonstrates that solutions map into solutions by applying R, thus giving an equivalence class of solutions. The propositions that follow in this subsection will only provide one representative from each equivalence class. Finally, for the ease of notation, we will define C m := 2 cos m 3, which gives That is, if m is a multiple of 6 then C m = 2, if it is multiple of 3 and odd then C m = −2, if it is even and not a multiple of 3 then C m = −1, and if it is not divisible by 2 or 3 then C m = 1. We first present our results for N = 1, 2, 3 and m ∈ N. The proof of this result is left to §B. 1. If N = 1 we have Importantly, there are no nontrivial solutions when 2 m and 3 m. 2. If N = 2 we have where the j are real roots of the m-dependent polynomial Importantly, there are no nontrivial solutions when 2 m and 3 m. 3. If N = 3 and 3 | m, we have Furthermore, for all m ∈ N, we have and j are real roots of the m-dependent polynomial x 5 + 116x 4 − 217x 3 − 113x 2 + 24x + 9, 2 | m, 3 m,, and so on. Hence, Proposition 5.4 lists all solutions up to these equivalences to significantly condense the notation. We summarise our findings with the following proposition whose proof is left to §B and completes the proof of Theorem 2.2. Large N Layer Patches with 6 | m Let us now focus exclusively on the case 6 | m, representing solutions of the N -truncated Galerkin system (2.6) with a D 6d -symmetry, for some d ≥ 1. With 6 | m we have that cos(nm/3) = cos(2n) = 1 for every integer n, and so the matching equations become a n = 2 N −n j=1 a j a n+j + n j=0 a j a n−j, (5.17) for each n = 0, 1,..., N. In this section we will investigate solutions to (5.17) with N 1. To this end, this section will be dedicated to determining a continuous solution (t) to the integral equation 18) and using this solution to demonstrate the existence of solutions to (5.17) when N 1. Formally, one can see that upon defining a n = 1 N +1 ( n N +1 ) for each n = 0, 1,..., N, (5.17) takes the form which can be interpreted as a Riemann sum approximation of (5.18). In what follows we will make the correspondence between solutions of (5.18) and solutions of (5.17) with N 1 explicit. To begin, we will consider the closure of the space of real-valued step functions on, denoted X, with respect to the supremum norm ∞ := sup for each ∈ X. Since we are taking the closure, X is a Banach space, and the elements of the space X are referred to as regulated functions. Regulated functions can be characterised by the fact that each ∈ X and all t ∈ we have that the left and right limits (t − ) and (t + ) exist, aside from (0 − ) and (1 + ). We note that the space of continuous functions on, denoted C(), is a closed subspace of X. Then, the matching equation (5.18) can be compactly stated as the fixed point problem = Q ∞ (), where we define the nonlinear operator Q ∞ : X → X by for all ∈ X. Using the fact that elements of X are integrable, one finds that Q ∞ is well-defined, and Q ∞ maps the closed subspace C() back into itself. We present the following theorem. Proof. The existence of * ∈ X is achieved by a computer-assisted proof that follows the work of, with the details of the implementation left to Appendix C. The general idea is to identify the existence of a fixed point of Q ∞ () near a continuous piecewise linear approximation of the solution generated by solving (5.19) numerically. We use interval arithmetic to verify a number of bounds that give way to the fact that Q ∞ is contracting in a neighbourhood of our constructed approximate solution. With this, the Banach fixed point theorem thus gives that generating a sequence from any element in a neighbourhood of our approximate solution by continually applying Q ∞ converges to a locally unique fixed point, giving the existence of *. Now, since Q ∞ maps C() into C(), initiating the sequence with our continuous linear approximation of the solution gives that each successive iterate is again continuous. Since C() is a closed subspace of X, it follows that the locally unique fixed point is also continuous since initiating the sequence with our approximate solution would make it the limit in the ∞ norm of a sequence of continuous functions. The non-degeneracy of this fixed point is a consequence of the local uniqueness of the solution and is proven by following the arguments in . The proof of positivity comes from the fact that our constructed numerical approximation is positive and the fixed point is close to it, as proven in . This concludes the proof. Theorem 5.7 gives the existence of a fixed point * of Q ∞, which can equivalently be viewed as a root of the nonlinear function G() := − Q ∞ (). Furthermore, the Frchet derivative of G about *, denoted DG( * ) : X → X, is the bounded linear operator acting on f ∈ X by 22) for which Theorem 5.7 gives that this operator is invertible on X. Similarly, we introduce the functions a j a n−j, n = 0, 1,..., N. (5.23) That is, F N (a) = a − (N + 1)Q m N ((N + 1) −1 a), so that roots of F N are exactly solutions of (5.19). In the remainder of this section we will prove the following proposition, which details that the fixed point * of Q ∞ can be used to closely approximate roots of F N for sufficiently large N ≥ 1, which themselves lie in one-to-one correspondence with solutions of (5.17) after rescaling a → (N + 1) −1 a for each N ≥ 1. In the remainder of this section we will take all finite-dimensional vector norms to be the maximum norm, or ∞-norm, which returns the maximal element in absolute value of the vector in analogy with the norm on X. To emphasise the difference between finite-and infinite-dimensional vector norms, the norm on X will keep the ∞ subscript, while the norms on finite-dimensional spaces will not have a subscript. To prove Theorem 5.8 we will make use of the following lemma, which is a variant of the Newton-Kantorovich theorem, coming from. Lemma 5.9. If F : R d → R d is smooth and there are constants 0 < < 1 and > 0, a vector w 0 ∈ R d, and an invertible matrix A ∈ R dd so that then F has a unique root w * in B (w 0 ), and this root satisfies We now present the following lemmas which will then allow for the application of Lemma 5.9 to arrive at the proof of Theorem 5.8. Lemma 5. 10. Let a N be as in Theorem 5.8. Then, for any > 0, there exists N 1 ≥ 1 such that F N (a N ) < for all N ≥ N 1. Proof. First note that we can equivalently write F N in (5.23) as F N (a) n = a n − 2 N + 1 a 0 a n − 2 N + 1 N −n j=0 a j a n+j − 1 N + 1 n j=0 a j a n−j, (5.24) for each n = 0, 1,..., N, by simply adding and subtracting the j = 0 term from the first sum. Then, the summations in F N can be seen as left Riemann sums for the integrals in G. Since * (t) is continuous at all t ∈, it follows that * is bounded and uniformly continuous, thus giving that the error between the integrals and the Riemann sums in F N are bounded uniformly for t ∈. The rate of convergence depends only on the modulus of continuity of *, which is fixed and independent of N ≥ 1. Since G( * ) = 0, this means that the terms a j a n−j (5.25) can be made arbitrarily small, uniformly in n = 0, 1,..., N. Finally, the terms 2a 0 a n /(N + 1) that appear in (5.24) can be bounded by 2 * ∞ /(N + 1), which converges to 0 as N → ∞. Hence, the triangle inequality gives us that by taking N sufficiently large we can make F N (a N ) as small as we wish. This therefore proves the lemma. Lemma 5.11. Let a N be as in Theorem 5.8. Then, there exist C > 0 and N 2 ≥ 1 for which the Jacobian Proof. Let us start by showing that for N sufficiently large DF N (a N ) is invertible. We will assume the contrary to arrive at a contradiction. Hence, we may assume that there exists an infinite subsequence of as a nontrivial element of the kernel of DF N k (a N k ) with the property that v k ∞ := max |v n | = 1. We will show that this implies that DG( * ) is not invertible, which from Theorem 5.7 is a contradiction. We may consider the elements a N k, v k ∈ R N k as step functions in X which take the value * ( n N k +1 ) and v n+1, respectively, on the interval [ n N k +1, n+1 N k +1 ), for each n = 0,..., N k. By abuse of notation we will again denote these step functions as a N k, v k ∈ X for each k ≥ 1. By assumption we have that v k ∞ = 1 as an element in X as well. Furthermore, since the elements a N k and v k are constant on the N k intervals of length 1/(N k + 1) we have that the integrals in DG(a N k ) reduce to discrete sums so that for each t ∈ [ n N k +1, n+1 N k +1 ), using (5.24), we have for all n = 0, 1,..., N k and k ≥ 1. We note that the remaining term in the above equation comes from the j = 0 terms being added and subtracted from the first summation in the definition of each component of F N. Therefore, for each k ≥ 1 we have where we have used the fact that a N k (t) as a function in X takes the value * (n/(N k + 1)) for each 29) since N k → ∞ as k → ∞. We therefore have that the sequence {v k } ∞ k=1 ⊂ X is a Weyl sequence for the linear operator DG( * ), giving that DG( * ) is not invertible. This is a contradiction, thus proving that for N sufficiently large we have that DF N (a N ) is invertible. To show that the operator norm of DF N (a N ) −1 is uniformly bounded for sufficiently large N, we proceed with a nearly identical argument to that which was performed above to prove invertibility. That is, we may assume the contrary, thus giving way to a subsequence {DF N (a N )} ∞ k=1 for which there exists vectors v k ∈ R N k +1 with v k ∞ = 1 such that DF N (a N )v k → 0 as k → ∞. Arguing as above, we can find that DG(a N k )v k ∞ → 0 as k → ∞, after extending the elements a N k and v k to step functions in X. Indeed, following as in (5.27) we get The rightmost term DG(a N k )v k ∞ can be expanded as in (5.26), where it can again be shown that it converges to zero as k → ∞ by following as in (5.27) and replacing the condition that DF N (a N )v k = 0 with DF N (a N )v k → 0. Therefore, we again find that {v k } ∞ k=1 ⊂ X is a Weyl sequence for DG( * ), contradicting the result of Theorem 5.7 which details that DG( * ) is invertible. This contradictions means that we must have that the operator norm of DF N (a N ) −1 is uniformly bounded for sufficiently large N. This concludes the proof. We now use the preceding lemmas to prove Theorem 5.8. Proof of Theorem 5.8. To prove this result we will apply Lemma 5.9. Let us fix = 1 2. From the continuity of DF N (a) near a N, we may evoke Lemma 5.10 to take N sufficiently large to guarantee the existence of a fixed > 0 sufficiently small to guarantee that for all a ∈ B (a N ). This therefore satisfies condition to apply Lemma 5.9. Then, Lemma 5.11 gives that there exists a C > 0 so that DF N (a N ) −1 ≤ C for all N ≥ N 2, and so Since F N (a N ) → 0 as N → ∞, we may consider N sufficiently large to guarantee that thus satisfying condition from Lemma 5.9. Hence, we have satisfied the conditions to apply Lemma 5.9, and so for all sufficiently large N we find there exists a * N ∈ R N +1 such that F N (a * N ) = 0 and Finally, the non-degeneracy condition DF N (a * N ) is invertible is satisfied for sufficiently large N since these matrices can be made arbitrarily close to the uniformly invertible matrices DF N (a N ) by taking N large enough. This therefore concludes the proof. Conclusion In this paper, we have investigated a finite mode truncation of planar two-component RD systems in order to understand the existence of localised dihedral patches. In particular, we showed that through an application of radial normal form theory we could establish precise conditions that guarantee the existence of localised solutions to the reduced Galerkin system (2.6) in a neighbourhood of a Turing bifurcation. These conditions came in the form of a nonlinear algebraic condition, which we were able to solve by hand for small finite mode decompositions. This uncovered new (approximate) localised patterns that can be used to initialise numerical continuation schemes to trace their corresponding bifurcation curves in parameter space. We further demonstrated the existence of localised D 6m, m ∈ N, patches with N 1 that bifurcate off the trivial state at the Turing instability point. Let us now briefly describe what happens in the limit N → ∞ in our analysis. We find from our 'Core -Transition -Rescaling' approach that the core boundary r 0 must be chosen such that (mN ) 2 r 0 < − 1 2. Although we only provide the existence of a 0, r 0 > 0 in Theorems 2.2 and 2.3, we see from the above that our analysis requires that 0 → 0 + and r 0 → ∞ as N → ∞. This means that as N becomes large, the region of validity for our analysis shrinks, thus giving no insight into the existence of these patterns in the case of a full Fourier decomposition, i.e. N = ∞. However, our numerical results lead to the conjecture that for any > 0 taken sufficiently small we expect that true localised dihedral solutions to (2.2), coming from the limit N → ∞, exist and bifurcate from the Turing instability point. In order to establish this existence and persistence of the localised states found in the finite-mode truncation in full planar planar RD systems one could potentially apply similar computer-assisted proofs to that are initialised with our finite mode solutions. Extending these finite mode solutions to true solutions of RD systems is an important area of future work that we hope to report on in a follow-up investigation. Although we have focused on parameter values in a neighbourhood of a Turing instability, numerical investigations have revealed that localised dihedral patterns can further be found bifurcating from curves of localised solutions away from the Turing point. For example, Figure 15 localised D 2 and D 4 patches bifurcating from the spot A and localised hexagon curves. Such branch points manifest themselves as symmetry-breaking bifurcations from the main localised solution curves. It may be possible to characterise these bifurcations using techniques from symmetric bifurcation theory, but predicting where these symmetry-breaking bifurcations take place along the curves remains an open problem. Beyond just extending our approximate solutions to true solutions of RD PDEs, this work opens up several interesting future research directions. First, note that we have only investigated the simplest possible type of localised radial solutions in (2.6). We expect there to also exist the equivalent of radial spot B and radial ring solutions that have been established for the SHE. It would be interesting to see whether the existence of spot B or ring localised dihedral solutions reduces to satisfying a matching condition akin to (2.8). Second, the investigation of our spot A solutions could potentially be extended to fluid dynamic systems such as the ferrofluid problem, integral equations, and more general, multi-component reaction diffusion systems where a centre-manifold reduction will have to be first carried out. We emphasise that while we have shown that the matching condition (2.8) turns up in the wide class of RD systems satisfying our hypotheses, it may be possible to have other matching conditions for different systems. Finally, one could follow our ideas to examine the existence of localised structures in three spatial dimensions. In this case our Fourier decomposition would have to be changed to a spherical or cylindrical harmonic decomposition, which may provide insight into pattern formation in phase field crystal models. In summary, with this work we have opened the door to the investigation of existence and persistence of localised solutions beyond just those in one spatial dimension or those that are axisymmetric. Code availability Codes used to produce the results in this paper are available at: https://github.com/Dan-Hill95/Localised-Dihedral-Patterns. We now briefly describe our numerical procedure for finding localised D m solutions to the (N +1)-dimensional Galerkin system (2.6), given some fixed m, N ∈ N. Recall that all computations use the SHE (1.1) and so we precisely target our discussion this the Galerkin system derived from it. In order for the operator ∆ n to be well-defined in (2.7), the Galerkin system is also equipped with the following boundary conditions at r = 0 for each n ∈ . We discretise the radial variable r using finite difference methods and fix r * > 0 so that we define our radial domain to be 0 ≤ r ≤ r *. The result is a decomposition of the domain r ∈ into T mesh points {r i } T i=1. We introduce differentiation matrices D 1, D 2 using the central finite difference formula for first and second order differentiation, respectively. By defining the matrix R as we can express ∆ n as the finite-difference matrix D n, where Here the first rows of the matrices D 1, D 2, and R have been chosen such that (A.1) is satisfied. Then, defining v i : j = u i (r j ), the Galerkin SHE becomes G(V ; ) = 0, defined as for all n ∈ , where denotes the Hadamard, or element-wise, product and V = (v 0,..., v N ) ∈ R T (N +1). For computational speed, we do not evaluate (A.2) in this form; rather, we introduce the block matrices C 1, C 2 ∈ R T (N +1)T (N +1) defined as We also introduce a block exchange matrix J k ∈ R k(N +1)k(N +1), defined as so that we can express the nonlinear terms in (A.2) as where ⊗ denotes the Kronecker product of two matrices. We use MATLAB's Newton trust-region solver fsolve, starting with an initial guess of the form (3.2). If an initial guess (V, * ) converges to a localised solution for (A.2) with a trust-region accuracy of 10 −7, we then define (V 0, 0 ) = (V, * ) and use this output as initial data for our numerical continuation scheme. To numerically approximate the branch of solutions in parameter space that this initial data belongs to we employ secant continuation. See for details on the implementation of this continuation technique. The result is an approximation of a continuous branch of solutions ( u(r), ) which solves the Galerkin SHE for s ∈ R. This allows us to map out solution curves for localised solutions in -parameter space, resulting in the figures from Section 3.2. B Proof of Propositions 5.4 and 5.6 Let us begin by proving Proposition 5.4. Throughout we will fix m ∈ N and we recall that C m = 2 if 6 | m, C m = 1 if 2 m and 3 m, C m = −1 if 2 | m and 3 m, and C m = −2 if 2 m and 3 | m. We also note that we can use trigonometric identities to find that C 2m = (−1) m C m, which will be used frequently throughout the proof to simplify expressions. (B.2) First note that if a 1 = 0, we are left with only the first and third equations, which give We note that these solutions are guaranteed by the symmetries outlined in Lemma 5.2. Now, assuming that a 1 = 0, we can divide it off of the second equation in (B.2) to give Substituting this expression for a 0 into the third equation of (B.2) and rearranging gives Then, putting these expressions for a 0 and a 2 1 into the first equation of (B.2) and rearranging results in the quadratic equation involving only a 2 : The right hand side of the above expression is exactly the function p m defined in the statement of the proposition, and so the conclusion follows by solving for a 2 and back-substituting to find a 0 and a 1. Moreover, in the case that 2 m and 3 m the quadratic equation above reduces to a 2 2 = 0, which gives only the radial spot solution to the matching problem. For both the N = 1 and N = 2 cases, one can verify that each solution a * is nondegenerate by explicitly computing 1 N − DQ m N (a * ). For each non-trivial solution we find that det = 0, and hence we conclude that these solutions are isolated roots of the matching condition. We now turn to the case N = 3. The matching equation a = Q m 3 (a) are given by (B.7) We note that a 1 = 0 implies that either a 2 = 0 or a 3 = 0. Taking a 1 = a 3 = 0, we see that (B.7) reduces to the N = 1 problem for a 0, a 2 whose solution has already been found. Taking a 1 = a 2 = 0 instead gives that the remaining equations reduce to the N = 1 problem with m a multiple of 3. This situation was previously solved, and so we consider now the case a 1 = 0 by introducing the variable ∈ R, defined by We note that = 0 would imply that a 3 = 0, which in turn gives a 2 = 0. But, this would then imply that a 1 = 0, and since we are assuming a 1 = 0, we must have that at least one of a 2 and a 3 is non-zero, giving = 0. Substituting and into (B.7), we find that (B.9) We input (B.9) into Wolfram Alpha's GroebnerBasis function, which reduces our system to a set of ideal polynomials equipped with the same roots. Then, finding a solution to this reduced system yields a solution to (B.9), which in turn gives us a solution to (B.7) after we recover a 3 = C m a 1. In order to find explicit solutions, we consider each case of m separately. 6 | m: We begin with the case 6 | m, such that C m = 2 and (−1) m = 1. Then the associated Grbner basis can be written as Clearly, there exists a solution at a 0 = 1 2, which in turn implies a 2 1 = 1 10, = − 1 4, and a 2 = 0; this is described by the solution a 3 0 in Proposition 5.4 when 6 | m. Assuming that a 0 = 1 2, we can simplify (B.10) to the following, Similar to the case when 6 | m, we first note the existence of a solution of the form a 0 = − 1 2, a 2 1 = 3 10, = − 1 4, and a 2 = 0, which is again described by the solution a 3 0 in Proposition 5.4 when 2 m and 3 | m. Taking the case when a 0 = − 1 2, we can again simplify (B.12) to the following, which is exactly in the form of a 3 j in Proposition 5.4, when 2 m and 3 | m. 2 | m, 3 m: We now study the case when 2 | m and 3 m, such that C m = −1 and (−1) m = 1. Then the associated Grbner basis can be written as which is already in the form of a 3 j in Proposition 5.4, when 2 | m and 3 m. 2 m, 3 m: Finally we study the case when 2 m and 3 m, such that C m = 1 and (−1) m = −1. Then the associated Grbner basis can be written as Clearly, there is a repeated solution a 0 = 1 to the final equation of (B.15). This implies a 2 1 = 0, which contradicts our assumption that a 1 = 0, and so we set a 0 = 1 and simplify (B.15) to the following which is exactly in the form of a 3 j in Proposition 5.4, when 2 m and 3 m. We note that, although the final polynomial has two distinct solutions for a 0, only one solution results in a positive value for a 2 1 ; hence, there is only one real nontrivial solution to (B.7) in the case when 2 m and 3 m. C Computer-Assisted Proof Details of Theorem 5.7 In this section we describe the computer-assisted proof for Theorem 5. The proof follows the Newton-Kantorovich argument set out in which employs a numerically computed linear spline approximation to the continuous function on a equispaced mesh. The set up is as follows. We consider the function G : X → X, defined in Section 5.3, given by For w ∈ X, we denote M w by w M. Since M is a projection one can decompose X such that where S ∞ := (I − M )X. We note that since S M is finite-dimensional, the Hahn-Banach theorem gives S ∞ ⊂ X is also closed, and hence both S M and S ∞ are Banach spaces with M and ∞ continuous. A numerical approximation M ∈ S M of the zero of G(w) is found by Newton iteration of (5.19) and creating a spline interpolation of these values. We remark that our approximate solution M is positive, which leads to the fact that the unique fixed point in a neighbourhood of M is also positive. We further numerically compute the approximate inverse A M of the Jacobian DG M ( M ) of G M at the approximate zero M. Let us now define the ball B (r) = {w ∈ X : M w ∞ ≤ r and ∞ w ∞ ≤ r}, (C.7) where > 0 is fixed and r is treated as a parameter. The aim is the show that the map T : X → X given by is a contraction in M + B (r) such that T has a unique zero in M + B (r). Following the argument in, if T has a unique fixed point in M + B (r) then there must be a corresponding zero of G provided A M is injective. The following theorem states the hypotheses that we need to check numerically and was proved in. The Y and Z bounds and verification that the radii polynomials are all negative are carried out using interval arithmetic using IntLab so as to be rigorous. To carry out these operations in IntLab, we introduce the following interval arithmetic notation for the evaluation of a given function f (t). The notation E ± k (f ) is defined as and E ± (f ) is defined as ]. (C.12) Furthermore, we define the interval notation such that f (t k ) ∈ E k (f ) and f (t) ∈ E [t k,t k+1 for all t ∈ . It will also be useful to define the vector of intervals E(f ) such that (E(f )) k := E k (f ), for k = 0,..., M. In what follows we demonstrate how one computes the Y and Z bounds. All bounds follow a similar derivation to except the Z ∞ bound which is slightly different in our case since our mapping lacks some of the stronger differentiability properties to that studied in. For convenience in what follows, let us define the function g : Since M is a linear interpolant h 1 = h 2 ≡ 0, giving way to the proof of the lemma. Remark C. 3. We note that in the numerical calculation of Y ∞, we use the fact that such that the Y ∞ bound becomes order t. (C.32) Therefore, | k | ≤ V 1 k + V 2 k r (C. 33) where the V i k > 0 are given by (C.34) Notice that V 2 k is independent of all variables except > 0. We have written it as above for easy comparison with the bounds in. We summarise the above with the following lemma. (C.38) We will proceed by bounding each integral term in |(t k + ) − (t k )| individually. Remark C.6. Notice that the O(r 2 ) terms in the Z ∞ (r) definition can be made small by taking > 0 small. The linear terms in r scale with the step size t, hence meaning that the coefficients of Z ∞ (r) can be made small by taking the step size and small. In particular, the W 1 k bound can be made to be less than by taking t small enough so that the p ∞ (r) radii polynomial can be negative for some choice of r. We now conclude this section by briefly discussing the computational aspects of the proof. We are required to verify that the radii polynomials are all negative for a choice of r and. We first compute the numerical approximation M with M = 1000 in MATLAB using the Newton-trust routine fsolve. The remainder of the proof is carried out using IntLab to carry out the interval arithmetic calculations. We fix = 0.02 (though other values are also possible) and we find that for r ∈ the radii polynomials are all negative. The code for performing this verification can be found in the GitHub repository associated to this paper.
Q: How can 16 Psyche be the core of a protoplanet? The recent approval of a NASA mission to study the asteroid 16 Psyche brought to my attention that Psyche (about 200 km in diameter) is thought to be the exposed iron core left over from a protoplanet (theorized as being about 500 km in diameter). My question is: what is the mechanism by which a body of that size can accrete, differentiate as thoroughly as Psyche apparently did, and then completely lose its mantle? I have a basic understanding of planetary differentiation and I had the impression that the migration of iron and nickel to the core took a long time, and that by that time major impacts capable of shattering large bodies must have been rare. A: If this hypothesis is correct, the body from which 16 Psyche formed was a 500km planetesimal (about half the diameter of Ceres) It would have been destroyed in a collision with another body. The other body would have had to have been large enough (300km) to complete fragment the asteroid. The problem with this hypothesis is that no other pieces of this planetesimal have been found (they should still have similar orbits as Psyche). Another hypothesis is that Psyche suffered from a series of smaller impact, that fractured and disrupted the parent body, but did not destroy it. This would give Psyche a composition similar to the stony-iron mesosiderite meteorites. The Psyche mission is intended to answer these questions.
Drug-dealing gangsters who brazenly sold crack and heroin have been jailed. The 17-strong gang, including four males from Sutton, dealt drugs in a Merton estate but have now been jailed for a total of over 33 years after an 18 month police operation. The dealers would make up to £1,000 per day selling crack cocaine and heroin around the Phipps Bridge Estate in Mitcham - including from a base in a children's play area. Acting on intelligence from the community, police began their operation to bust the gang in February last year. They swooped on their suspects in a series of raids in May last year and recovered guns hidden in socks, drugs, cash which turned out to have been stolen in a robbery, a knife and ammunition. Of those arrested, 16 men have now been jailed after a series of trials and court hearings and one man faces jail when he is sentenced later this month. Among them are Daniel Nwaogwugwu, 23, of Sutton High Street, who was jailed for 42 months after pleading guilty to conspiracy to supply class A drugs and Wesley Doh, 19, of Collingwood Road, who was jailed for 30 months in a young offenders' institute after pleading guilty to conspiracy to supply class A drugs. Both were sentenced at Kingston Crown Court on Thursday, June 6. Two 17-year-olds, both from Sutton who cannot be named for legal reasons, who were given eight month referral orders for supplying class A drugs. Detective Chief Inspector Lee Hill said: "This has been an intensive and protracted investigation and I would like to thank everyone involved, in particular Detective Constable Paul Allen, for his tenacity and diligence in bringing these offenders to justice. "The sentences imposed by the court reflect the seriousness of the criminality involved and should act as deterrent to others. "The London Crime Squad is committed to tackling crimes of this nature and improving the quality of life amongst our communities."
// ListenSSH creates an SSH server and a listener if not already // created, but does not handle connections. This returns immediately, // unlike StartSSH(), and the server URL is available with // SSHAddress() after calling this. func (s *GitServer) ListenSSH() error { if s.sshServer == nil { s.sshServer = gitkit.NewSSH(s.config) s.sshServer.PublicKeyLookupFunc = func(content string) (*gitkit.PublicKey, error) { return &gitkit.PublicKey{Id: "test-user"}, nil } return s.sshServer.Listen("127.0.0.1:0") } return nil }
He's a 42-year-old freshman senator, but when asked by Jonathan Karl on "This Week" if he's ready to be president, Republican Sen. Marco Rubio of Florida answered without hesitation. "I do … but I think that's true for multiple other people that would want to run … I mean, I'll be 43 this month, but the other thing that perhaps people don't realize, I've served now in public office for the better part of 14 years," said Rubio. "Most importantly, I think a president has to have a clear vision of where the country needs to go and clear ideas about how to get it there and I think we're very blessed in our party to have a number of people that fit that criteria." When asked if he was qualified to run, Rubio reiterated that the Republican Party has several qualified candidates. "The question is what - whose vision is the one that our party wants to follow?" he said. Rubio - who spoke to Karl on Friday in New Hampshire - said that if he decides to seek the presidency, he would not simultaneously seek re-election as a senator for the Sunshine State. "I believe that if you want to be president of the United States, you run for president," he said. "You don't run for president with some eject button in the cockpit that allows you to go on an exit ramp if it doesn't work out." The Florida senator - who was once considered a 2016 Republican front runner - has seen his star fade in recent days, according to at least one recent New Hampshire poll. But Rubio seems to take it in stride, telling ABC News that polls are not something he pays a great deal of attention to, even joking that he has been jinxed after gracing the cover of TIME magazine. "It's probably the 'TIME' cover jinx, just like the 'Sports Illustrated' jinx," he said. "If you decide to run for president, there's going to be a campaign and in that campaign, you're going to interact with voters and you're going to explain to them where you stand and - and those numbers can change one way or the other." Sen. Marco Rubio Gives Hillary Clinton an "F" as Secretary of State During the interview with Karl, Rubio took aim at former Secretary of State Hillary Clinton, who is seen by many as the strongest Democratic candidate for president in 2016. Rubio said he was sure Clinton would highlight her time at the State Department as a positive should she seek the White House, but he offered a much more negative view of her tenure at Foggy Bottom. "I'm sure she's going to go out bragging about her time in the State Department. She's also going to have to be held accountable for its failures, whether it's the failed reset with Russia or the failure in Benghazi that actually cost lives," he said. Rubio said he didn't think Clinton deserved a passing grade for her time at the State Department, saying he thought she earned an "F." "If you look at the diplomacy that was pursued in her time in the State Department, it has failed everywhere in the world," Rubio said. "If she is going to run on her record as secretary of state, she's also going to have to answer for its massive failures," Sen. Marco Rubio Expresses Skepticism Over Ability to Reverse Changing Climate Rubio - who expressed deep skepticism about whether man-made activity has played a role in the Earth's changing climate - told Karl he doesn't believe there is action that could be taken right now that would have an impact on what's occurring with our climate. "I do not believe that human activity is causing these dramatic changes to our climate the way these scientists are portraying it … and I do not believe that the laws that they propose we pass will do anything about it, except it will destroy our economy," he said. Rubio said he didn't know of an era when the climate was stable. "The fact is that these events that we're talking about are impacting us, because we built very expensive structures in Florida and other parts of the country near areas that are prone to hurricanes. We've had hurricanes in Florida forever. and the question is, what do we do about the fact that we have built expensive structures, real estate and population centers, near those vulnerable areas?" he asked. "I have no problem with taking mitigation activity." EDITOR'S NOTE: We've added a portion of the full transcript that covers Jon Karl's conversation with Sen. Rubio below about climate change. KARL: The White House came out with a big new report on climate change and listed Florida as being right, you know, saying that - that Florida is right at the center of this, that, in fact, Miami, Tampa are two of the cities that are most threatened by climate change. So putting aside your disagreement with what to do about it, do you agree with the science on this? I mean how big… RUBIO: Well… KARL: - a threat is climate change? RUBIO: Yeah, I - I don't agree with the notion that some are putting out there, including scientists, that somehow, there are actions we can take today that would actually have an impact on what's happening in our climate. Our climate is always changing. And what they have chosen to do is take a handful of decades of research and - and say that this is now evidence of a longer-term trend that's directly and almost solely attributable to manmade activity… KARL: You don't buy… RUBIO: I do not agree with that. KARL: - you don't buy the science on this? You don't think that human activity has caused the climate changes to somehow… RUBIO: I think climate is always… KARL: - or is the primary… RUBIO: Well, I don't know of any era in world history where the climate has been stable. Climate is always evolving and natural disaster have always existed. But I do believe that the fact is, that these events that we're talking about are impacting us, because we've built very expensive structures in Florida and other parts of the country near areas that are prone to hurricanes. We've had hurricanes in Florida forever. And the - the question is, what do we do about the fact that we have built expensive structures, real estate and population centers, near those vulnerable areas? I have no problem with taking mitigation activity. What I have a problem with is these changes to our law that somehow politicians say are going to change our weather. That's absurd. RUBIO: - to say you are going to pass a bill that's going to change the weather is a lie and you're going to devastate our economy. KARL: But - but let me get this straight. You do not think that human activity, the production of CO2, has caused warming to our planet? RUBIO: I do not believe that human activity is causing these dramatic changes to our climate the way these scientists are portraying it. That's what I do not. And I do not believe that the laws that they propose we pass will do anything about it, except it will destroy our economy.
LinkedIn just announced that it'll be shutting down Intro, a service meant to integrate LinkedIn contact details right into the iOS Mail app, after less than four months. LinkedIn simply said it was discontinuing the service in an effort to "focus on the most relevant offerings for our members." While the company didn't come right out and say it, though, it's safe to assume Intro never found a significant following — probably due to security concerns rising from the fact that LinkedIn had to scan every email that came into your inbox. In the days immediately following LinkedIn Intro's launch, security researchers reacted quickly and negatively. Security firm Bishop Fox called the service "a dream for attackers" and Richard Bejtlich, a researcher at Mandiant, echoed that sentiment. "I don't think people who use this are seriously thinking about the implication of LinkedIn seeing and changing their email," Bejtlich told The New York Times following Intro's October launch. "It just completely breaks the idea that email traffic is going where it should go and no place else." While LinkedIn quickly responded to those concerns and said the service had "the most secure implementation we believed possible," it looks like the stigma of a potential attack was enough to shy consumers away from the service. If your'e one of those who used LinkedIn Intro, the service will work until March 7th, at which point it'll be shut off completely. LinkedIn notes in an email sent to Intro users that you'll need to go through steps to disable Intro or else your email accounts won't work normally after the shutdown date.
/** * Test cases for FacsimileTelephoneNumberSyntaxChecker. * * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a> */ @Execution(ExecutionMode.CONCURRENT) public class FacsimileTelephoneNumberSyntaxCheckerTest { FacsimileTelephoneNumberSyntaxChecker checker = FacsimileTelephoneNumberSyntaxChecker.INSTANCE; @Test public void testNullString() { assertFalse( checker.isValidSyntax( null ) ); } @Test public void testEmptyString() { assertFalse( checker.isValidSyntax( "" ) ); } @Test public void testOneCharString() { assertFalse( checker.isValidSyntax( "A" ) ); assertFalse( checker.isValidSyntax( "+" ) ); } @Test public void testWrongCase() { assertFalse( checker.isValidSyntax( "123 456 f" ) ); assertFalse( checker.isValidSyntax( "+ ()" ) ); assertFalse( checker.isValidSyntax( " +2 (123) 456-789 +" ) ); } @Test public void testCorrectTelephoneNumber() { assertTrue( checker.isValidSyntax( "1" ) ); assertTrue( checker.isValidSyntax( "1111" ) ); assertTrue( checker.isValidSyntax( "1 (2) 3" ) ); assertTrue( checker.isValidSyntax( "+ 123 ( 456 )7891 12345" ) ); assertTrue( checker.isValidSyntax( " 12 34 56 78 90 " ) ); } @Test public void testWithNewMandatoryRegexp() { // Adding french telephone number regexp checker = FacsimileTelephoneNumberSyntaxChecker.builder(). setDefaultRegexp( " *0[1-8](( *|[-/.]{1})\\d\\d){4} *" ).build(); assertFalse( checker.isValidSyntax( "+ 123 ( 456 )7891 12345" ) ); assertTrue( checker.isValidSyntax( " 01 02 03 04 05 " ) ); assertTrue( checker.isValidSyntax( " 0102 03 04 05 " ) ); assertTrue( checker.isValidSyntax( " 01 02 03 04 05 " ) ); assertTrue( checker.isValidSyntax( " 01/02/03/04/05 " ) ); assertFalse( checker.isValidSyntax( " 01 / 02 .03 04-- 05 " ) ); } @Test public void testBuilderSetsDefaultPattern() { checker = FacsimileTelephoneNumberSyntaxChecker.builder().build(); assertTrue( checker.isValidSyntax( "1" ) ); } @Test public void testCorrectTelephoneNumberAndFaxParam() { assertTrue( checker.isValidSyntax( "+ 33 1 (456) 7891 12345$twoDimensional" ) ); assertTrue( checker.isValidSyntax( "+ 33 1 (456) 7891 12345$fineResolution" ) ); assertTrue( checker.isValidSyntax( "+ 33 1 (456) 7891 12345$unlimitedLength" ) ); assertTrue( checker.isValidSyntax( "+ 33 1 (456) 7891 12345$b4Length" ) ); assertTrue( checker.isValidSyntax( "+ 33 1 (456) 7891 12345$a3Width" ) ); assertTrue( checker.isValidSyntax( "+ 33 1 (456) 7891 12345$b4Width" ) ); assertTrue( checker.isValidSyntax( "+ 33 1 (456) 7891 12345$twoDimensional" ) ); assertTrue( checker.isValidSyntax( "+ 33 1 (456) 7891 12345$uncompressed" ) ); } @Test public void testCorrectTelephoneNumberAndFaxParams() { assertTrue( checker.isValidSyntax( "+ 33 1 (456) 7891 12345$twoDimensional$fineResolution$a3Width" ) ); } @Test public void testCorrectTelephoneNumberBadFaxParams() { assertFalse( checker.isValidSyntax( "+ 33 1 (456) 7891 12345$" ) ); assertFalse( checker.isValidSyntax( "+ 33 1 (456) 7891 12345$$" ) ); assertFalse( checker.isValidSyntax( "+ 33 1 (456) 7891 12345$twoDimensionnal" ) ); assertFalse( checker.isValidSyntax( "+ 33 1 (456) 7891 12345$ twoDimensional" ) ); assertFalse( checker.isValidSyntax( "+ 33 1 (456) 7891 12345$twoDimensional$" ) ); assertFalse( checker.isValidSyntax( "+ 33 1 (456) 7891 12345$twoDimensional$twoDimensional" ) ); assertFalse( checker.isValidSyntax( "+ 33 1 (456) 7891 12345$b4Width$ $a3Width" ) ); } }
package june; import org.junit.Test; import java.util.Arrays; import java.util.Comparator; public class HIndex { public int hIndex(int[] citations) { Arrays.sort(citations); int res = 0; for (int i = citations.length-1; i >= 0; i--) { if ((citations.length - i) >= citations[i]) { res = Math.max(res, citations[i]); } else { res = Math.max(res, citations.length - i); } } return res; } @Test public void test() { int[] citations = {1,3,4,52,52,1,6}; int res = hIndex(citations); System.out.println(res); } }
// Boost.Signals2 library // Copyright Frank Mori Hess 2007-2009. // Copyright Timmo Stange 2007. // Copyright Douglas Gregor 2001-2004. Use, modification and // distribution is subject to the Boost Software License, Version // 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // For more information, see http://www.boost.org #ifndef BOOST_SIGNALS2_PREPROCESSED_ARG_TYPE_HPP #define BOOST_SIGNALS2_PREPROCESSED_ARG_TYPE_HPP #include <boost/preprocessor/repetition.hpp> #include <boost/signals2/detail/signals_common_macros.hpp> #define BOOST_PP_ITERATION_LIMITS (0, BOOST_PP_INC(BOOST_SIGNALS2_MAX_ARGS)) #define BOOST_PP_FILENAME_1 <boost/signals2/detail/preprocessed_arg_type_template.hpp> #include BOOST_PP_ITERATE() namespace boost { namespace signals2 { namespace detail { struct std_functional_base {}; } // namespace detail } // namespace signals2 } // namespace boost #endif // BOOST_SIGNALS2_PREPROCESSED_ARG_TYPE_HPP
<filename>utest/utest_Localisation.py<gh_stars>0 #!/usr/bin/env python # Written by: DGC # python imports import sys import os import shutil import unittest # local imports import test_utils sys.path.append("..") from Localisation import * #============================================================================== def temp_data(name): """ Copies the Languages.pickle file so writing doesn't affect the original. """ original = test_utils.data_dir() + "/Languages/Languages.pickle" shutil.copyfile(original, name) return name #============================================================================== class utest_Localisation(unittest.TestCase): #========================================================================== class Listener(object): def __init__(self): self.notified = False def language_changed(self, language): self.notified = True def test_language(self): localiser = Localiser( test_utils.data_dir() + "/Languages/Languages.pickle" ) self.assertEqual(localiser.language(), "en_GB") self.assertEqual( localiser.options["available_languages"], ["en_GB", "de_DE", "en_AU", "en_US", "fr_FR"] ) def test_notify(self): localiser = Localiser( test_utils.data_dir() + "/Languages/Languages.pickle" ) listener = self.Listener() localiser.listeners.append(listener) localiser.notify() self.assertTrue(listener.notified) def test_set_language(self): temp_file = temp_data("test_set_language.pickle") localiser = Localiser(temp_file) self.assertNotEqual(localiser.language(), "en_US") localiser.set_language("en_US") self.assertEqual(localiser.language(), "en_US") listener = self.Listener() localiser.listeners.append(listener) self.assertFalse(listener.notified) localiser.set_language("en_US") self.assertTrue(listener.notified) self.assertRaises(KeyError, localiser.set_language, "foo") os.remove(temp_file) def test_persistence(self): temp_file = temp_data("test_persistence.pickle") localiser_1 = Localiser(temp_file) self.assertEqual(localiser_1.language(), "en_GB") localiser_1.set_language("fr_FR") localiser_2 = Localiser(temp_file) self.assertEqual(localiser_2.language(), "fr_FR") os.remove(temp_file) #============================================================================== if (__name__ == "__main__"): unittest.main(verbosity=2)
""" Lab 2 """ #3.1 my_name = 'Tom' print(my_name.upper()) #3.2 my_id = 123 print(my_id) #3.3 my_id = your_id = 123 print(my_id) print(your_id) #3.4 my_id_str = '123' print(my_id_str) #3.5 #print(my_name + my_id) #3.6 print(my_name + my_id_str) #3.7 print(my_name *3) #3.8 print("hello, world. This is my first python string.".split('.')) #3.9 message = "Tom's id is 123" print(message) #4 git add --all
This disclosure relates generally to the management of power consumption and performance of integrated circuits and systems employing such integrated circuits. As integrated circuits become more compact and the number of electrical components within integrated circuits increases, managing the power consumed by an integrated circuit becomes a critical operation. Power management is especially important for devices such as mobile telephones, personal music players, laptops, and tablet computer systems that rely on battery power. By managing the power consumed by the integrated circuits in these devices, thermal issues and battery life can be extended. Frequency scaling, a method in which the operating frequency of a processor is dynamically adjusted, is a known method for managing the power consumed by a processor. While a decrease in the operating frequency of a processor reduces power consumption, it also results in a corresponding decrease in the number of instructions that can be executed by the processor in a given time period, reducing the user's perceived performance. It is therefore desirable to evaluate the operating parameters of a processor in order to determine an optimal operating frequency that balances power management and processor performance.
Emergent Runaway into an Avoidance Area in a Swarm of Soldier Crabs Emergent behavior that arises from a mass effect is one of the most striking aspects of collective animal groups. Investigating such behavior would be important in order to understand how individuals interact with their neighbors. Although there are many experiments that have used collective animals to investigate social learning or conflict between individuals and society such as that between a fish and a school, reports on mass effects are rare. In this study, we show that a swarm of soldier crabs could spontaneously enter a water pool, which are usually avoided, by forming densely populated part of a swarm at the edge of the water pool. Moreover, we show that the observed behavior can be explained by the model of collective behavior based on inherent noise that is individuals different velocities in a directed group. Our results suggest that inherent noise, which is widely seen in collective animals, can contribute to formation and/or maintenance of a swarm and that the dense swarm can enter the pool by means of enhanced inherent noise. Introduction Emergent behavior that brings about a mass effect is one of the most striking aspects of collective animal groups. In recent years, developments in image analysis have made it possible to obtain kinetic data on the movements of real organisms and to compare that data with simulation models. In contrast, there are few comparisons between these models and data obtained using behavioral experiments. Rather, many behavioral experiments that have used animal groups were conducted in the context of social learning and/or the opposed relationship between an individual and society, such as that between a fish and a school. Investigating such a behavior, however, must help to find new mechanisms underlying interactions between individuals. Berdahl and colleagues used schooling fish, taking advantage of the avoidance of light areas (or preference for darker area such as the habitat under the lee of a rock) as one approach to the problem of linking experimental behavior results to modeled behavior. In this experiment, a temporally changing light field that controlled the mean light level was projected onto a tank in which the fish were swimming. They found that if the size of the school became larger, the level of performance in a dark area increased. In short, collective sensing against light areas was enhanced in larger schools. Moreover, by comparing this with the model, they concluded that this situation arose from the rule of attraction that has been proposed in some theoretical models such as BOIDS and the zone-based model by which an agent approaches neighbors if they are separated from each other. This raises the question of cases of spontaneously invading an avoidance area, which are frequently found in biology. In this case, it would be expected that a different rule from the attractive explanation is required. In this study, we conducted an experiment with respect to invading avoidance areas using a swarm of soldier crabs, Mictyris guinotae, which live in the tideland and can form large swarms. Through numerous field surveys of soldier crabs, we found the following observations to be characteristic of soldier crab general swarming behavior: (i) A swarm moving in the tideland has inherent noise. In other words, crabs have different velocities in maintaining a directed swarm, which reveals the local turbulent flow in a swarm. (ii) When a swarm faces a pool that has been naturally generated on a tideland, it does not enter this avoidance area if the swarm is small or sparse. In contrast, if the swarm becomes bigger and forms a dense region, this part of the swarm rushes into the pool without pausing. In other words, turbulent motion results in part of the swarm becoming highly concentrated, and this part enters and crosses the water due to the effect of the group. (iii) Individuals in other parts of the swarm follow their predecessors. Based on these observations, in particular observation (ii), we designed an experiment for the water crossing behavior of soldier crabs, M. guinotae. To investigate the behavior, we created an apparatus with a water pool sandwiched between two shore areas under semi-natural conditions and made comparisons between small (5 individuals) and large (15 individuals) swarms with respect to the performance of water crossing behavior. Then, we estimated whether the performance changed depending on the size of the swarm concentrated at the edge of the water pool. Finally we compared the experimental results with a swarm model based on inherent noise that was proposed in our previous study. Soldier Crabs Mictyris guinotae We studied M. guinotae living in Funaura Bay on Iriomote Island, Okinawa Prefecture, Japan. Soldier crabs, whose carapace sizes are approximately 15 mm, are among the few crabs adapted to walking forwards, rather than sideways. Although they burrow tunnels and live under substrate at higher tidal levels, they emerge and feed on detritus on the lagoon surface in swarms at the lower tidal level. During the breeding season (from December to March), their behavior differs depending on mating. To avoid these effects, our experiment was conducted in the daytime during the 4 hours around ebb tide on fine weather days in October 2013. Crabs were collected in plastic containers that contained mud substrate and were separated into each swarm size in the 5 minutes before each trial. For each trial different swarm composed of different crabs were used without pre-training, with a total of nine hundred crabs used throughout the experiment. Crabs were immediately released after the experiment. No specific permits were required for the described field studies and the locations are not privately-owned or protected in any way. M. guinotae is not endangered or protected species. Experimental Setup A simple apparatus was constructed on the tideland (figure 1). We formed a rectangle by inserting plastic plates vertically, 100 mm deep into a flat area on the tideland (3006900 mm, 100 mm height). To make a pool (3006300 mm, 15 mm depth) sandwiched between two shore areas, we dug out the central part of the tideland surrounded by the plates and covered the rectangular area with a vinyl sheet onto which some mud was added. The pool was then filled with water obtained from a naturally generated pool. The vinyl sheet was used to inhibit crabs from burrowing tunnels and to keep the water in the pool. The crabs did not burrow tunnels during any trials and the water level changed little. Before each trial, we leveled the shore areas and resupplied water to the pool to maintain conditions. Each swarm was gently thrown onto one side of the shore area apparatus, and swarm behavior was recorded for three minutes with a video camera (Panasonic HDC-TM700, 192061080 pixels). We used image-processing software (ImageJ; Rasband, W.S., National Institutes of Health, Bethesda, Maryland, USA) to calculate inter-individual distances (at 3 seconds intervals). We obtained x-y coordinates for each crab as a single pixel whose side length was 0.56 mm. Swarm Model Here we describe our swarm model in detail. We present a rough idea of the model in the results section. Firstly, we describe basic behavior of the model. Our swarm model consists of N individuals moving in discrete time and in a discrete S|S space where S~f1,2, :::,s MAX g. The location of the k-th individual at the t-th step is given by where x [ S,y [ S,k [ K~f1,2, :::,Ng, and the boundary condition is given as wrapped fashion. Each k-th individual at the t-th step has P number of potential vectors v(k,t; i) with i [ I~f0,1, :::,P{1g. If i~0, the vector v(k,t; 0), called the principal vector, is represented by the angle h k,t, such that v(k,t; 0)~(Int(Lcosh k,t ),Int(Lsinh k,t )), 2 where for any real number x, Int(x) represents integer X such that X vxvX z1. L is the length of principal vector. Because of the wrapped fashioned boundary condition, X [ S. If i=0, the vector is defined using a random value, g, selected with equal probability from and a random value (radian), j, selected with equal probability from , as v(k,t; i)~(Int(Lgcos(h k,t zj)),Int(Lgsin(h k,t zj))): The principal vector v(k,t; 0) is a special case where g~1:0 and j~0:0. For each v(k,t; i), the target of the vector is represented by To implement mutual anticipation, we define the popularity of the targets of the vectors. The popularity is defined for each site at the t-th step, ( Before updating the location, for any (x, y) at the t-th step, we set v(x,y; t)~0: Updating the location of individuals is asynchronously executed. The order of updating is randomly determined independent of the number of individuals, k. If there exists i [ I such that the next site for the k-th individual is defined by where s satisfies the condition such that for any i [ I, In other words, an individual moves to the target of its own potential vector that has maximum popularity. If there multiple sites satisfy condition, one of them is chosen randomly. Because updating is asynchronous, a set of sites updated by equation is gradually grows. A set of updated sites is represented by U N~f (x,y)[S|SjP(k,tz1)~(x,y)g: An individual that satisfies condition and moves by equation is called a wanderer. The vacated site generated by a moving After all wanderers have been updated, an individual which does not satisfy condition moves to the vacated site in followerneighborhood, N f, by where RdJ represents an element randomly chosen from set J. An individual whose movement is determined by equation is called a follower. If an individual is neither wanderer nor a follower, it moves by where K' is an index set of individuals that are not updated. Finally, principal vectors are locally matched with each other in the neighborhood through velocity matching, M. This matching operation is expressed as The bracket with M represents the average velocity direction in the neighborhood, M. The parameters in our model are listed below. L: the length of principal vector P: number of potential vectors a: angle derived from the principal vector R f : radii of the follower-neighborhood R M : radii of the neighborhood of velocity matching Secondly, we define water crossing behavior in our model In the simulation introducing the pool, we define a specific area U p (S|S in which the condition that allows mutual anticipation (equation ) is replaced by In the simulation, we set at c~2. Hence, it is more difficult for individuals to go through the area U p, which mimics a water pool that an individual soldier crab does not enter. Only by introducing the specific area U p, can we simulate the water crossing behavior. Finally, we show tendency to walk along a wall in our model. We first define the wall state for any lattice (x, y) such that In the simulation of water crossing behavior, an agent can be located only at a site where w(x,y)~0. The angle of tangential direction is defined for each wall state site (x, y) and is represented by h w (x, y). The tendency of walking along a wall is defined by b~Rdfh w (x,y)jd(P(k,t),(x,y))d(P(k,t),(u,v)), where d((p, q), (x, y)) represents the metric distance between two sites (p, q) and (x, y), and N W represents the neighborhood of wallmonitoring for each agent with a radii R w~2. If an agent is close to the wall with respect to N W, the agent's velocity, h k,t is parallel to the tangential direction of the wall. After this operation, velocity matching (equation ) is applied to all agents. Only from and can agents close to the wall walk along the wall. Experimental Results To investigate whether the water crossing behavior was caused by mass effect, we compared small swarms (5 individuals) with large swarms (15 individuals) with respect to the performance of water crossing behavior. Each trial was conducted for three minutes and a total of 40 trials were performed for each swarm size. For each trial, the success rate Q was defined by the number of individuals that completely walked across the water pool, normalized by the total number of individuals. The success rate Q was zero if no crabs completely walked across the pool, while it was one if all of the crabs finished crossing to the opposite shore. According to field observations of naturally generated water crossing behavior, there were some crabs left in the water pool, so not all individuals composing the swarm finished crossing to the other shore. Hence, we defined a success trial by Q.0.5, a failure by Q#0.5, and the performance of water crossing behavior by the number of success trials normalized by the total number of trials. Figure 2 shows the performance of water crossing behavior and the frequency of successful and unsuccessful trials. The performance differed significantly between small and large swarms (performance: 30/40 (large swarm) vs. 10/40 (small swarm), Fisher exact test: P,0.001). The number of failed trials performed by small swarms was significantly larger than the number of successful trials (failure trial: 30 out of 40 swarms, binomial test: P,0.01). The number of successful trials performed by large swarms was significantly larger than the number of failures (success trial: 30 out of 40 swarms, binomial test: P,0.01). These results indicate that while small swarms avoid entering the water, large swarms cross over the water pool. This can be interpreted as emergent behavior caused by a mass effect. Detailed results of the above analysis that show the success rate Q and NI of each trial are provided in Table 1. NI indicates the number of individuals that eventually crossed the pool during a trial. Between small and large swarms, we found a significant difference in the number of trials in which no crab crossed the river (0/40 (large swarm) vs. 14/40 (small swarm), Fisher exact test: P,0.001). This result shows that small swarms avoid the water. There is, however, no significant difference in the number of trials in which all crabs finish crossing to the opposite shore (7/ 40 (large swarm) vs. 2/40 (small swarm), Fisher exact test: P.0.05, NS), which means that crabs composing the swarm do not always finish crossing, independent of swarm size, as seen in natural conditions. To estimate the contribution of the density effect on the water crossing behavior in detail, we investigated whether the performance depended on the size of the swarm concentrated at the edge of the water pool. First, to equalize the conditions when the swarm entered the water, we defined the initial condition such that there was no crab in either the pool or on the opposite shore area at a certain time step and that in the next time step a crab entered the pool. Note that we only used crab positional data at each of the time steps, which were separated by three seconds intervals, and ignored crab behavior between time steps. Second, to calculate the size of the swarm concentrated at the edge of the pool, we defined the swarm network as a swarm that consisted of individuals within 50 mm of another individual; such individuals were connected to each other as the nodes of the network. We calculated the size of the swarm network that a crab entering into the pool belonged to and checked the performance for each swarm network. As long as it satisfied the initial condition, we continued to check the performance for each swarm network until each trial finished. In this analysis, we defined a failure trial as a trial in which all individuals comprising a network did not finish crossing the pool and a successful trial as a trial in which at least one individual within the network completely walked across the water pool. The performance of water crossing behavior was defined as the number of successful trials normalized to the total number of trials. Figure 3A and B show the performance of water crossing behavior and frequency of success as well as the failure of small and large swarms, respectively. It is easy to see that the smaller network size was (in particular when the network size was one), the smaller the performance was for both small and large swarms. When the network size was more than six, every swarm successfully crossed the water. When we compiled the data sets for both large swarms and small swarms, we found significant differences in the performance between solitary crabs (i.e., network size is one) and swarms with network sizes that were greater than two (performance; 53/76 (swarm) vs. 22/70 (solitary crab), Chisquare test: x 2 1 = 19.900, P,0.001) ( figure 3C). Figure 4 shows typical snapshots of the water crossing behaviors with some trajectories. Each crab is represented by a different color. Trajectories are composed of small squares representing each crab's location and dashed lines that connect the locations at one time with those at the next time. The number next to each square represents the order of time, with a time interval of three seconds. The blue vertical line in figure 4A, B represents the border between the shore area and the pool area. Figure 4A provides examples of successful water crossings. It shows the effect of gathering at the edge of pool; once a swarm composed of six crabs entered into the pool, it crossed over the pool without stopping. Figure 4B provides an example of failure of the behavior. Although the crab entered the pool at least once, it hesitated in the water and left the pool. In addition, even though other crabs crossed over the pool, a crab was left in the pool, as was seen in natural conditions (figure 4C). Swarm Model based on Inherent Noise Here, we show a swarm model to explain emergent water crossing behavior. As mentioned in the introduction section, using numerical field observations and experimental results we found the following characteristics of general swarming behavior in soldier crabs: (i) a swarm moving in a lagoon has inherent noise and maintains coherence; (ii) turbulent motion results in part of the swarm becoming highly concentrated, and this part enters and crosses the water through an effect of the group; and (iii) individuals in other parts of the swarm follow their predecessors. Characteristic (i) suggests perpetual negotiation among individuals with respect to direction. Characteristic (ii) reveals that density affects the mechanism to generate a swarm. Such an inherent noise has been found not only in the swarming of soldier crabs but also in other animal groups. For example, in a starling flock each bird continuously changes its neighbors and reveals supperdiffusive behavior in the center of the mass reference frame of the flock. Moreover, it has been reported that a noise inherently generated within a locust-march plays an essential role in the collective change of direction. When considering (i) combined with (ii), it is suggested that inherent noise positively contributes to generate and maintain a swarm. To incorporate these soldier crab swarm behaviors into a model, we introduced several potential transitions for each individual that allowed the individual to anticipate the movements of other individuals within the swarm (figure 5A). Each individual has its own principal vector (velocity) accompanied by a number of potential transitions (P) in a range restricted by the angle (a) and the length (L). If the targets of any potential transitions overlap at a certain site (lattice), the number of potential transitions to that site is counted as the site's ''popularity''. If there are multiple sites with a popularity larger than 1 (threshold value) among an individual's potential transitions, it is assumed that the individual moves to the site with the highest popularity. If several individuals intend to move to the same site, one individual is randomly chosen to move there and the others move to their second most probable site. This rule represents the mutual anticipation of the individuals. For example, people often manage to avoid collisions and walk in a crowd of others using anticipation. Therefore, we implement this type of behavior into our model. If there is no site with a popularity exceeding the threshold value in the neighborhood of an individual, and if others within a radius R f move due to mutual anticipation, the individual moves to occupy the absent site generated by mutual anticipation. Namely, it follows its predecessor. If an individual's movements are not based on mutual anticipation or the actions of a predecessor, it moves in the direction of a randomly chosen potential transition. This type of individual is called a ''free wanderer'' (see further details in Materials and Methods). We implemented these rule in an asynchronous updating model in a lattice space coupled with velocity matching (VM) of principal vectors (figure 5A). VM is implemented in a neighborhood with a radius R M. By assuming a maximum of one individual per lattice, the model implements collision avoidance (CA). The predecessorfollowing rule is also an example of flock centering (FC) (also known as attractive rule). The rules of VM, CA, and FC constitute BOIDS. BOIDS has recently been expanded to model more realistic characteristics of flocks and schools [14,. Thus, the introduction of mutual anticipation to our model is a natural extension of BOIDS. Figure 5B demonstrates how various swarming patterns in the model with rapped boundary conditions depend on the parameters a and P with R f = 2 and R M = 3. If P is 1, the model mimics BOIDS. If P is 2, multiple potential transitions break out in collective motion because two transitions contribute not to make a popular site, but to make a random transition. If P exceeds 2, mutual anticipation contributes to swarm formation, especially if a is large. It is easy to see that a swarm contains turbulent motion despite maintaining a highly dense whole when P is larger. Furthermore, if there is a solitary individual, it is regarded as a free wanderer and moves by choosing randomly from potential transitions. Therefore, the larger P is, the more random an individual's move is. In this sense, we can regard potential transitions as inherent noise. In our previous study, we showed that this model could explain several phenomena exhibited by animal groups. Water Crossing Behavior in the Swarm Model In this section, we show the water crossing behavior performed by our swarm model, setting the parameters at P = 10, a = 0.5, L = 4, R f = R M = 2. Emulating the experiment conducted with real swarms, we set the bounded space to consist of 90630 lattices in which the pool area (30630 lattices) was sandwiched between the shore areas (each 30630 lattices). The pool, as an avoidance area, was defined as a specific area in which the condition allowing mutual anticipation of potential transitions were overlapped larger than two (see Materials and Methods). Hence it was more difficult for individuals to go through the specific area, which mimics a natural pool that an individual soldier crab does not enter. In this simulation, individuals could not go outside the bounded space, emulating the wall of the experimental apparatus, even though potential transitions overlapped with the area outside of the space. In addition, individuals were given the tendency to walk along the boundary of the space because it has been reported that real solder crabs tend to walk along the wall (see Materials and Methods). In each simulation, individuals were randomly allocated to one of the shore areas with random directions of principal vectors. We conducted each trial for 250 time steps and ran 100 trials for swarms with 3, 5,, 21 individuals. Successful trials, failures, and the performance of water crossing behavior were defined by using the success rate Q along with the experiment conducted with real crabs. Figure 6 shows the performance of water crossing behavior and the frequency of success and failure for each swarm size. It is easy to see that the bigger the swarm size, the more success in water crossing. When we compared the performance between swarms composed of five (small) and fifteen (large) individuals that were compared in the real soldier crab experiment, there were significant differences between these swarms (performance: 68/ 100 (fifteen individuals) vs. 19/100 (five individuals), Chi-square test: x 2 1 = 39.872, P,0.001). In the experiment, because of difficulty in collecting a huge number of fresh crabs, we only tested two sizes of swarms (i.e., 5 and 15 individuals) with real crabs. However, we can predict the behavior of intermediary size of swarm by using our swarm model. In figure 6, it can be observed that the performance of water crossing behavior of our model exceeds 0.5 i.e., the number of successes is over the number of failures when the swarm size is more than nine. Hence it would be expected that if we test a swarm composed of over nine real crabs, the swarm success the water crossing behavior on more than half of trials. Figure 7 shows snapshots of the time development of swarm trajectories in a model simulation. Each agent is represented with its 10-step trajectories. The pale grey area located in the center indicates the pool area in which the threshold to allow mutual anticipation is heightened. In the case of a swarm whose size is five, solitary or few individuals do not enter into the pool, even though the swarm walks along the marginal area of the pool. On the other hand, in the case of a swarm whose size is fifteen, dense swarm is formed at the edge of pool, and once individuals enter into the pool they cross over the pool without stopping. Moreover, we observed that some individuals remained in the pool despite the crossing over of the others, which is frequently observed with real soldier crabs (indicated by red circle in figure 7). Therefore, the simulated swarm appropriately mimics the behavior of real soldier crabs as shown in the experiment and natural conditions. Discussion In this study, we first conducted an experiment with respect to water crossing behavior of soldier crab swarms. We observed that when a small swarm confronted a waterfront, it could not enter a water pool. Hence, when a swarm was small or sparse, they regarded the water pool as an area to avoid entering. In contrast, when the swarm became bigger and a highly concentrated part was created inside the swarm, they could then enter and cross the water. Therefore, by creating a large and dense region, the swarm could overcome the water pool as an avoidance area. Although spontaneous invading behaviors into an avoided area have been reported for several animals, in most cases, animals have some motivation such as rich food sources to encourage entrance into an avoidance area. Our experimental results indicate that the behavior of overcoming the avoidance area observed in soldier crab swarming is obviously an emergent behavior because, while small swarms passively responds to a water pool as a noxious stimulus, if the swarm becomes bigger they spontaneously enters to the pool. Some examples of emergent behavior of collective animals were presented previously. In particular, Berdahl and others revealed that greater group-level responsiveness to the environment arises spontaneously as group size increases. For example, a fish school stays away from the light as an avoidance area more sensitively if it is bigger in size. They explain this emergent behavior by the simple rule of attraction such that an agent approaches its neighbors if they separate from each other. The water crossing behavior can be explained by our model, which incorporated inherent noise and mutual anticipation. Inherent noise in the model created diverse potentials for each individual and the swarm collapsed if each individual chose potential transitions randomly. In contrast, if the diversity of moves is used for other individuals' anticipation, this results in a densely collective motion. Mutual anticipation may be affected by each individual crab's sensitivity to the moves of other individuals and by the asynchronous movements of the individuals in a swarm. This sensitivity allows crabs to detect the site to which many individuals could move toward. Because of asynchronous updating, crabs can move in various directions without collision and overcrowding. By considering the water pool to be an area where it is difficult for mutual anticipation to occur, the water crossing behavior is easily simulated in our model. In simulations with small swarms, even if it is faced with the marginal area of the pool, it cannot enter the pool because potential transitions are not overlapped enough for mutual anticipation of the swarm to occur in the pool. For a large swarm, however, after regions of high concentration are formed, the swarm can enter the pool and make mutual anticipation at sites in the pool due to highly concentrated potential transitions. Then, even when an individual cannot occur due to mutual anticipation in the pool, it is not separated from swarm as long as it can follow the predecessor, and hence the swarm crosses over the pool without stopping. However, if the individual cannot use either mutual anticipation or follow its neighbors, it is separated from swarm and left in the pool, as was seen in the experiment. In this way, our swarm model can emulate the behavior of real soldier crabs to some extent. It is difficult to explain the behavior of entering an avoidance area only with the simple attraction rule because when a local part of a swarm enters into the water pool and the greater part of it stays on the shore around the pool, the local part is brought back to the greater part by following the attraction rule. Inherent noise can be widely seen in animal groups. By using mutual anticipation, inherent noise that could be expected to negatively impact the swarm, makes a positive contribution to the collective motion and can explain the water crossing behavior of a soldier crab swarm. These results suggest that inherent noise and mutual anticipation play an important role in understanding collective behavior.
Effect of Integrated Yoga (IY) on psychological states and CD4 counts of HIV-1 infected Patients: A Randomized controlled pilot study Background: Human immunodeficiency virus (HIV) infected individuals frequently suffer from anxiety and depression. Depression has been associated with rapid decline in CD4 counts and worsened treatment outcomes in HIV-infected patients. Yoga has been used to reduce psychopathology and improve immunity. Aim: To study the effect of 1-month integrated yoga (IY) intervention on anxiety, depression, and CD4 counts in patients suffering from HIV-1 infection. Methods: Forty four HIV-1 infected individuals from two HIV rehabilitation centers of Manipur State of India were randomized into two groups: Yoga (n = 22; 12 males) and control (n = 22; 14 males). Yoga group received IY intervention, which included physical postures (asanas), breathing practices (pranayama), relaxation techniques, and meditation. IY sessions were given 60 min/day, 6 days a week for 1 month. Control group followed daily routine during this period. All patients were on anti-retroviral therapy (ART) and dosages were kept stable during the study. There was no significant difference in age, gender, education, CD4 counts, and ART status between the two groups. Hospital anxiety and depression scale was used to assess anxiety and depression, CD4 counts were measured by flow cytometry before and after intervention. Analysis of variance repeated measures was applied to analyze the data using SPSS version 10. Results: Within group comparison showed a significant reduction in depression scores (F =4.19, P < 0.05) and non-significant reduction in anxiety scores along with non significant increment in CD4 counts in the yoga group. In the control group, there was a non-significant increase in anxiety and depression scores and reduction in CD4 counts. Between-group comparison revealed a significant reduction in depression scores (F =5.64, P < 0.05) and significant increase in CD4 counts (F =5.35, P < 0.05) in the yoga group as compared to the control. Conclusion: One month practice of IY may reduce depression and improve immunity in HIV-1 infected adults. INTRODUCTION Human immunodeficiency virus (HIV) infection is a communicable disease leading to significant morbidity, mortality, and poor quality of life. Approximately, 2.5 million individuals were found to be infected with HIV-1 cultural beliefs significantly impair their quality of life. Mental disorders such as major depressive disorder, generalized anxiety, and agoraphobia are commonly found in patients with HIV. Out of all these, depression is the most prevalent comorbid mental disorder with a prevalence of 22-38% among HIV-infected patients. Unemployment, lack of health insurance, low CD4+ cell counts, not having a partner, and poor quality of social support are significant contributors for depression in HIV-infected patients. Depression is found to be associated with poor adherence to ART, and also influences CD4 counts and viral loads (VLs) negatively. Antidepressant medications are helpful, but they are not free from side effects. Complementary and alternative medicine is becoming popular as rehabilitation measures in patients living with HIV/AIDS. Yoga is the most commonly used mind-body intervention. It is cost-effective and easy to implement and offers benefit for emotional, psychological, and physical health. Yoga encompasses asanas (Yogic postures), pranayama (Yogic breathing practices), yoga-based relaxation techniques, and meditation. Many studies demonstrated the broad positive impact of yoga in health and many disease conditions. Yoga can augment current treatment modalities of HIV infection. Yoga helps in many psychological conditions such as anxiety, depression, and schizophrenia. It improves overall well-being and quality of life in many chronic medical illnesses. Earlier studies reported the potential role of yoga in resisting the impairment of cellular immunity. In a study in healthy volunteers, Yoganidra (a yogic relaxation technique) practice given for 30 min daily for 6 months showed a significant reduction in erythrocyte sedimentation rate than the control group. In another study, yoga practice improved natural killer cell activity in early breast cancer patients. In a randomized control trial on pulmonary tuberculosis patients, 2 months of yoga practice helped in reducing the infection. Yoga is proven to be safe and effective in reducing depression and anxiety. In a study, yoga helped reduction of blood pressure in pre-hypertensive HIV-1 infected subjects. Earlier, meditation and Qigong practice had been found useful in reducing anxiety and depression, and increasing T-cell count in HIV-infected patients. But, this study was done on a small sample of HIV-infected patients and lacked control group. Hence, there is a need for exploration of this area with a better design. Therefore, present study was planned with an intention to assess the effect of a month-long Integrated Yoga (IY) intervention on psychological health and CD4 counts of HIV-1 infected individuals using a randomized controlled design. METHODS Forty-four HIV-1 infected patients from two HIV rehabilitation centers in Manipur, were selected in this study; subjects were randomly divided into a yoga group (n = 22) and control group (n = 22) using online random number generator software. Subject with active infection, severe weakness, and those under psychiatric medications were excluded from the study. All the participants were educated at least up to 12 th standard . Intervention All the subjects in the yoga group performed asanas (Yogic postures), pranayama (Yogic breathing techniques), and yoga-based relaxation techniques 1 h daily, 6 days in a week for 1 month. Control group followed their normal routine activity. Regular attendance was monitored by maintaining attendance register and subjects who attended <70% of sessions were excluded from the study. The yoga module implemented in this study followed typical IAYT Nadishuddhi, stali, and bhrmari session module and details of these practices were given elsewhere. Assessments Hospital anxiety and depression scale Both groups were administered hospital anxiety and depression scale (HADS), before and after 1 month of yoga intervention. HADS is considered as a valid tool to assess symptom severity and cases of anxiety disorders and depression in both somatic, psychiatric, and primary care patients and in the general population. CD4 counts Whole blood samples were collected from all 44 HIV-infected individuals from HIV rehabilitation centers in Manipur for their CD4+ T-cell estimation. To avoid any diurnal variation in the T-cell subset counts, all the samples were collected between 8:00 am and 10:00 am in K 2 /K 3 EDTA vacutainer tubes (Becton Dickinson, Franklin Lakes, NJ, USA) after obtaining an informed consent. The most common technique for measuring CD4 counts in developed country settings is flow cytometry. Flow cytometers use lasers to excite fluorescent antibody probes specific for various cell surface markers, such as CD3, CD4, and CD8, which distinguish one type of lymphocyte from another. We used FACSCount system (Becton Dickinson, San Jose, USA) for CD4 T enumeration. The enumeration of the T cell subsets by the FACSCount system was performed using respective reagents (liquid format). Reagents were maintained at a temperature range of 2-8°C. Strict cold chain was maintained throughout the procedure. The technical details of the procedure are provided elsewhere. Data analysis All data were found to be normally distributed by Shapiro-Wilk test. Analysis of variance -repeated measures with Bonferroni's correction was performed to analyze the data using SPSS (IBM, Pvt Ltd) version 10. Yoga group In the yoga group, at the baseline, out of 22, 12 (50%) suffered from clinical anxiety (HADS scores >11) and 9 (40.9%) suffered from clinical depression (HADS scores >11). After 1 month of IY, number of subjects with clinical anxiety came down to 9 (40.9%) and those with clinical depression reduced to 2 (9.09%). Between-group There was significant reduction in depression scores (F =5.65, P = 0.02) and significant improvement in CD4 counts (F =5.35, P = 0.04) in yoga group as compared to control group at the end of one month yoga intervention . DISCUSSION The aim of this study was to observe the effect of 1 month IY intervention on depression, anxiety, and CD4 counts in patients living with HIV-1 infection. Significant reduction in depression and improvement in CD4 counts was observed at the end of 1 month of IY practice, as compared to the control group. To the best of our knowledge, present work is the first attempt to explore the effect of IY intervention on anxiety, depression, and CD4 counts in HIV-infected individuals. Previously, Koar assessed the effect of 3-month Qigong practice on anxiety, depression, and CD4 counts of 26 HIV-infected patients in his pilot work. At the end of 1 month, there was an improvement in anxiety by 0.65%, depression by 19.82%, and CD4 counts by 10.89%. We observed an improvement in anxiety, depression, and CD4 counts by 8.2%. 13.39%, and 6.4%, respectively. Higher percentage improvement in CD4 counts in the previous study as compared to that found by us may be due to longer duration of intervention (3 months) than compared to our study (1 month). Similarly, in another controlled study, 1 month of stress management program (biweekly sessions of progressive muscle relaxation, biofeedback, meditation, and hypnosis) reduced anxiety, improved mood, self-esteem, and T cell counts in 20 HIV-positive individuals and found it to be effective in improving all the variables measured. These results are similar to our findings. This suggests an important role of stress management through various mind-body interventions in the clinical care of HIV-infected individuals. At the baseline, we observed that out of 44 subjects who participated in the study, 20 (45.4%) had scores on HADS above 11, which suggests clinical anxiety and 20 (45.4%) had scores of depression above 11 suggesting clinical depression. Stress and depression are clearly linked and stress may precipitate or exacerbate depressive symptoms and depression. Psychological stress due to HIV-1 diagnosis, social stigma, poor health, and ART medication are the basic causes of depression and anxiety in HIV-1 infected patients. Stress not only leads progression of HIV-1, but also suppress the immunity by affecting immune-neuroendocrine axis. Depression is common among HIV-1 infected patients and it is associated with low CD4 cell counts, presence of depression brings a rapid decline in CD4 counts. Probably, the reduction in depression that we observed in this study is because of reduction in stress levels through yoga. Reduction in Strength of the present study includes a randomized controlled design, implementation of a specific validated yoga protocol, and important assessment tools. Major limitations are relatively small sample size, lack of objective assessments tools such as VLs, bio-markers of depression, or imaging techniques. In future, studies should be planned with large sample size using important biochemical (VLs, markers of inflammation) and radiological variables. Future studies should also assess the effect of long-term IY intervention on these variables. CONCLUSION Regular practice of yoga helps to improve psychological well-being by reducing depression and improves immunity by increasing CD4 counts in patients suffering from HIV1. Hence, yoga can be a useful adjuvant in the conventional management of HIV-1 infection. Financial support and sponsorship Nil. Conflicts of interest There are no conflicts of interest.
In news that should thrill Democrats, Rep. Kyrsten Sinema has announced that she’ll run for the Senate next year, hoping to unseat Republican Jeff Flake. Flake has frequently criticized Donald Trump and the extremist tilt of his own party (despite repeatedly voting for the GOP’s disastrous policies) and will likely be challenged — and beaten — in the GOP primaries. Given the rapidly changing demographics of Arizona, it’s a very good chance for Democrats to pick up a very important Senate seat… if they can find a decent candidate. Church was a part of her life growing up, but her religious beliefs have been hard to pin down even since she entered the national scene. Long-time readers of this site may be most familiar with Sinema because, as a candidate for Congress in 2012, she was believed to be a non-theist. She had received an award from the Center for Inquiry for the “Advancement of Science and Reason in Public Policy” while serving as state senator. In 2010, she was present at the opening of the Secular Coalition for Arizona. She hasn’t talked about religion very much since that time, though there were a couple of nods in our direction. Weeks after her 2012 election, she told CNN, “I’m not a member of any faith community,” adding that it was a personal issue and not something she wished to discuss in public. And when she took her oath of office, she put her hand on a copy of the Constitution rather than a Bible. Her refusal to be openly atheist, if that’s an accurate description of her religious beliefs, isn’t some sort of deal-breaker for me. Honestly, our country would be better off if all politicians treated religion as a private matter. And if Sinema felt an atheist label would hurt her chances of political success — giving more power to religious conservatives — then I’d much rather have her stay silent about her beliefs (even if her staff needs lessons on how to talk about the issue). Progressives in Arizona should be very excited to see her step into this race. She’s a strong candidate who has the appeal to win over plenty of moderates during an election when anti-GOP sentiments are sure to run high. If I lived in Arizona, I would be thrilled to vote for her in the primary and general elections. But I don’t live in Arizona. So I just made a contribution to her Senate campaign. I hope you’ll do the same.
package me.dinowernli.grpc.polyglot.config; import java.io.ByteArrayOutputStream; import java.io.OutputStream; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.util.List; import java.util.Map; import java.util.Optional; import java.util.stream.Collectors; import com.google.common.base.Preconditions; import com.google.common.base.Splitter; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMultimap; import com.google.common.collect.Maps; import org.kohsuke.args4j.CmdLineException; import org.kohsuke.args4j.CmdLineParser; import org.kohsuke.args4j.Option; /** Provides easy access to the arguments passed on the command line. */ public class CommandLineArgs { @Option(name = "--full_method", metaVar = "<some.package.Service/doSomething>") private String fullMethodArg; @Option(name = "--endpoint", metaVar = "<host>:<port>") private String endpointArg; @Option(name = "--config_set_path", metaVar = "<path/to/config.pb.json>") private String configSetPathArg; @Option(name = "--config_name", metaVar = "<config-name>") private String configNameArg; // The flags below represent overrides for the configuration used at runtime. @Option(name = "--output_file_path", metaVar = "<path>") private String outputFilePathArg; @Option(name = "--use_tls", metaVar = "true|false") private String useTlsArg; @Option(name = "--add_protoc_includes", metaVar = "<path1>,<path2>") private String addProtocIncludesArg; @Option(name = "--proto_discovery_root", metaVar = "<path>") private String protoDiscoveryRootArg; @Option(name = "--deadline_ms", metaVar = "<number>") private Integer deadlineMs; @Option(name = "--tls_ca_cert_path", metaVar = "<path>") private String tlsCaCertPath; @Option(name = "--tls_client_cert_path", metaVar = "<path>") private String tlsClientCertPath; @Option(name = "--tls_client_key_path", metaVar = "<path>") private String tlsClientKeyPath; @Option(name = "--tls_client_override_authority", metaVar = "<host>") private String tlsClientOverrideAuthority; @Option(name = "--use_reflection", metaVar = "true|false") private String useReflection; @Option(name = "--help") private Boolean help; // ************************************************************************* // * Initial step towards the migration to "polyglot <command> [flagz...]" * // ************************************************************************* /** Command to make a GRPC call to an endpoint */ public static final String CALL_COMMAND = "call"; /** Command to list all known services defined in the proto files*/ public static final String LIST_SERVICES_COMMAND = "list_services"; @Option(name = "--command", metaVar = "<call|list_services>") private String commandArg; // TODO: Move to a "list_services"-specific flag container @Option( name = "--service_filter", metaVar = "service_name", usage="Filters service names containing this string e.g. --service_filter TestService") private String serviceFilterArg; // TODO: Move to a "list_services"-specific flag container @Option( name = "--method_filter", metaVar = "method_name", usage="Filters service methods to those containing this string e.g. --method_name List") private String methodFilterArg; //TODO: Move to a "list_services"-specific flag container @Option( name = "--with_message", metaVar = "true|false", usage="If true, then the message specification for the method is rendered") private String withMessageArg; @Option(name = "--metadata", metaVar = "k1:v1,k2:v2,...") private String metadataArg; // ************************************************************************* /** * Parses the arguments from the supplied array. Throws {@link IllegalArgumentException} if the * supplied array is malformed. */ public static CommandLineArgs parse(String[] args) { CommandLineArgs result = new CommandLineArgs(); CmdLineParser parser = new CmdLineParser(result); try { parser.parseArgument(args); } catch (CmdLineException e) { throw new IllegalArgumentException("Unable to parse command line flags", e); } return result; } /** Returns a single-line usage string explaining how to pass the command line arguments. */ public static String getUsage() { CommandLineArgs result = new CommandLineArgs(); CmdLineParser parser = new CmdLineParser(result); OutputStream stream = new ByteArrayOutputStream(); parser.printSingleLineUsage(stream); return stream.toString(); } private CommandLineArgs() { } /** Returns the endpoint string */ public Optional<String >endpoint() { return Optional.ofNullable(endpointArg); } /** Returns the endpoint method */ public Optional<String >fullMethod() { return Optional.ofNullable(fullMethodArg); } /** Returns the root of the directory tree in which to discover proto files. */ public Optional<Path> protoDiscoveryRoot() { return maybeInputPath(protoDiscoveryRootArg); } /** Returns the location in which to store the response proto. */ public Optional<Path> outputFilePath() { return maybeOutputPath(outputFilePathArg); } public Optional<Boolean> useTls() { if (useTlsArg == null) { return Optional.empty(); } return Optional.of(Boolean.parseBoolean(useTlsArg)); } public Optional<Path> configSetPath() { return maybeInputPath(configSetPathArg); } public Optional<String> configName() { return Optional.ofNullable(configNameArg); } public Optional<Path> tlsCaCertPath() { return maybeInputPath(tlsCaCertPath); } public Optional<Path> tlsClientCertPath() { return maybeInputPath(tlsClientCertPath); } public Optional<Path> tlsClientKeyPath() { return maybeInputPath(tlsClientKeyPath); } public Optional<String> tlsClientOverrideAuthority() { return Optional.ofNullable(tlsClientOverrideAuthority); } /** Defaults to true. */ public boolean useReflection() { return useReflection == null || useReflection.equals("true"); } /** * First stage of a migration towards a "command"-based instantiation of polyglot. * Supported commands: * list_services [--service_filter XXX] [--method_filter YYY] */ public Optional<String> command() { return Optional.ofNullable(commandArg); } // ********************************************** // * Flags supporting the list_services command * // ********************************************** // TODO: Move to a "list_services"-specific flag container public Optional<String> serviceFilter() { return Optional.ofNullable(serviceFilterArg); } // TODO: Move to a "list_services"-specific flag container public Optional<String> methodFilter() { return Optional.ofNullable(methodFilterArg); } //TODO: Move to a "list_services"-specific flag container public Optional<Boolean> withMessage() { if (withMessageArg == null) { return Optional.empty(); } return Optional.of(Boolean.parseBoolean(withMessageArg)); } // ************************************************************************* public Optional<ImmutableMultimap<String, String>> metadata() { if (metadataArg == null) { return Optional.empty(); } List<Map.Entry<String, String>> parts = Splitter.on(",") .omitEmptyStrings() .splitToList(metadataArg) .stream() .map(s -> { String[] keyValue = s.split(":"); Preconditions.checkArgument(keyValue.length == 2, "Metadata entry must be defined in key:value format: " + metadataArg); return Maps.immutableEntry(keyValue[0], keyValue[1]); }) .collect(Collectors.toList()); ImmutableMultimap.Builder<String, String> builder = new ImmutableMultimap.Builder<>(); for (Map.Entry<String, String> keyValue : parts) { builder.put(keyValue.getKey(), keyValue.getValue()); } return Optional.of(builder.build()); } public ImmutableList<Path> additionalProtocIncludes() { if (addProtocIncludesArg == null) { return ImmutableList.of(); } ImmutableList.Builder<Path> resultBuilder = ImmutableList.builder(); for (String pathString : addProtocIncludesArg.split(",")) { Path includePath = Paths.get(pathString); Preconditions.checkArgument(Files.exists(includePath), "Invalid include: " + includePath); resultBuilder.add(includePath); } return resultBuilder.build(); } public Optional<Integer> getRpcDeadlineMs() { return Optional.ofNullable(deadlineMs); } public boolean isHelp() { return help != null && help; } private static Optional<Path> maybeOutputPath(String rawPath) { if (rawPath == null) { return Optional.empty(); } Path path = Paths.get(rawPath); return Optional.of(Paths.get(rawPath)); } private static Optional<Path> maybeInputPath(String rawPath) { return maybeOutputPath(rawPath).map(path -> { Preconditions.checkArgument(Files.exists(path), "File " + rawPath + " does not exist"); return path; }); } }
<gh_stars>1-10 #!/usr/bin/env python """ <NAME> Sept 2021 """ import os import rospy import rospkg from zed_interfaces.srv import start_3d_mapping, start_3d_mappingRequest from zed_interfaces.srv import stop_3d_mapping, stop_3d_mappingRequest import target_mapping.msg import actionlib from sensor_msgs.msg import PointCloud2 from utils.open3d_ros_conversion import convertCloudFromRosToOpen3d, convertCloudFromOpen3dToRos import open3d as o3d import copy import numpy as np class Zed_Mapping_Client(object): def __init__(self): self.mapped = False rp = rospkg.RosPack() pkg_path = rp.get_path('target_mapping') self.pcd_path = os.path.join(pkg_path, 'pcd') self.as_start_map = actionlib.SimpleActionServer("/zed_mapping_client/start_mapping", target_mapping.msg.StartZedMappingAction, execute_cb=self.start_mapping_Callback, auto_start=False) self.as_start_map.start() self.as_stop_map = actionlib.SimpleActionServer("/zed_mapping_client/stop_mapping", target_mapping.msg.StopZedMappingAction, execute_cb=self.stop_mapping_Callback, auto_start=False) self.as_stop_map.start() self.as_save_map = actionlib.SimpleActionServer("/zed_mapping_client/save_mapping", target_mapping.msg.SaveZedMapAction, execute_cb=self.save_mapping_Callback, auto_start=False) self.as_save_map.start() self.start_zed_map_srv_client = rospy.ServiceProxy('/zed2/zed_node/start_3d_mapping', start_3d_mapping) rospy.wait_for_service('/zed2/zed_node/start_3d_mapping') self.stop_zed_map_srv_client = rospy.ServiceProxy('/zed2/zed_node/stop_3d_mapping', stop_3d_mapping) rospy.wait_for_service('/zed2/zed_node/stop_3d_mapping') stop_request = stop_3d_mappingRequest() result = self.stop_zed_map_srv_client(stop_request) self.pc_sub = rospy.Subscriber('/zed2/zed_node/mapping/fused_cloud', PointCloud2, self.mapCallback, queue_size=1) rospy.loginfo("zed_mapping_client has been initialized!") def mapCallback(self, pc_msg): print('mapping') self.pc_map = pc_msg self.mapped = True def start_mapping_Callback(self, goal): print('start ZED mapping') start_request = start_3d_mappingRequest() start_request.resolution = 0.01 start_request.max_mapping_range = -1 start_request.fused_pointcloud_freq = 1 result = self.start_zed_map_srv_client(start_request) self.as_start_map.set_succeeded() self.start_mapping = True def stop_mapping_Callback(self, goal): print('stop ZED mapping') rospy.sleep(1.) # give map subscriber 1 second to save map stop_request = stop_3d_mappingRequest() result = self.stop_zed_map_srv_client(stop_request) self.as_stop_map.set_succeeded() def save_mapping_Callback(self, goal): print('save ZED mapping') pc_map_msg = copy.copy(self.pc_map) o3d_pc = convertCloudFromRosToOpen3d(pc_map_msg) pts = np.asarray(o3d_pc.points) clrs = np.asarray(o3d_pc.colors) map_pcd = o3d.geometry.PointCloud() map_pcd.points = o3d.utility.Vector3dVector(pts) map_pcd.colors = o3d.utility.Vector3dVector(clrs) pcd_name = os.path.join(self.pcd_path, "target_zed.pcd") o3d.io.write_point_cloud(pcd_name, map_pcd) self.as_save_map.set_succeeded() if __name__ == '__main__': rospy.init_node('zed_mapping_client', anonymous=False) zed_mapping_client = Zed_Mapping_Client() try: rospy.spin() except rospy.ROSInterruptException: rospy.loginfo("Node killed!")
/* Copyright (c) 2014 ideawu. All rights reserved. Use of this source code is governed by a license that can be found in the LICENSE file. @author: ideawu @website: http://www.cocoaui.com/ */ #ifndef IKit_h #define IKit_h #import <UIKit/UIKit.h> #import "IKitUtil.h" #import "IStyle.h" #import "IView.h" #import "ITable.h" #import "ITableRow.h" #import "ILabel.h" #import "IInput.h" #import "IButton.h" #import "ISwitch.h" #import "IImage.h" #import "IPullRefresh.h" #import "IRefreshControl.h" #endif //在这里添加宏会在其他文件中重复引用他们自己,按道理应该不会出现问题 #ifndef IKit_PrefixHeader_pch #define IKit_PrefixHeader_pch #define VER_NUM "1.2.6" #define L_MYLOG(level, fmt, args...) \ my_log((level @" %@(%d): " fmt), [@(__FILE__) lastPathComponent], __LINE__, ##args) #ifdef DEBUG # define VERSION VER_NUM "(for development only)" # define log_trace(...) L_MYLOG(@"[TRACE]", __VA_ARGS__) # define log_debug(...) L_MYLOG(@"[DEBUG]", __VA_ARGS__) #else # define VERSION VER_NUM "(for production)" # define log_trace(...) # define log_debug(...) #endif #define log_info(...) L_MYLOG(@"[INFO] ", __VA_ARGS__) #define log_error(...) L_MYLOG(@"[ERROR]", __VA_ARGS__) #import <Foundation/Foundation.h> inline static void my_log(NSString *fmt, ...){ NSDateFormatter *f = [[NSDateFormatter alloc] init]; [f setDateFormat:@"yyyy-MM-dd HH:mm:ss.SSS"]; NSString *time = [f stringFromDate:[NSDate date]]; va_list args; va_start(args, fmt); NSString *msg = [[NSString alloc] initWithFormat:fmt arguments:args]; va_end(args); printf("%s %s\n", time.UTF8String, msg.UTF8String); } #endif
Redesigning the bill would take about 10 years. It doesn’t appear likely the current administration would replace Jackson with Tubman. Tubman traveled mainly between Maryland and the Niagara, Ontario, area. There is no evidence she was ever in Michigan.
<filename>fhir/resources/STU3/condition.py # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Condition Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ import typing from pydantic import Field, root_validator from . import backboneelement, domainresource, fhirtypes class Condition(domainresource.DomainResource): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Detailed information about conditions, problems or diagnoses. A clinical condition, problem, diagnosis, or other event, situation, issue, or clinical concept that has risen to a level of concern. """ resource_type = Field("Condition", const=True) abatementAge: fhirtypes.AgeType = Field( None, alias="abatementAge", title="If/when in resolution/remission", description=( "The date or estimated date that the condition resolved or went into " 'remission. This is called "abatement" because of the many overloaded ' 'connotations associated with "remission" or "resolution" - Conditions ' "are never really resolved, but they can abate." ), # if property is element of this resource. element_property=True, # Choice of Data Types. i.e abatement[x] one_of_many="abatement", one_of_many_required=False, ) abatementBoolean: bool = Field( None, alias="abatementBoolean", title="If/when in resolution/remission", description=( "The date or estimated date that the condition resolved or went into " 'remission. This is called "abatement" because of the many overloaded ' 'connotations associated with "remission" or "resolution" - Conditions ' "are never really resolved, but they can abate." ), # if property is element of this resource. element_property=True, # Choice of Data Types. i.e abatement[x] one_of_many="abatement", one_of_many_required=False, ) abatementBoolean__ext: fhirtypes.FHIRPrimitiveExtensionType = Field( None, alias="_abatementBoolean", title="Extension field for ``abatementBoolean``.", ) abatementDateTime: fhirtypes.DateTime = Field( None, alias="abatementDateTime", title="If/when in resolution/remission", description=( "The date or estimated date that the condition resolved or went into " 'remission. This is called "abatement" because of the many overloaded ' 'connotations associated with "remission" or "resolution" - Conditions ' "are never really resolved, but they can abate." ), # if property is element of this resource. element_property=True, # Choice of Data Types. i.e abatement[x] one_of_many="abatement", one_of_many_required=False, ) abatementDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType = Field( None, alias="_abatementDateTime", title="Extension field for ``abatementDateTime``.", ) abatementPeriod: fhirtypes.PeriodType = Field( None, alias="abatementPeriod", title="If/when in resolution/remission", description=( "The date or estimated date that the condition resolved or went into " 'remission. This is called "abatement" because of the many overloaded ' 'connotations associated with "remission" or "resolution" - Conditions ' "are never really resolved, but they can abate." ), # if property is element of this resource. element_property=True, # Choice of Data Types. i.e abatement[x] one_of_many="abatement", one_of_many_required=False, ) abatementRange: fhirtypes.RangeType = Field( None, alias="abatementRange", title="If/when in resolution/remission", description=( "The date or estimated date that the condition resolved or went into " 'remission. This is called "abatement" because of the many overloaded ' 'connotations associated with "remission" or "resolution" - Conditions ' "are never really resolved, but they can abate." ), # if property is element of this resource. element_property=True, # Choice of Data Types. i.e abatement[x] one_of_many="abatement", one_of_many_required=False, ) abatementString: fhirtypes.String = Field( None, alias="abatementString", title="If/when in resolution/remission", description=( "The date or estimated date that the condition resolved or went into " 'remission. This is called "abatement" because of the many overloaded ' 'connotations associated with "remission" or "resolution" - Conditions ' "are never really resolved, but they can abate." ), # if property is element of this resource. element_property=True, # Choice of Data Types. i.e abatement[x] one_of_many="abatement", one_of_many_required=False, ) abatementString__ext: fhirtypes.FHIRPrimitiveExtensionType = Field( None, alias="_abatementString", title="Extension field for ``abatementString``." ) assertedDate: fhirtypes.DateTime = Field( None, alias="assertedDate", title="Date record was believed accurate", description=( "The date on which the existance of the Condition was first asserted or" " acknowledged." ), # if property is element of this resource. element_property=True, ) assertedDate__ext: fhirtypes.FHIRPrimitiveExtensionType = Field( None, alias="_assertedDate", title="Extension field for ``assertedDate``." ) asserter: fhirtypes.ReferenceType = Field( None, alias="asserter", title="Person who asserts this condition", description="Individual who is making the condition statement.", # if property is element of this resource. element_property=True, # note: Listed Resource Type(s) should be allowed as Reference. enum_reference_types=["Practitioner", "Patient", "RelatedPerson"], ) bodySite: typing.List[fhirtypes.CodeableConceptType] = Field( None, alias="bodySite", title="Anatomical location, if relevant", description="The anatomical location where this condition manifests itself.", # if property is element of this resource. element_property=True, ) category: typing.List[fhirtypes.CodeableConceptType] = Field( None, alias="category", title="problem-list-item | encounter-diagnosis", description="A category assigned to the condition.", # if property is element of this resource. element_property=True, ) clinicalStatus: fhirtypes.Code = Field( None, alias="clinicalStatus", title="active | recurrence | inactive | remission | resolved", description="The clinical status of the condition.", # if property is element of this resource. element_property=True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. enum_values=["active", "recurrence", "inactive", "remission", "resolved"], ) clinicalStatus__ext: fhirtypes.FHIRPrimitiveExtensionType = Field( None, alias="_clinicalStatus", title="Extension field for ``clinicalStatus``." ) code: fhirtypes.CodeableConceptType = Field( None, alias="code", title="Identification of the condition, problem or diagnosis", description=None, # if property is element of this resource. element_property=True, ) context: fhirtypes.ReferenceType = Field( None, alias="context", title="Encounter or episode when condition first asserted", description="Encounter during which the condition was first asserted.", # if property is element of this resource. element_property=True, # note: Listed Resource Type(s) should be allowed as Reference. enum_reference_types=["Encounter", "EpisodeOfCare"], ) evidence: typing.List[fhirtypes.ConditionEvidenceType] = Field( None, alias="evidence", title="Supporting evidence", description=( "Supporting Evidence / manifestations that are the basis on which this " "condition is suspected or confirmed." ), # if property is element of this resource. element_property=True, ) identifier: typing.List[fhirtypes.IdentifierType] = Field( None, alias="identifier", title="External Ids for this condition", description=( "This records identifiers associated with this condition that are " "defined by business processes and/or used to refer to it when a direct" " URL reference to the resource itself is not appropriate (e.g. in CDA " "documents, or in written / printed documentation)." ), # if property is element of this resource. element_property=True, ) note: typing.List[fhirtypes.AnnotationType] = Field( None, alias="note", title="Additional information about the Condition", description=( "Additional information about the Condition. This is a general " "notes/comments entry for description of the Condition, its diagnosis " "and prognosis." ), # if property is element of this resource. element_property=True, ) onsetAge: fhirtypes.AgeType = Field( None, alias="onsetAge", title="Estimated or actual date, date-time, or age", description=( "Estimated or actual date or date-time the condition began, in the " "opinion of the clinician." ), # if property is element of this resource. element_property=True, # Choice of Data Types. i.e onset[x] one_of_many="onset", one_of_many_required=False, ) onsetDateTime: fhirtypes.DateTime = Field( None, alias="onsetDateTime", title="Estimated or actual date, date-time, or age", description=( "Estimated or actual date or date-time the condition began, in the " "opinion of the clinician." ), # if property is element of this resource. element_property=True, # Choice of Data Types. i.e onset[x] one_of_many="onset", one_of_many_required=False, ) onsetDateTime__ext: fhirtypes.FHIRPrimitiveExtensionType = Field( None, alias="_onsetDateTime", title="Extension field for ``onsetDateTime``." ) onsetPeriod: fhirtypes.PeriodType = Field( None, alias="onsetPeriod", title="Estimated or actual date, date-time, or age", description=( "Estimated or actual date or date-time the condition began, in the " "opinion of the clinician." ), # if property is element of this resource. element_property=True, # Choice of Data Types. i.e onset[x] one_of_many="onset", one_of_many_required=False, ) onsetRange: fhirtypes.RangeType = Field( None, alias="onsetRange", title="Estimated or actual date, date-time, or age", description=( "Estimated or actual date or date-time the condition began, in the " "opinion of the clinician." ), # if property is element of this resource. element_property=True, # Choice of Data Types. i.e onset[x] one_of_many="onset", one_of_many_required=False, ) onsetString: fhirtypes.String = Field( None, alias="onsetString", title="Estimated or actual date, date-time, or age", description=( "Estimated or actual date or date-time the condition began, in the " "opinion of the clinician." ), # if property is element of this resource. element_property=True, # Choice of Data Types. i.e onset[x] one_of_many="onset", one_of_many_required=False, ) onsetString__ext: fhirtypes.FHIRPrimitiveExtensionType = Field( None, alias="_onsetString", title="Extension field for ``onsetString``." ) severity: fhirtypes.CodeableConceptType = Field( None, alias="severity", title="Subjective severity of condition", description=( "A subjective assessment of the severity of the condition as evaluated " "by the clinician." ), # if property is element of this resource. element_property=True, ) stage: fhirtypes.ConditionStageType = Field( None, alias="stage", title="Stage/grade, usually assessed formally", description=( "Clinical stage or grade of a condition. May include formal severity " "assessments." ), # if property is element of this resource. element_property=True, ) subject: fhirtypes.ReferenceType = Field( ..., alias="subject", title="Who has the condition?", description=( "Indicates the patient or group who the condition record is associated " "with." ), # if property is element of this resource. element_property=True, # note: Listed Resource Type(s) should be allowed as Reference. enum_reference_types=["Patient", "Group"], ) verificationStatus: fhirtypes.Code = Field( None, alias="verificationStatus", title=( "provisional | differential | confirmed | refuted | entered-in-error | " "unknown" ), description=( "The verification status to support the clinical status of the " "condition." ), # if property is element of this resource. element_property=True, # note: Enum values can be used in validation, # but use in your own responsibilities, read official FHIR documentation. enum_values=[ "provisional", "differential", "confirmed", "refuted", "entered-in-error", "unknown", ], ) verificationStatus__ext: fhirtypes.FHIRPrimitiveExtensionType = Field( None, alias="_verificationStatus", title="Extension field for ``verificationStatus``.", ) @classmethod def elements_sequence(cls): """returning all elements names from ``Condition`` according specification, with preserving original sequence order. """ return [ "id", "meta", "implicitRules", "language", "text", "contained", "extension", "modifierExtension", "identifier", "clinicalStatus", "verificationStatus", "category", "severity", "code", "bodySite", "subject", "context", "onsetDateTime", "onsetAge", "onsetPeriod", "onsetRange", "onsetString", "abatementDateTime", "abatementAge", "abatementBoolean", "abatementPeriod", "abatementRange", "abatementString", "assertedDate", "asserter", "stage", "evidence", "note", ] @root_validator(pre=True, allow_reuse=True) def validate_one_of_many_1112( cls, values: typing.Dict[str, typing.Any] ) -> typing.Dict[str, typing.Any]: """https://www.hl7.org/fhir/formats.html#choice A few elements have a choice of more than one data type for their content. All such elements have a name that takes the form nnn[x]. The "nnn" part of the name is constant, and the "[x]" is replaced with the title-cased name of the type that is actually used. The table view shows each of these names explicitly. Elements that have a choice of data type cannot repeat - they must have a maximum cardinality of 1. When constructing an instance of an element with a choice of types, the authoring system must create a single element with a data type chosen from among the list of permitted data types. """ one_of_many_fields = { "abatement": [ "abatementAge", "abatementBoolean", "abatementDateTime", "abatementPeriod", "abatementRange", "abatementString", ], "onset": [ "onsetAge", "onsetDateTime", "onsetPeriod", "onsetRange", "onsetString", ], } for prefix, fields in one_of_many_fields.items(): assert cls.__fields__[fields[0]].field_info.extra["one_of_many"] == prefix required = ( cls.__fields__[fields[0]].field_info.extra["one_of_many_required"] is True ) found = False for field in fields: if field in values and values[field] is not None: if found is True: raise ValueError( "Any of one field value is expected from " f"this list {fields}, but got multiple!" ) else: found = True if required is True and found is False: raise ValueError(f"Expect any of field value from this list {fields}.") return values class ConditionEvidence(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Supporting evidence. Supporting Evidence / manifestations that are the basis on which this condition is suspected or confirmed. """ resource_type = Field("ConditionEvidence", const=True) code: typing.List[fhirtypes.CodeableConceptType] = Field( None, alias="code", title="Manifestation/symptom", description=( "A manifestation or symptom that led to the recording of this " "condition." ), # if property is element of this resource. element_property=True, ) detail: typing.List[fhirtypes.ReferenceType] = Field( None, alias="detail", title="Supporting information found elsewhere", description="Links to other relevant information, including pathology reports.", # if property is element of this resource. element_property=True, # note: Listed Resource Type(s) should be allowed as Reference. enum_reference_types=["Resource"], ) @classmethod def elements_sequence(cls): """returning all elements names from ``ConditionEvidence`` according specification, with preserving original sequence order. """ return ["id", "extension", "modifierExtension", "code", "detail"] class ConditionStage(backboneelement.BackboneElement): """Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Stage/grade, usually assessed formally. Clinical stage or grade of a condition. May include formal severity assessments. """ resource_type = Field("ConditionStage", const=True) assessment: typing.List[fhirtypes.ReferenceType] = Field( None, alias="assessment", title="Formal record of assessment", description=( "Reference to a formal record of the evidence on which the staging " "assessment is based." ), # if property is element of this resource. element_property=True, # note: Listed Resource Type(s) should be allowed as Reference. enum_reference_types=["ClinicalImpression", "DiagnosticReport", "Observation"], ) summary: fhirtypes.CodeableConceptType = Field( None, alias="summary", title="Simple summary (disease specific)", description=( 'A simple summary of the stage such as "Stage 3". The determination of ' "the stage is disease-specific." ), # if property is element of this resource. element_property=True, ) @classmethod def elements_sequence(cls): """returning all elements names from ``ConditionStage`` according specification, with preserving original sequence order. """ return ["id", "extension", "modifierExtension", "summary", "assessment"]
Mesh repairing using topology graphs Geometrical and topological inconsistencies, such as self-intersections and non-manifold elements, are common in triangular meshes, causing various problems across all stages of geometry processing. In this paper, we propose a method to resolve these inconsistencies using a graph-based approach. We first convert geometrical inconsistencies into topological inconsistencies and construct a topology graph. We then define local pairing operations on the topology graph, which is guaranteed not to introduce new inconsistencies. The final output of our method is an oriented manifold with all geometrical and topological inconsistencies fixed. Validated against a large data set, our method overcomes chronic problems in the relevant literature. First, our method preserves the original geometry and it does not introduce a negative volume or false new data, as we do not impose any heuristic assumption (e.g. watertight mesh). Moreover, our method does not introduce new geometric inconsistencies, guaranteeing inconsistency-free outcome.
/** * Method COPY(src,dst) will copy file 'src' to 'dst', create a new file if * 'dst' is not exist, or overwrite 'dst' if already exist. * * NOTE: use 'rename()' system call for easy and fast move. * * On success it will return NULL, otherwise it will return error: * * - ErrFileNameEmpty if both or either src or dst is NULL * - ErrFileNotFound if src file can not be opened */ Error File::COPY(const char* src, const char* dst) { if (!src || !dst) { return ErrFileNameEmpty; } Error err; File from; File to; err = from.open_ro(src); if (err != NULL) { return err; } err = to.open_wt(dst); if (err != NULL) { return err; } do { err = from.read(); if (err != NULL) { if (err == ErrFileEnd) { err = NULL; break; } return err; } err = to.write(&from); } while(err == NULL); return err; }
<filename>7_kyu/Simple_string_characters.py from typing import List def solve(s: str) -> List[int]: uppercase = 0 lowercase = 0 numbers = 0 special = 0 for c in s: if c.isdigit(): numbers += 1 elif c.isupper(): uppercase += 1 elif c.islower(): lowercase += 1 else: special += 1 return [uppercase,lowercase,numbers,special]
As with any Land Rover, the 2019 Discovery Sport outshines its competitors over rough terrain. Additionally, both of its engine options are powerful and can propel this SUV with ease. Its on-road handling is respectable, though the Discovery Sport isn't as refined as some rivals, and it has a below-average fuel economy rating. The Discovery Sport doesn't pack as much punch in its standard or optional engine as some of its performance-oriented competitors, but even with its lower horsepower ratings, this SUV gets no complaints for being short on power. Instead, reviewers agree that both engines move the Discovery Sport quickly. There isn't a consensus on the nine-speed automatic transmission, though. Some test drivers say it's responsive, while others note that it can struggle to shift at the right moment. The standard engine in all trim levels is a 237-horsepower turbocharged 2.0-liter four-cylinder. It has one of the worst fuel economy ratings in the class, at 21 mpg in the city and 25 mpg on the highway. For an additional $6,000 to $7,000, you can upgrade the engine in the HSE and HSE Luxury trims to a turbocharged 286-horespower four-cylinder. It's the same size as the base engine, but clever tuning awards it a zero-to-60 sprint time of 6.3 seconds, which is almost a second quicker than the base engine’s. The upgraded engine gets 1 mpg less in the city, but matches the base engine's highway fuel economy rating. The Discovery Sport maintains an acceptable level of composure on the highway, but it isn't perfect. It lacks the silky smooth ride of some competitors and other Land Rovers. Despite the name, this SUV doesn't have sporty tuning, and it can succumb to body lean on twisty roads. Take the Discovery Sport off the pavement and it excels. It has better off-roading abilities than other luxury compact SUVs, and it’s a little less aggressive than larger Land Rovers. Every model comes with four-wheel drive, the cruise-control-like All Terrain Progress Control, hill descent control, and four Terrain Response drive modes (General Driving, Grass/Gravel/Snow, Mud and Ruts, and Sand).
package com.stephengream.main; import com.stephengream.lathanbot.services.GitService; import com.stephengream.lathanbot.services.IrcService; import com.stephengream.lathanbot.services.PircBotIrcService; import com.stephengream.lathanbot.services.VcsService; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.PropertySource; import org.springframework.context.annotation.Scope; @SpringBootApplication @ComponentScan(basePackages = {"com.stephengream.lathanbot.controllers"}) @PropertySource("classpath:/com/stephengream/lathanbot/config/default.properties") public class Application { @Bean public IrcService ircService(){ return new PircBotIrcService(); } @Bean public VcsService vcsService(){ return new GitService(); } public static void main(String[] args) throws InterruptedException { ApplicationContext ctx = SpringApplication.run(Application.class, args); final IrcService bot = ctx.getBean(IrcService.class); (new Thread(bot)).start(); while(!bot.isConnected()){ Thread.sleep(30000); } (new Thread(ctx.getBean(VcsService.class))).start(); System.out.println("AFTER THE BOT CONNECT!"); } }
Multipoint connection by long-range density interaction and short-range distance rule The performance of a system is influenced by the way its elements are connected. Networks of cells with high clustering and short paths communicate more efficiently than random or periodic networks of the same size. While many algorithms exist for generating networks from distributions of points in a plane, most of them are based on the oversimplification that a systems components form connections in proportion to the inverse of their distance. The Waxman algorithm, which is based on a similar assumption, represents the gold standard for those who want to model biological networks from the spatial layout of cells. This assumption, however, does not allow to reproduce accurately the complexity of physical or biological systems, where elements establish both short and long-range connections, the combination of the two resulting in non-trivial topological features, including small-world characteristics. Here, we present a wiring algorithm that connects elements of a system using the logical connective between two disjoint probabilities, one correlated to the inverse of their distance, as in Waxman, and one associated to the density of points in the neighborhood of the systems element. The first probability regulates the development of links or edges among adjacent nodes, while the latter governs interactions between cluster centers, where the density of points is often higher. We demonstrate that, by varying the parameters of the model, one can obtain networks with wanted values of small-world-ness, ranging from ∼1 (random graphs) to ∼14 (small world networks).
Exudative v/s transudative ascites: differentiation based on fluid echogenicity on high resolution sonography. Real time sonography was performed in 52 patients with ascites to evaluate the accuracy of sonography in differentiating an exudative from a transudative collection. The echogenicity of ascites was graded I, II and III using the echogenicity of normal abdominal viscera as comparative standard reference points. Grade I collections (31 patients) were either absolutely anechoic, or showed few internal echoes secondary to particulate matter. Grade II collections (7 patients) were hypoechoic as compared to the liver and spleen. Grade III collections (14 patients) had an echogenicity similar to or greater than that of the liver and spleen. The results of diagnostic aspiration in all patients were then compared to the sonographic grade of the ascitic fluid. All transudates (28 patients) had a Grade I echogenicity. Only 3 patients with an exudative ascites had a Grade I echogenicity. The remaining 21 patients with an exudative collection had an echogenicity equal to or greater than Grade II. Using these results, an ascitic fluid echogenicity of Grade I had a 92.32% sensitivity, 100% specificity, a positive predictive value of 1 and a negative predictive value of 0.875 in diagnosing transudates. An ascitic fluid echogenicity of Grade II or more had a sensitivity of 87.5%, specificity of 100%, a positive predictive value of 1 and a negative predictive value of 0.903 in diagnosing transudates.
<reponame>simon04/josm-mbtiles<filename>src/org/openstreetmap/josm/plugins/mbtiles/MbtilesTileLoader.java package org.openstreetmap.josm.plugins.mbtiles; import java.io.ByteArrayInputStream; import java.io.IOException; import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.logging.Logger; import org.openstreetmap.gui.jmapviewer.FeatureAdapter; import org.openstreetmap.gui.jmapviewer.OsmTileLoader; import org.openstreetmap.gui.jmapviewer.Tile; import org.openstreetmap.gui.jmapviewer.interfaces.TileJob; import org.openstreetmap.gui.jmapviewer.interfaces.TileLoaderListener; public class MbtilesTileLoader extends OsmTileLoader { private static final Logger LOG = FeatureAdapter.getLogger(MbtilesTileLoader.class.getCanonicalName()); private final Connection connection; public MbtilesTileLoader(TileLoaderListener listener, Connection conn) { super(listener); this.connection = conn; } @Override public TileJob createTileLoaderJob(final Tile tile) { return new TileJob() { @Override public void run() { try { tile.initLoading(); Statement stmt = connection.createStatement(); int invY = (int) Math.pow(2, tile.getZoom()) - 1 - tile.getYtile(); String sql = "SELECT tile_data FROM tiles WHERE zoom_level="+tile.getZoom()+" AND tile_column="+tile.getXtile()+" AND tile_row="+invY+" LIMIT 1"; ResultSet rs = stmt.executeQuery(sql); if(rs.next()) { LOG.fine("Got a row"); tile.loadImage(new ByteArrayInputStream(rs.getBytes(1))); tile.setLoaded(true); listener.tileLoadingFinished(tile, true); } else { LOG.fine("No row found"); tile.setError("No tile found"); listener.tileLoadingFinished(tile, false); } rs.close(); } catch (SQLException e) { LOG.throwing(this.getClass().getName(), "createTileLoaderJob", e); tile.setError(e.getMessage()); listener.tileLoadingFinished(tile, false); } catch (IOException e) { LOG.throwing(this.getClass().getName(), "createTileLoaderJob", e); tile.setError(e.getMessage()); listener.tileLoadingFinished(tile, false); } } @Override public void submit() { this.submit(false); } @Override public void submit(boolean force) { run(); } }; } }
H2 Clearance Measurement of Blood Flow: A Review of Technique and Polarographic Principles H2 clearance is a powerful method for monitoring blood flow. Simple and inexpensive to implement, the method allows multiple in situ determinations of blood flow from any tissue in which a small electrode can be implanted. There is, however, evidence to suggest that H2 clearance is neither as accurate nor as local a measure of blood flow as generally supposed. Both in theory and practice, it probably cannot accurately determine blood flow rates greater than 100 ml/100 gm/min or localize blood flow to tissue volumes of less than 5 ml. Moreover, its experimental application is complicated by many technical problems hitherto largely ignored by workers in the field. Some of these problems arise from the limitations of the steady state polarographic technique used to measure tissue H2 concentrations. Other problems stem from the failure to consider possible sources of error in H2 clearance monitoring; these include interference with the H2 signal by spurious electrode and tissue currents, and contributions from tissue ascorbate and O2. Nevertheless, with the appropriate safeguards and qualifications, H2 clearance is a valid and important approach to measuring blood flow.
Double-winding Wilson loop in $SU(N)$ Yang-Mills theory: A criterion for testing the confinement models We examine how the average of double-winding Wilson loops depends on the number of color $N$ in the $SU(N)$ Yang-Mills theory. In the case where the two loops $C_1$ and $C_2$ are identical, we derive the exact operator relation which relates the double-winding Wilson loop operator in the fundamental representation to that in the higher dimensional representations depending on $N$. By taking the average of the relation, we find that the difference-of-areas law for the area law falloff recently claimed for $N=2$ is excluded for $N \geq 3$, provided that the string tension obeys the Casimir scaling for the higher representations. In the case where the two loops are distinct, we argue that the area law follows a novel law $(N - 3)A_1/(N-1)+A_2$ with $A_1$ and $A_2 (A_1<A_2)$ being the minimal areas spanned respectively by the loops $C_1$ and $C_2$, which is neither sum-of-areas ($A_1+A_2$) nor difference-of-areas ($A_2 - A_1$) law when ($N\geq3$). Indeed, this behavior can be confirmed in the two-dimensional $SU(N)$ Yang-Mills theory exactly. Introduction Which degrees of freedom are responsible for confinement? This question is not yet satisfactorily answered but there are two promising candidates, center vortices and Abelian monopoles. Recently, a criterion for testing these two candidates in the S U Yang-Mills theory has been proposed in. It is a double-winding Wilson loop, which is defined as a Wilson loop consisting of two coplanar loops C 1 and C 2, where C 1 lies entirely in the minimal area of C 2 and the two loops share one point and have the same direction, as indicated in Fig. 1. The average of a double-winding Wilson loop is expected to depend on the model. In the center vortex model, the average of a double-winding Wilson loop decreases exponentially with the difference of areas. This behavior is called the difference-of-areas law. In the models associated with the Abelian monopoles, it decreases exponentially with the sum of areas. This behavior is called the sum-of-areas law. Thus we can test the two models by investigating the true behavior of the average of the double-winding Wilson loop. Indeed, the difference-of-areas behavior is supported by the lattice simulations. The main purpose of this talk is to extend this argument for the S U gauge group to the S U(N) gauge group with an arbitrary N ≥ 3. As the first step, we try to find the true behavior of doublewinding Wilson loops. Actually, in the S U(N) case, if C 1 and C 2 are identical, we can determine the Speaker, e-mail: afca3071@chiba-u.jp. behavior of the averages of double-winding Wilson loops by using group identities and assuming the Casimir Scaling. This fact is already mentioned in in the S U case. In addition, under a reasonable assumption, we can determine the behavior even if C 1 and C 2 are not identical. Consequently, we find that in the S U(N) (N ≥ 3) case, the average of a double-winding Wilson loop does not obey the law similar to that in the S U case, and therefore investigating double-winding Wilson loops is not necessarily appropriate to test the models. This fact leads us to investigate general m-times-winding Wilson loops by following the similar procedures. As a result, we see that we should use N-times-winding Wilson loops to test the models. In the next section, first, we explain how we analyse the averages of double-winding Wilson loops when C 1 and C 2 are identical. Next, we explain how we extend our analysis to the case where C 1 and C 2 are not identical. Lastly, we explain why it is not appropriate for the S U(N) group. In Section 3, we discuss the general m-times-winding case, and conclude that the N-times-winding Wilson loop is appropriate for the S U(N) Yang-Mills theory. Double-winding Wilson loops In this section, we discuss the double-winding Wilson loop. First, we investigate the average of the double-winding Wilson loop when C 1 and C 2 are identical by using the group identity and assuming the Casimir scaling. Next, we discuss the case where C 1 and C 2 are not identical by assuming the factorization of coplanar non-overlapping loops. In the S U case, the expectation value of a double-winding Wilson loop with identical subloops can be estimated by using the group identity where U is an arbitrary element of the group in the fundamental representation and U A is the image of U under the adjoint representation. Representing U in terms of the phase factor, taking the average, and assuming exponential falloff of the Wilson loop in the adjoint representation, we can see that the average approaches a negative constant as the size increases. Similarly, in the S U(N) case, we can also estimate it by using the group identity where the Young diagrams denote the representations, The proof of this formula is given in. Using this group identity the double-winding Wilson loop with identical loops can be written as By using this relation and assuming the Casimir scaling, we can estimate the expectation value for the loop of intermediate size. The ratios of the values of the quadratic Casimir in the above representations to that in the fundamental representation are given by By assuming the Casimir scaling, therefore, in the case that the minimal area S is intermediate, we obtain where a N and b N are positive constants depending on N. For sufficiently large S the dominant part is the second term because (N + 2)/(N + 1) is larger than (N − 2)/(N − 1). For N ≥ 3, this behavior is consistent with neither difference-of-areas law nor sum-of-areas law. Even if C 1 and C 2 are not identical, we can determine the behavior by assuming the factorization of coplanar non-overlapping loops. Here the term "non-overlapping" means that the intersection of the minimal areas of two loops is empty. This assumption is not so strange because this is consistent with the usual area law. By using this assumption, we can decompose a double-winding Wilson loop into the double-winding Wilson loop with the loop C 2 1 and the single-winding Wilson loop with the loop C −1 1 C 2. tr as indicated in Fig. 2. By substituting the result for the identical subloops and usual single winding case Eq., we obtain where c and d are positive constants and A 1 and A 2 are the minimal areas of C 1 and C 2 respectively. This result is consistent with the case of A 1 = A 2 and that of A 1 = 0. In two-dimensional spacetime, we can calculate it exactly as following. Therefore the above result is confirmed at least in two-dimensional spacetime. Now let us discuss whether the behavior Eq. is appropriate to test the models. If A 1 is sufficiently large, the dominant part is the second term. For example, in N = 3 case, the dominant part is which means that the average does not decrease exponentially with A 1. However in the models associated with Abelian monopoles, the average is expected to decrease exponentially with A 1 according to. In this case, therefore, we can use double-winding Wilson loop to discriminate the models. However in N ≥ 4 case, the double-winding Wilson loop is not appropriate to our purpose. This is because, according to Eq., the average decreases exponentially with both A 1 and A 2, and also in the models associated with Abelian monopoles, the similar behavior is expected. This means that to distinguish these two behavior, we need to know the detailed information about the "string tension". General m-times-winding Wilson loops In the previous section, we have shown that for arbitrary S U(N) gauge group, double-winding Wilson loops are not necessarily appropriate to test the models. We can more easily clarify the difference of the models by using the Wilson loop which winds N − 1 times around C 1 and once around C 2. To see this, we consider the general m-times-winding Wilson loop with identical subloops. Also in this case, we can estimate its average by using the group identity. The trace of the mth power of a group element U can be rewritten using the trace of the group elements in the higher dimensional representations: for m < N tr U m = U − U + + (−1) −1 U + + (−1) m−1 U where all diagrams are "L-shape" or "I-shape", there are m boxes in each diagram, and there are raws in the diagram in th term, and for m ≥ N where there are N terms. The proof of this formula is given in. Using this formula and assuming the Casimir scaling, for the loop of an intermediate size, we can determine the dominant term for the average of the m-times-winding Wilson loop with identical subloops as The reason why W N, the expectation value W m for m = N, does not decrease exponentially is as follows. The Young diagram corresponds to the trivial representation if the total number of the boxes is N. Hence, if m = N, the last term is equal to (−1) N−1. In this way we see that W N does not follow the area law. It seems that we can use W N in the S U(N) case in the similar way to the double-winding Wilson loop in S U case. By using the result, we can construct Wilson loops whose averages exhibit the difference-of-areas behavior. One of these is the Wilson loop which winds N − 1 times around C 1 and once around C 2. In the same way as the double-winding case, assuming the factorization of coplanar non-overlapping loops, we obtain where c is a positive constant. To see the Wilson loop Eq. can be used to test the models, let us simply discuss the expected behavior of the average in the center vortex model and the models associated with Abelian monopoles. First in the center vortex model, if the loop is sufficiently large so that the thickness of center vortices is ignored, the difference-of-areas law is expected to hold. The reason is as follows. If a center vortex pierces A 1, it links the loop N times and hence the phase factor is multiplied by the Nth power of an element of center, which is equal to one. This means there are no effects in this case. If a center vortex pierces A 2 −A 1, it links the loop once and hence the effect is the same as the usual single-winding case. Therefore the average is same as that of the single-winding Wilson loop with the minimal area A 2 −A 1. Next we consider the models associated with Abelian monopoles. Let the loop be rectangular. Then the Wilson loop Eq. represents the situation that N quark-antiquark pairs with infinitely large masses are created at a time and annihilated a long time later. In the dual superconductivity picture, the electric flux forms N tubes in this situation and the total energy is the sum of the energy of each flux tube. This means that the average of the Wilson loop decreases exponentially with both A 1 and A 2. This is explicitly distinguishable from the true behavior. Notice that this argument is valid only if we neglect the effect of the off-diagonal gluons. This is because the off-diagonal gluons can neutralize the pair of the quark and the antiquark even if the off-diagonal gluons have large mass, and therefore the strings connecting the quark and the antiquark can break. Next let us consider the case that the loops has asymptotically large size. In this case, we should assume the N-ality dependence of the string tension instead of the Casimir scaling. Then we can estimate the average of the m-times-winding Wilson loop with identical subloops as where k is the asymptotic string tension of a single-winding Wilson loop in the representation whose N-ality is k. For m > N, the loop of intermediate size behaves differently from the loop of asymptotic size. Especially, m = nN (n ∈ N) case is rather special because for the loop of asymptotic size the average of nN-times-winding Wilson loops with identical subloops does not exhibit the area law, while the loops of intermediate size obeys the area law. In this case, the above argument in the center vortex model provides the result for the loop of asymptotic size, which is different from that for the loop of intermediate size. This means that in this case we need to include the effect of thickness of center vortices, i.e. the effect of the off-diagonal gluons. This fact suggests that we cannot neglect the off-diagonal components of the gauge field to consider the quark confinement problem in either cases.
<reponame>MatheusMiranda96/curso-angular import { Component, OnInit, Output, EventEmitter } from '@angular/core'; @Component({ selector: 'app-change-number', templateUrl: './change-number.component.html', styleUrls: ['./change-number.component.scss'] }) export class ChangeNumberComponent implements OnInit { @Output() changeNumber: EventEmitter<any> = new EventEmitter() constructor() { } ngOnInit(): void {} handleClick(){ this.changeNumber.emit(); } }
Quasi-satellite orbits in the general context of dynamics in the 1:1 mean motion resonance. Perturbative treatment Our investigation is motivated by the recent discovery of asteroids orbiting the Sun and simultaneously staying near one of the Solar System planets for a long time. This regime of motion is usually called the quasi-satellite regime, since even at the times of the closest approaches the distance between the asteroid and the planet is significantly larger than the region of space (the Hill's sphere) in which the planet can hold its satellites. We explore the properties of the quasi-satellite regimes in the context of the spatial restricted circular three-body problem"Sun-planet-asteroid". Via double numerical averaging, we construct evolutionary equations which describe the long-term behaviour of the orbital elements of an asteroid. Special attention is paid to possible transitions between the motion in a quasi-satellite orbit and the one in another type of orbits available in the 1:1 resonance. A rough classification of the corresponding evolutionary paths is given for an asteroid's motion with a sufficiently small eccentricity and inclination. Introduction During recent decades, the properties of the so-called quasi-satellite orbits (QSorbits) have been intensively explored. Within the scope of the three body problem "Sun-planet-asteroid", the motion of an asteroid in a QS-orbit corresponds to the 1:1 mean motion resonance, with the resonant argument = − librating around 0 ( and being the mean longitudes of the asteroid and the planet, respectively). The asteroid motion in QS-orbit is bounded to the planet's neighborhood of a size which can be small enough in comparison with the value of semimajor axis a of the planet (Fig. 1). Nevertheless, the trajectory of the asteroid will never cross the Hill sphere of the planet, wherefore the asteroid cannot be considered as a satellite in the usual sense. Fig. 1 The orbital motion of a quasi-satellite and its host planet. Panel a is a Sun-centered reference frame that preserves the orientation in the absolute space. The quasi-satellite and the planet move around the Sun with the same orbital period in elliptic and in circular orbits respectively. Panel b is a Sun-centered frame rotating with the mean orbital motion of the planet. To our knowledge, for the first time the existence of QS-orbits was discussed by Jackson. Long enough the studies of this class of orbits were limited to the consideration of the periodic motions classified as "f-family" by Strmgren. As remarkable from the different points of view we can mention in this context the investigations by Broucke, Henon and Benest. Carrying out his research on the NASA contract Broucke actually anticipated the application of QS-orbits in astrodynamics. Henon proved the (planar) stability of f-family in the Hill approximation and conjectured the existence of the natural retrograde "satellites" that are much farther from the host planet than the collinear libration points L 1 and L 2. Benest established the conditions for threedimensional stability of f-family periodic orbits in the frame CR3BP. At the end of 80th the opportunity to insert a spacecraft into QSorbit around the Martian moon Phobos was thoroughly studied and finally realized in the former USSR (Kogan 1989;Vashkovyak 1993, 1994). Phobos was the goal of the last Soviet interplanetary mission (Sagdeev and Zakharov 1989). Since the Hill sphere of Phobos is very close to its surface it is impossible to circumnavigate it in a Keplerian-type way. Inspired by the results of Henon and Benest A.Yu.Kogan (then a mission specialist at Lavochkin Aerospace company, USSR) proposed a QS-orbit as a solution. Although this mission was only partially successful one of the two launched spacecrafts attained stable QS-orbit (A.Yu. Kogan, private communication). The related activity was reviewed in (Kogan 1990), where in particular the currently popular definition of QS-orbit was formulated probably for the first time: quasi-satellite orbits are the trajectories of restricted three-body problem which are located far beyond the Hill's sphere surrounding the minor primary body and much less distant from it than from the major primary. Later the application of QS-orbits in astrodynamics was considered by Tuchin, Gil and Schwartz and many other specialists. Since outside the Hill sphere the gravity field of the planet is weak enough, a QS-orbit can be treated as a slightly perturbed heliocentric Keplerian ellipse. It offers great opportunities for analytical consideration of the motion in QS-orbits. For the first time such a strategy was applied by Mikkola and Innanen. A little bit later the perturbation approach was used to study the properties of OS-orbits in the papers by Namouni and Namouni et al.. These papers provided the greatest progress in understanding of the key dynamical structures responsible for the long-term evolution at 1:1 mean motion resonance. New types of orbital behavior were described (in particular, the so called compound orbits). The terminology (except for the minor modifications) and the concepts introduced in (Namouni 1999) and () became standard for further theoretical research of QS-orbits (Christou 2000;;, etc.) 1. Below we will be dealing also with many of these concepts. In the last decade the interest to QS-orbits has increased due to the discovery of the actual quasi-satellites for Venus (), Earth Wajer 2009Wajer, 2010, Jupiter (Kinoshita and Nakai 2007) and Neptune (Fuente Marcos and Fuente Marcos 2012). The role of the quasi-satellite dynamics in the early Solar nebula was discussed by Kortenkamp. Giuppone et al. investigated the properties of the QS-motions in extrasolar planetary systems. An important phenomenon revealed by Namouni and Namouni et al. is a possibility for an asteroid in the 1:1 mean motion resonance to change, from time to time, the qualitative character of its orbital motion. In particular, under a special choice of the initial conditions, transitions between the motion in a QS-orbit and that in a horseshoe orbit (HS-orbit) take place. More compli-1 Being evidently unaware about the studies of QS-orbits by specialists in astrodynamics, Namouni and Namouni et al. used for this type of the orbital motion the term "retrograde satellite orbit" taken from the classical investigations of the periodic solutions in RC3BP. Looking through the literature it is easy to note that the community of celestial mechanicians is not uniform regarding what is more preferable. Since our activity was stimulated by the long standing discussions with specialists who coined the term "QS-orbit" in 80th (A.Yu. Kogan, M.L.Lidov and M.A.Vashkovyak), it predetermined our choice. cated scenaria are possible too Namouni 1999;). To study the secular evolution of the resonant motion with qualitative changes in the behavior of the argument, one can apply an approach developed by Wisdom in his investigation of the 3:1 mean motion resonance. This approach is, in fact, general enough and contained no restrictions on the type of the resonant orbit to model (e.g., Yokoyama 1996). In essence it is based on the presence of the adiabatic invariant in the asteroid's dynamics at the resonance. Calculating level curves of the adiabatic invariant one can draw phase portraits characterizing the secular evolution of the motion. The consideration of the adiabatic invariance violation (due to the transitional phenomena) allows to understand the appearance of the chaos in asteroid's motion. The first step in application of Wisdom's method to the 1:1 resonance was carried out in (). In the system's phase space the resonant phenomena are localized: they occur in narrow resonance regions (). It always interesting to compare the properties of the resonant motions with the properties of non-resonant motions when corresponding phase trajectories are close to the border of the resonance region. In the case of 1:1 mean motion resonance a lot of information for such a comparison can be found in the papers on the non-resonant motions of the asteroid and the planet body in the close orbit (e.g., Lidov and Ziglin 1974;Gladman 1993). The goal of our paper is twofold: (i) to establish the conditions at which the motion in QS-orbit is possible, and (ii) to explore when this regime of orbital motion is perpetual and when it is temporary. Wisdom's scheme of the meanmotion resonance analysis allows to notice what was not noticed in the previous studies on quasi-satellite dynamics. Section 2 begins with the description of an averaging procedure used to determine the secular evolution in a mean motion resonance. The first averaging is carried out over the orbital motion, whereafter the phase variables are rescaled, and the problem is shaped into a form called a "slow-fast" system (SF-system). This is a two degrees of freedom Hamiltonian system with the variables evolving at different rates: some variables are "slow", while the other are "fast". The second averaging is then performed over the "fast" motions of the SF-system. This provides us the evolutionary equations describing the secular effects in the asteroid's motion. Section 3 is devoted to the analysis of these secular effects, for various regimes of motion. The transitions between different regimes of orbital motion (QS → HS, HS → QS, etc) are discussed. In Section 4, the consideration is restricted to motion in orbits with a small inclination and eccentricity. In this case, the asteroidal dynamics demonstrates some kind of scaling. Section 5 provides an example of the dynamics of an actual asteroid in a QS-orbit. In Section 6, the summary of the main results is presented. Details of the averaging procedures are elucidated in Appendices A and B. 2 Double averaged motion equations for investigation of dynamics at 1:1 mean-motion resonance Averaging over orbital motions Through all stages of our analysis we shall use the motion equations written in the Hamiltonian form. The units are chosen so that the distance between the primaries (i.e., between the Sun and the planet) is unity, the sum of their masses is also unity, while the period of their rotation around the system's barycenter is 2. Since the mass of the planet is substantially smaller than the mass of the Sun, the quantity is a small parameter of the problem. To start with, we introduce the Delaunay canonical variables (Murray and Dermott 1999) L, G, H, l, g, h, where l is the mean anomaly of the asteroid, the other variables being related to the asteroid's osculating elements (the semimajor axis a, the eccentricity e, the inclination i, the argument of pericenter, the longitude of the ascending node ) by the formulae The canonical relations give the equations of motion of the asteroid: with the Hamiltonian K defined as: R being the disturbing function. For the restricted circular three-body problem the disturbing function admits the form with r = r(L, G, H, l, g, h) and r = r ( ) being the position vectors of the asteroid and the planet relative to the Sun. The brackets around the second term in denote the scalar product. The Hamiltonian K is a function of the time t through its dependence upon the planet's mean longitude (in our units, = t + 0 ). As it follows from the formula, it is reasonable to replace the variable h with the variable h = h−. The new system's Hamiltonian K will be time-independent: Our next step is to perform the canonical transformation (L, G, H, l, g, h) −→ (P, Pg, P h,, g, h) defined by the generating function The relations between new and old variables are: The purpose of transformation is to introduce the resonant phase into the consideration. It is straightforward to verify that where = l + h + g is the asteroid's mean longitude. Once the transformation will be accomplished, the Hamiltonian assumes the form of where an insignificant constant term has been dropped. Let R be a region in the system's phase space, defined by the condition We shall call it the resonant region, since the inequality is equivalent to the inequality |n − n | < ∼ 1/2, where n and n are the mean motions of the asteroid and of the planet respectively 2. In the resonant region, the phase variables evolve at different rates. The variables P, Pg, P h, g are the "slow" ones: The given definition of the resonance region is a standard one for the investigations of the resonant phenomena in multifrequency Hamiltonian system obtained from integrable one by a small perturbation of order (). The asteroid entering into the Hill sphere results in the violation of the last condition (if the integrable Hamiltonian corresponds to asteroid's motion in Keplerian orbit around Sun). For this reason we will consider only those trajectories which are definitely away from the planet's Hill sphere. The perturbation theory should be developed in quite another way if one would like to take into account the dynamical effects close or inside the Hill's sphere (e.g. Robutel and Pousse 2013). while the variable is the "semi-fast": with h being the only "fast" variable in R : dh dt ∼ 1. As usual, the investigation of the secular effects in the motion of the asteroid begins with the averaging over the fast variable. The thus-averaged Hamiltonian corresponds to the Hamiltonian system with two degrees of freedom, and it depends upon P h as a parameter. Instead of the variables Pg, g, it is now convenient to introduce the variables They are defined on the disk With an accuracy of O( 1/2 ), the relations between x, y, P h and the osculating eccentricity and inclination take the form of From Eq., it follows that the centre of the disk D(P h ) corresponds to the motion in a circular orbit. A similar relation for the argument of the pericenter can be written as For a given value of P h, the eccentricity e and the inclination i of the asteroid do not exceed, at any moment of time, the values and respectively. It would be worth dwelling upon the special case of P h ≈ 1. As follows from relations -, this condition implies Therefore this is the situation where the asteroid moves in the orbit of both a small eccentricity and a small inclination (Section 4). To simplify application of the perturbation technique to the analysis of the long-term evolution of motion, it will be instrumental to introduce the auxiliary quantity Under the condition P h ≈ 1, we clearly have ≈ e 2 + i 2 ≪ 1. As it follows from, the quantity characterizes in a certain sense how close the orbit of the asteroid is to the orbit of the planet. At → 0 the orbit of the asteroid becomes more and more close to the orbit of the planet. 2.2 The "slow-fast" system Our next step is standard for the analysis of resonant phenomena in the multifrequency systems (). Following the prescription of this theory, we undertake the scale transformation where = 1/2. Without loss of accuracy, it is possible to rewrite the averaged equations of motion in R as follows: Here The expressions for Pg(x, y) and g(x, y) can be obtained easily from Eq.. Following (Schubart 1964) we apply the numerical integration to compute the averaged disturbing function W (, x, y, P h ). 3 The dynamical system will be called below the "slow-fast" system (or SF-system). Thus we would like to emphasise the existence of a timescale separation: the equations describing the behaviour of the variables, make a "fast" subsystem ( d d, d d ∼ 1 in general), while the "slow" subsystem consists of the equations for the variables x, y ( dx d, dy d ∼ ). Remark. Previously, the variable and its conjugate momentum were classified as "semi-fast" (Sec. 2.1). Averaging allows us to "forget" about the processes on the orbital motion time scale. So in the subsequent analysis of the evolutionary equations we shall regard as a "fast" variable without risk of a confusion. The differential form defines a symplectic structure in the phase space of the SF-system. The Hamiltonian of this system is Finally, it is worth mentioning that differentiation of the averaged disturbing function W (, x, y, P h ) with respect to P h results in the following equation describing the evolution of the longitude of the ascending node: Properties of the fast subsystem Some of the results discussed in this section are not new -they were obtained in (). We rederive them here not only for the purposes of self-containedness: to apply Wisdom's approach in the following sections we need to know more about the properties of the fast subsystem than we were able to learn from the preceding publications. At = 0, the fast dynamics is governed by the one-degree-of-freedom Hamiltonian system which depends on x, y, P h as parameters. Let denote a solution of equations, laying on the level set = : In general, the angle oscillates or rotates: The rotation of the resonant phase corresponds to the motion of the asteroid in the non-resonant orbit. Following () we shall refer to it as the passing orbit or, briefly, the P-orbit. The set of points (x, y) satisfying inequality for given, P h will be denoted with D P (, P h ). Interpretation of oscillatory solutions requires caution since on the same level set = different types of such solutions may exist. Emergence of such variety depends upon the number and location of the local maxima and minima of the function W (, x, y, P h ), for given values of the "parameters" x, y, P h. To illustrate the situation, we present, in Fig. 2, several examples demonstrating various types of behaviour of the function W. Similar to (Garfinkel 1977, Fig.2) and(, Fig.1) the abbreviations near the level lines characterize the secular evolution of the corresponding motion of the asteroid on the intermediate time scale (i.e., on the interval of order 1/ 1/2 in the initial units of time): QS -quasi-satellite orbit, HS -horseshoe orbit, P -passing orbit, T -tadpole orbit, QS+HS -a certain compound orbit (the existence of a variety of compound orbits at 1:1 mean motion resonance was revealed by Namouni et al., more details can be found in (Namouni 1999;Christou 2000); first example of QS+HS orbit appeared in ()). All of the above mentioned orbits (except for the P-orbit only) are described by oscillatory solutions. The middle panel in Fig. 2 corresponds to the asteroid moving in the orbit which crosses the planetary orbit (the function W thus being unlimited). In the limit = 0 the orbits crossing at the exact mean motion resonance ( n = n ) takes place when asteroid's osculating elements satisfy the condition On the plane (, e) the crossing condition defines a curve, separating asteroid's orbits linked and unlinked with the planet's orbit (Fig. 3). The motion in the crossing orbits without a collision is possible due to the resonance. Fig. 3 The partition of the set of asteroid's orbits ( n = n ) provided by the crossing condition : linked orbits -one node inside the planet's orbit, the other is outside; unlinked orbits -both nodes inside the planet's orbit. The blue line is a crossing curve defined by. The diagram is drown in two ways. In what follows we find it is more clear to present the phase portraits in the plane (e, ). Circular diagrams are convenient when we need to show regions satisfying a certain condition. The lower panel in Fig. 2 demonstrates that at some values of x, y, P h motion in a QS-orbit is impossible. The relation between regions where such regimes are possible and the regions where such regimes are impossible is illustrated by Figs 4,5. Specifically, Fig. 4 provides the examples of the set B QS (P h ) ⊂ D(P h ) consisting of the elements (x, y) for which, at a given value of P h, the QS-regime is possible. Similar diagrams in terms of other variables can be found in (Christou 2000, Fig. 2) and (, Fig. 6). Below we suppose to classify the qualitative properties of the asteroid's motion depending on the value of the Hamiltonian. We will use the designation D QS (, P h ) to identify the subset of B QS (P h ) with elements for which there is a solution, corresponding to the motion in QS-orbit. It is easy to show that where min (P h ) denotes the minimal value of, for which the motion in QS-orbit is possible for a given P h. We found numerically that D QS (, P h ) → ∂D(P h ) as min (P h ). Fig. 5 demonstrates typical structural changes of D QS (, P h ), which take place as varies. If is slightly larger than min (P h ), the set D QS (, P h ) has a ringlike shape (Fig. 5,b). At = h (P h ), a bifurcation takes place: holes emerge in the ring. As increases, the number of holes decreases from four (Fig. 5,c) to two (Fig. 5,d). Simultaneously, the size of the holes increases, and at Fig. 6 illustrates the formation of a singularity of the type W ∼ 1/ at = 0, as → 0 (or P h → 1 ). In Section 4, this property will be used to analyze the asteroid motion in a QS-orbit with a small eccentricity and inclination. The right panel in Figure 7 demonstrates that at some x, y, P h we can encounter three different periodic solutions on the same level of the Hamiltonian of the "fast" subsystem. In this paper, the analysis is limited to the case where the behaviour of the function W is described by graphs similar to those presented in Fig. 2 and Fig. 6 (i.e. where a QS-orbit shares the same energy level with a HS-orbit). The examination of the function W led us to conclude that this kind of behaviour is taking place for all (x, y) ∈ D(P h ) at P h > P * h ≈ 0.95924 (or < * ≈ 0.28258 ). As it follows from relations and, this corresponds to the motion of the asteroid in orbits satisfying, for all moments of time, the inequalities So the rest of the paper is devoted to an exploration of the properties of QS-orbits with small and medium values of inclinations and eccentricities. The general situation can be treated in the same way, but it will be a rather cumbersome investigation. Averaging over the resonant phase variations. Evolutionary equations To study the long-term behaviour of slow variables, we use evolutionary equations obtained by averaging of the right hand sides of equations over the solutions of the "fast" subsystem: where ∂W ∂ In the region D QS (, P h ), the averaging procedure provides us with two vector fields, depending on what periodic solution of the "fast" subsystem was chosen in Eq.. One of them describes the evolution of slow variables in the case of asteroid motion in a QS-orbit, the other characterizes the evolution of an HS-orbit. Applying the averaging procedure we should take care of the situation when the solution is non-periodic and corresponds to the separatrix on the "fast" subsystem's phase portrait. Taking this in mind we define in the disk D(P h ) the so-called uncertainty curve (, P h ) (Wisdom 1985;Neishtadt and Sidorenko 2004;Sidorenko 2006):, ∃ * (x, y, P h ) which is a point of a local or global maximum of the function W (, x, y, P h ) ( x, y, P h being treated as parameters) satisfying the condition W ( *, x, y, P h ) = } As it is evident, for a given value of P h the "separatrix" solution exists on the level = only when (x, y) ∈ (, P h ). For ≥ h (P h ) the uncertainty curve consists typically of one or two components: P (, P h ) = ∂D P (, P h ) and QS (, P h ) ⊂ ∂D QS (, P h ) (Fig. 8). For ∈ [ min (P h ), h (P h )) it does not exist. Fig. 8 The location of the uncertainty curve components QS and P for P h = 0.96825, = 3.5. Green represents the areas of the asteroid motion in the passing orbits at these values of P h and. When the projection of the system phase point on the plane (x, y) approaches the uncertainty curve (, P h ) the qualitative changes in the behavior of the resonant phase take place (corresponding, for example, to a transition from a QS-orbit to an HS-orbit or back). To prolongate the solutions of the averaged equations across the uncertainty curve, one can follow a rather straightforward strategy based on the matching of solution with the same limit values at (, P h ). In some cases, this matching is not unique. For example, in Fig. 9,a we present a situation at the border of D QS (, P h ) when one option for continuation results in exiting this region, with a further motion in HS+QS-orbit, while the second option can be described as reflection from the border, with a transition from QS-motion to HS-motion. Since both options are possible in the system, the evolution of the motion near the uncertainty curve in this example has a probabilistic nature 4 (). Similar example is provided by Fig. 9,d. Fig. 9,b and Fig. 9,c present situations where the solution leaves the neighbourhood of QS (, P h ) in a unique way. Fig. 9 Matching of solutions to the evolutionary equations at the uncertainty curve (, P h ) Adiabatic approximation The evolutionary equations provide so called "adiabatic approximation" of the system's long-term dynamics (Wisdom 1985;Yokoyama 1996). Indeed the first two equations in correspond to 1DOF Hamiltonian system depending on slowly varying parameters x, y. Therefore this system approximately preserves the value of the adiabatic invariant (Henrard 4 If we consider the solution of the non-averaged system with the initial conditions x, y exactly on the dynamics is definitely deterministic and depends mainly on to what part of fast subsystem separatrix variables, belong. But far from the uncertainty curve (i.e., deep inside in the yellow zone in our phase portraits) the initial conditions corresponding to the crossing the above mention parts of the separatrix in the plane (, ) are mixed strongly. And a small uncertainty in the initial conditions does not allow us to predict uniquely the qualitative behavior of the system when the phase point leave the vicinity of. Nevertheless, for the set of the possible initial conditions we can compare the measures of subsets resulting in the different qualitative behavior later on and then characterize the dynamics in the probabilistic way. For averaged equations the adiabatic invariant is an exact integral. So the phase trajectories x( ), y( ) are laying on its level curves. The matching of the phase trajectories at satisfies the conditions I HS+QS = I QS + I HS and 2I P = I HS+QS or 2I P = I HS for the components QS and P respectively (indices denote the orbital regimes used to compute the adiabatic invariant ). The validity of the adiabatic approximation is limited due the violation of the adiabatic invariance in the vicinity of the uncertainty curve. The related phenomena are discussed in Sec. 3.2. 3 Investigation of secular effects on the basis of evolutionary equations Comparative analysis for different level sets of the Hamiltonian A good way to understand the evolution of slow variables is to consider the phase portraits of system. As it follows from Sec. 2.5 the drawing of the phase portraits reduces to the drawing of the level curves of the adiabatic invari- Several examples of phase portraits are given in Fig. 10. For better visualization, these portraits present the behaviour of the averaged osculating elements and e given by formulae and. Dependent on the values of, P h, these phase portraits differ in the number of equilibrium points and/or the separatrices placement. There exist some other important features which depend on, P h also. It is interesting to compare these phase portraits with the evolutionary diagrams obtained in (Namouni 1999) by means of direct integration of motion equations. The phase portrait in Fig. 10 resembles Fig. 12 from (Namouni 1999) and represents the situation when the motion in a QS-orbit is impossible ( < min (P h ) ). All trajectories are related to HS-orbits with a circulating argument of the pericenter,. The relatively simple portrait in Fig. 10,b is typical for ∈ ( min, h ). It is the case when transitions between the motion in a QS-orbit and that in an HS-orbit are impossible. As a remarkable property of this case, we can mention the opposite directions of the pericenter circulation for these orbits. There is no similar diagram in (Namouni 1999), because the motion equations were integrated only with the initial conditions corresponding to P-orbits and HS-orbits. More complex behaviour of phase trajectories is presented on the phase portrait in Fig. 10,c (compare with Fig. 13 in (Namouni 1999)). One of the most interesting properties of asteroid motion is associated with the closed contours composed by the phase trajectories related to a QS-orbit and an HS-orbit. Such a contour corresponds to the alternation of the QS-and HS-regimes in orbital motion over a large enough time span. Nevertheless, at a certain moment, this alternation can be violated due to the escape from D QS (, P h ). The opportunity of escape is provided by outgoing trajectory matched to the described contour (Fig. 9,a or d). Numerically, this phenomenon was established by Namouni. The phase portrait in Fig. 10,d demonstrates the further complication of asteroid dynamics as increases. The fission of D QS (, P h ) (the separation of triangular areas from peripheral part) at = s is accompanied by the appearance of a stable equilibrium corresponding to motion in passing orbit with "frozen" pericenter: = 90 or = 270 (Lidov-Kozai resonance). In (Namouni 1999) the passing orbits with librating around Lidov-Kozai resonance at = 90 or = 270 can be seen in Fig. 18. In Fig. 11 we tried to summarize some information about the motion in QSorbits. The choice of parameters ( and = ) is justified by our intention to simplify the structure of the presented diagram. As one can see, there are practically straight-line borders between regions with different properties of QSorbits, and the following limits exist: The regularity of the system properties with respect to proper scaling of parameters stimulates an application of the appropriate perturbation technique for analysis of asteroid dynamics in case ≪ 1 (Section 4). Fig. 11 Dependence of QS-orbit properties on parameters,. Area A: any motion in QSorbit preserves its character forever. Area B: due to the holes in D QS (, P h ) (e.g., Fig.3,c and Fig.3,d) for some initial values the alternating escapes from QS-orbits and returns back become possible. Area C: the configuration of D QS (, P h ) (e.g., Fig.3,e and Fig.3 Chaotization Matching of phase trajectories on the uncertainty curve (, P h ) provides "zeroorder" theory of slow variables evolution in the case of qualitative transformation of fast variables behaviour. Actually in the neighbourhood of (, P h ) the adiabatic invariance is violated. As a consequence the projection of a phase point of the system onto the plane x, y jumps in quasi-random way from the incoming trajectory of the averaged system to some outgoing trajectory located at the distance of the order | ln | from the outgoing trajectory obtained by a formal matching. The accurate estimations of the quasi-random jumps were given in (Timofeev 1978;;Neishtadt 1986. This mechanism of chaotization (giving rise to the so-called adiabatic chaos in the asteroid's dynamics) is typical for mean-motion resonances (Wisdom 1985;Neishtadt and Sidorenko 2004;Sidlichovsky 2005;Sidorenko 2006;Batygin and Morbidelli 2013). It is likely the responsible for the increment of the eccentricity observed by Namouni in the series of the transitions QS → HS →.... Dynamics of the asteroid moving in an orbit of a small eccentricity and inclination In the case of the asteroid moving in an orbit with a small eccentricity and inclination, the resonance condition |n − n | < ∼ 1/2 implies P h ≈ 1 or = 1 − P 2 h ≪ 1 (Section 2.1). Using different simplifying assumptions Namouni derived analytical expressions characterizing the secular evolution of QS-orbits, HS-orbits and P-orbits. Our goal is to provide a qualitative description of long-term dynamics for any resonant orbit with a small eccentricity and inclination satisfying the only restriction imposed at the beginning of the paper: do not approach the Hill sphere of the planet. In particular it implies 1/3 ≪ ≪ 1. To achieve our goal we must consider the motions which do not satisfy the simplifying assumptions applied in (Namouni 1999). The leading term in the expression for the averaged disturbing function W Graphs presented in Fig. 6 demonstrate two important properties of the averaged disturbing function at → 0 ( P h → 1 ): (i) the increase of its values for a resonant phase close to zero, and (ii) the decrease of the profile "thickness" (i.e., the decrease of the interval of resonant phase values at which W ∼ 1/ ). Analytically, it implies the following structure for the function W : +{Residual term which is in general of the order of 1}, Now we shall address the approximate evolutionary equations obtained by approximating W with its leading term only. To that end, it will be useful to discuss the main properties of the function W (, x, y). The function W is defined on the set R 1 D 2 \ D 0, where The following symmetries are easy to verify: It is noteworthy that, for a given values x, y, the function W is even with respect to, while the function W does not, in general, possesses this property. In the studies of QS-orbits, the excessive symmetry of the dynamical model based on truncated expression for the disturbing function were mentioned previously by Mikkola et al.. This symmetry should not be surprising: in a non-explicit way, here we apply the Hill's approximation of the three body problem; the excessive symmetry of Hill's approximation (in comparison with the original problem) is well known (Henon 1997). The function W (, x, y) and its derivatives ∂W ∂x, ∂W ∂y, ∂W ∂ can be expressed in terms of the elliptic integrals of the first and second kind (Appendix B). One can use these expressions to accelerate numerical computations at the stage of averaging over the resonant phase oscillations/rotations. In the case of ∼ (x 2 + y 2 ) 1/2 ≪ 1, the following approximate formula can be derived: Expression allows one to understand better the behaviour of the function W (, x, y) for small enough, x, y, i.e., when this function becomes singular. Fig. 13 Examples of the set D QS () structure: 4.2 Derivation of the evolutionary equations in the case of the leading term approximation for W If the leading term approximation is used for W, the equations for fast subsystem can be rewritten as where We are interested in oscillatory solutions to Eqs., as this naturally provides the approximation for solutions to Eqs., corresponding to QS-regimes of the orbital motion. Let the pair (, x, y, ), (, x, y, ), denote a solution to Eqs., satisfying the equality 3 2 at any moment ∈ R 1 ( x, y being considered as fixed parameters). This solution exists only in the case of (x, y) ∈ D QS (), where D QS () = (x, y) ∈ D 2 : W (0, x, y) <, ∂ 2 W ∂ 2 (0, x, y) > 0 Fig. 13 illustrates the dependence of D QS () on. The changes in the structure of this set resemble the changes of the set D QS (, P h ) when varies (Fig. 5), although in general the leading term approximation of the disturbing function results in the loss of certain fine details (some of them we discuss below). For ∈ ( min, h ), the set D QS () has a ring-like structure ( min, h have been defined at the end of Section 3.1). Using the expression for W in terms of elliptic integrals, one obtains:.. ) the borders of these holes approach the "external" border of D QS (). The difference between the values of b and * b is probably the consequence of the excessive symmetry of Hill's approximation mentioned above (one more consequence being the existence of only two holes in D QS () for all ∈ ( h, * b ) ). The solution is used to obtain an approximate expression for the righthand sides of equations describing the evolution of the slow variables on the level set = / for the case of the asteroid moving in a QS-orbit: Here T () denotes the period of oscillatory solutions, while = x, y and = x, y. In the case of the asteroid moving in HS-or P-orbits, construction of similar approximate expression is a more delicate procedure since there is no suitable periodic solution to the auxiliary system. However one can use non-periodic solutions to this system. Specifically, let us consider the solution to Eqs, corresponding to motion in an HS-orbit with = / ≫ 1. A crude (but sufficient for our purposes) estimate of its period is Due to the afore-mentioned symmetry of the leading term in the expression for the disturbing function, averaging can be performed over the reduced time interval: Then we can replace (, /, P h ()/) in the expression with the function (, ), which provides (in combination with (, ) = d/d ) a non-periodic solution to, satisfying the conditions: This results in To finish up, we replace the period T in Eq. with its approximate expression and expand the integration over the positive semiaxis (since −3/2 T (/) approaches infinity as → 0 ): The convergence of the integral in Eq. can be proven rigorously: it follows from the rapid decrease of the function W at → ∞. Physically, the approximation means that in the case of motion in an HS-orbit the evolution of slow variables ( e,, i, ) is substantial only during close approaches of the asteroid to the planet. In a similar way, the "averaging" can be done for the motion in a P-orbit. Formally, the ensuing expression coincides with, but the function (, ) is rendered in this case by a solution to Eq., satisfying the conditions: Dynamics of the asteroid. Estimations based on the approximate evolutionary equations Insertion of expressions and into Eqs. furnishes approximate equations characterising the secular evolution of asteroid motion in a near-circular low-inclination orbit in the 1:1 resonance. In Fig. 14, we present examples of the phase portraits corresponding to the approximate evolutionary equations. The behaviour of the phase trajectories has a remarkable similarity: it does not depend on, if we use emax as a unit for length along the vertical axis. Fig. 14,a is practically identical to Fig. 10,b -it illustrates that the approximate equations are best of all suited for the description of the motion without qualitative changes in the behavior of the resonant phase (i.e., asteroid moves permanently in a QS-or HS-orbit). Fig. 14,b resembles Fig. 10,c except for the location of the regions corresponding to P-orbits (these regions are painted in green). The difference emerges due to the absence of compound QS+HS-regimes in the model based on the leadingterm approximation of W (this is another consequence of its excessive symmetry). So the model discussed above should be applied with caution for the analysis of motions with transitions between different types of orbits. The approximate expressions and for the averaged derivatives of W allow one to estimate the rates of the evolution of the orbital elements: for the case of motion in a QS-orbit, and for other types of orbital motion. As it follows from Eqs.,, evolution is faster for motion in a QS-orbit. This is not surprising since for such an orbit the mean distance from the asteroid to the planet is smaller than for other types of orbits and, consequently, the perturbations due to the attraction of the asteroid by the planet are more substantial. For motion with transitions between different types of orbital behaviour, formulae and yield the following estimates where T QS and T HS,P,... denote the duration of motion in a (temporary) QSorbit and in orbits of other types, respectively. An evident consequence of is: As it was mention at the beginning of this Section under some additional assumptions Namouni derived analytical expressions describing the secular evolution of the orbits under investigation. In particular, his formulas for QS-orbits are limited to the case when the resonant phase does not oscillate -i.e., the "fast" subsystem is in "quasi-steady" equilibrium close to local minimum of the averaged disturbing function W (, x, y, P h ) (in our phase portraits the motions in these orbits correspond to trajectories at the lower boundary of the yellow areas). The HS-orbits in (Namouni 1999, Sec. 4.1) approach the close vicinity of the planet's Hill sphere what is beyond the scope of our analysis. The consideration of P-orbits in (Namouni 1999, Sec. 4.2) will be commented in the Section 4.4. Some remarks about the properties of the motion in the passing orbits with small eccentricity and inclination The relation of the Fig. 3 and Fig. 10,d leads to a conclusion that there are two topologically different types of the passing orbits. The passing orbits with librating around 0 or 180 are linked with the orbit of the planet. The libration of around 90 or 270 takes place in the case of the motion in unlinked passing orbits. To study the motion in linked passing orbits Namouni applied the averaging over the resonant phase neglecting the variations in its rate. Formally it is identical to the averaging over motion in the close nonresonant orbits undertaken by Lidov and Ziglin. As a result, the expressions for double-averaged disturbing function in these papers differ by designations only. But then Lidov and Ziglin only mentioned the existence of the "centre" type equilibrium at e = / √ 2, = 0 or = 180, while Namouni derived the analytical solution to the system of the evolutionary equations. For small but non-zero values of the regions of the unlinked orbits can be described as the tiny triangles encompassing the lines = 90 and = 270. As a consequence of the results presented in (Lidov and Ziglin 1974) one can obtain for unlinked passing orbits the existence of the "centre" type equilibrium at e ≈ 2 3, = 90 or = 270, what is in a good agreement with the numerical investigations. 5 Example: the future escape of asteroid 2004GU9 from the QS-orbit Now we apply the evolutionary equations for the analysis of secular effects in orbital motion of the near-Earth asteroid 2004GU9. The restricted circular threebody problem is insufficient for accurate investigation of the actual asteroid dynamics. So we are interested more in understanding of the time scales involved and of some other quantitative characteristics of the phenomena discussed in previous Sections. Currently, asteroid 2004GU9 is moving along a QS-orbit with osculating elements presented in Table 1 (;Wajer 2010). We chose it among the other quasi-satellites of the Earth due to the absence of this object's close encounters with Venus and Mars -this restriction justifies, to some extent, the investigation of the secular effects under the scope of RC3BP. Fig. 15 demonstrates the behaviour of the resonant phase according to the results of direct numerical integration of the equations of motion corresponding to RC3BP with the initial values provided by the elements in Table 1 and the mass parameter = 3.04 10 −6 (we added the mass of the Moon to the mass of the Earth). The motion in a QS-orbit will last for approximately 500 years, with a subsequent transition to an HS-orbit. In (Wajer 2010), similar conclusion has been achieved via taking into account the gravitational pull of all other Solar system planets, as well as the Moon and Pluto. The graphs in Fig. 16 allow us to compare the long term evolution of the osculating elements, according to Eqs., with the results of a direct numerical integration. In Fig. 17 we present the projection of the asteroid phase trajectory onto the plane, e (red line). Black lines correspond to the appropriate phase trajectories of the system when the matching at the uncertainty curve is accomplished according to the procedure described in Sec.2.4. Fig. 16 and Fig. 17 demonstrate that our approach based on double averaging of the equations of motion provides a really accurate description of the secular evolution. Conclusion In this paper we have considered the three body system "Sun-planet-asteroid" in the 1:1 mean-motion resonance. A special attention was given to the motion of the asteroid in a quasi-satellite orbit, when the asteroid is located (permanently or for a long enough time) in the vicinity of the planet, though being out of the planet's Hill sphere. As usual, in the mean-motion resonance three dynamical time scales can be distinguished. The "fast" process corresponds to the planet and asteroid orbital motions. The "semi-fast" process is a variation of the resonant phase (which, in a certain sense, describes the relative position of the planet and asteroid in their orbital motion). Finally, the "slow" process is the secular evolution of the orbit's shape (the eccentricity) and orientation (the longitude of the ascending node, the inclination, and the argument of the pericenter). To study the "slow" process, we constructed the evolutionary equations by means of numerical averaging over the "fast" and "semi-fast" motion. As a spe- cific feature of these evolutionary equations, we should point out the ambiguity of their right-hand sides for some values of the "slow" variables. The ambiguity appears because the averaging can be performed over the "semi-fast" processes with qualitatively different properties (in other words, it can be done over a QS-orbit, or an HS-orbit, with the same values of the Hamiltonian ). Consideration of this ambiguity provided us with an opportunity to predict whether the motions in QSor HS-orbits are permanent or not. For non-permanent motions in QS-orbits, the conditions of capture into this regime and escape from it have been established. For clarity, our analysis was restricted to the case of the asteroid motion in orbits with small and intermediate values of the inclinations and eccentricities, when maximum two regimes of the "semi-fast" evolution are possible. The general case can be studied similarly. The evolutionary equations were used to draw the phase portraits demonstrating in a clear way the secular effects in the asteroid motion (for example, the libration or oscillation of the pericenter). Some kind of scaling has been found in the asteroid dynamics at small inclinations and eccentricities. It has turned out that in this case many properties of the motion (for example, the duration of the QS-regime) can be established using the Hill approximation in the restricted circular three-body problem. The excessive symmetry of this approximation creates a difficulty for correct description of all possible modes of motion, but hopefully it can be overcomed after taking into account the high order terms of perturbation theory. To illustrate the typical rates of the orbital elements's secular evolution, the dynamics of the near-Earth asteroid 2004GU9 was considered. This asteroid will keep its motion in a QS-orbit for the next several hundred years. For better prediction, our model should be improved by taking into account the influence of the other planets (Venus, Mars, Jupiter, etc), along with the appropriate modification of the averaging procedure. Appendix A. Calculation of the function W and its derivatives Below we describe some technical details of the computational procedure which has been applied to obtain numerically the values of the averaged disturbing function As a result, the expressions for W and its derivative can be written as The "minus" sign before the integrals in formulae (A.3) appears due to our intention to have the upper limit larger than the lower one. 2. Derivatives of R with respect to, x, y, P h. At this point, we need to introduce the uniformly rotating heliocentric reference frame O with the axis O being directed from the Sun to the planet and the axis O being aligned with the normal to the plane of the primary's orbital motion. In this reference frame the position vector of the planet is r = e, where e = T is the unit vector corresponding to axis O. Respectively the expression for disturbing function is reduced to 3. Position vector of the asteroid. Let the unit vector e * be directed to the pericenter of the osculating orbit, while one more unit vector e * is parallel to this orbit's minor semi-axis (and directed in the same way as asteroid's velocity vector at the pericenter). It is not difficult to write down the expressions for introduced unit vectors through their projections on the axes of the reference frame O : After that the asteroid's position vector r can be written as the linear combination r(i, e,, h, E) = e * (i,, h) * (e, E) + e * (i,, h) * (e, E) (A.6) with the coefficients (here the orbit with a = 1 is considered) * (e, E) = cos E − e, * (e, E) = 1 − e 2 sin E. 4. Derivatives of the position vector r with respect to, x, y, P h. Taking into account (A.2) and (A.6) we obtain the following relations: The derivatives of the unit vectors e * and e * in (A.7) can be easily evaluated from (A.4) and (A.5) respectively. 6. Derivatives of the osculating variables e, i, with respect to x, y, P h. First we rewrite the expressions for e, cos i, sin i in a more compact way (compare with ): e = s(x 2 + y 2 ) 2, (A.8) Here s = 4 − (x 2 + y 2 ). We can add also that the value of W at = 0 is provided by the formula (B.5) Up to notations the formula (B.5) coincides with the formula for the secular potential in Namouni which was used there to study the limiting case of QS-orbits with non-oscillating resonant phase.
// IsInCodeSet checks if a code is in the list of possible codes func (c *Coded) IsInCodeSet(codeSet []CodeSet) bool { for codeSystem, _ := range c.Codes { for _, set := range codeSet { if set.Set == codeSystem { if doSetsIntersect(set.Values, c.Codes[codeSystem]) { return true } } } } return false }
package contexts import ( "testing" "golang.org/x/net/context" ) func BenchmarkValue1(b *testing.B) { benchmarkValue(1, b) } func BenchmarkValue2(b *testing.B) { benchmarkValue(2, b) } func BenchmarkValue4(b *testing.B) { benchmarkValue(4, b) } func BenchmarkValue8(b *testing.B) { benchmarkValue(8, b) } func BenchmarkValue16(b *testing.B) { benchmarkValue(16, b) } func BenchmarkValue32(b *testing.B) { benchmarkValue(32, b) } func benchmarkValue(cnt int, b *testing.B) { values := make(map[interface{}]interface{}) for i := 0; i < cnt; i++ { values[i] = i } ctx := WithValues(context.Background(), values) for n := 0; n < b.N; n++ { ctx.Value(0) } } func BenchmarkStdValue1(b *testing.B) { benchmarkStdValue(1, b) } func BenchmarkStdValue2(b *testing.B) { benchmarkStdValue(2, b) } func BenchmarkStdValue4(b *testing.B) { benchmarkStdValue(4, b) } func BenchmarkStdValue8(b *testing.B) { benchmarkStdValue(8, b) } func BenchmarkStdValue16(b *testing.B) { benchmarkStdValue(16, b) } func BenchmarkStdValue32(b *testing.B) { benchmarkStdValue(32, b) } func benchmarkStdValue(cnt int, b *testing.B) { ctx := context.Background() for i := 0; i < cnt; i++ { ctx = context.WithValue(ctx, i, i) } for n := 0; n < b.N; n++ { ctx.Value(0) } } func BenchmarkWithValue1(b *testing.B) { benchmarkWithValue(1, b) } func BenchmarkWithValue2(b *testing.B) { benchmarkWithValue(2, b) } func BenchmarkWithValue4(b *testing.B) { benchmarkWithValue(4, b) } func BenchmarkWithValue8(b *testing.B) { benchmarkWithValue(8, b) } func BenchmarkWithValue16(b *testing.B) { benchmarkWithValue(16, b) } func BenchmarkWithValue32(b *testing.B) { benchmarkWithValue(32, b) } func benchmarkWithValue(cnt int, b *testing.B) { for n := 0; n < b.N; n++ { values := make(map[interface{}]interface{}) for i := 0; i < cnt; i++ { values[i] = i } _ = WithValues(context.Background(), values) } } func BenchmarkStdWithValue1(b *testing.B) { benchmarkStdWithValue(1, b) } func BenchmarkStdWithValue2(b *testing.B) { benchmarkStdWithValue(2, b) } func BenchmarkStdWithValue4(b *testing.B) { benchmarkStdWithValue(4, b) } func BenchmarkStdWithValue8(b *testing.B) { benchmarkStdWithValue(8, b) } func BenchmarkStdWithValue16(b *testing.B) { benchmarkStdWithValue(16, b) } func BenchmarkStdWithValue32(b *testing.B) { benchmarkStdWithValue(32, b) } func benchmarkStdWithValue(cnt int, b *testing.B) { for n := 0; n < b.N; n++ { ctx := context.Background() for i := 0; i < cnt; i++ { ctx = context.WithValue(ctx, i, i) } } } func BenchmarkWithValuePersist1(b *testing.B) { benchmarkWithValuePersist(1, b) } func BenchmarkWithValuePersist2(b *testing.B) { benchmarkWithValuePersist(2, b) } func BenchmarkWithValuePersist4(b *testing.B) { benchmarkWithValuePersist(4, b) } func BenchmarkWithValuePersist8(b *testing.B) { benchmarkWithValuePersist(8, b) } func BenchmarkWithValuePersist16(b *testing.B) { benchmarkWithValuePersist(16, b) } func BenchmarkWithValuePersist32(b *testing.B) { benchmarkWithValuePersist(32, b) } func benchmarkWithValuePersist(cnt int, b *testing.B) { values := make(map[interface{}]interface{}) for i := 0; i < cnt; i++ { values[i] = i } b.ResetTimer() for n := 0; n < b.N; n++ { _ = WithValues(context.Background(), values) } }
<filename>services/rest/src/test/java/org/locationtech/geowave/service/rest/GeoWaveOperationServiceWrapperTest.java /** * Copyright (c) 2013-2020 Contributors to the Eclipse Foundation * * <p> See the NOTICE file distributed with this work for additional information regarding copyright * ownership. All rights reserved. This program and the accompanying materials are made available * under the terms of the Apache License, Version 2.0 which accompanies this distribution and is * available at http://www.apache.org/licenses/LICENSE-2.0.txt */ package org.locationtech.geowave.service.rest; import java.io.IOException; import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.Ignore; import org.junit.Test; import org.locationtech.geowave.core.cli.api.ServiceEnabledCommand; import org.locationtech.geowave.core.cli.api.ServiceEnabledCommand.HttpMethod; import org.mockito.Matchers; import org.mockito.Mockito; import org.restlet.Request; import org.restlet.Response; import org.restlet.data.MediaType; import org.restlet.data.Method; import org.restlet.data.Status; import org.restlet.representation.Representation; public class GeoWaveOperationServiceWrapperTest { private GeoWaveOperationServiceWrapper classUnderTest; private ServiceEnabledCommand mockedOperation( final HttpMethod method, final Boolean successStatusIs200) throws Exception { return mockedOperation(method, successStatusIs200, false); } private ServiceEnabledCommand mockedOperation( final HttpMethod method, final Boolean successStatusIs200, final boolean isAsync) throws Exception { final ServiceEnabledCommand operation = Mockito.mock(ServiceEnabledCommand.class); Mockito.when(operation.getMethod()).thenReturn(method); Mockito.when(operation.runAsync()).thenReturn(isAsync); Mockito.when(operation.successStatusIs200()).thenReturn(successStatusIs200); Mockito.when(operation.computeResults(Matchers.any())).thenReturn(null); return operation; } private Representation mockedRequest(final MediaType mediaType) throws IOException { final Representation request = Mockito.mock(Representation.class); Mockito.when(request.getMediaType()).thenReturn(mediaType); Mockito.when(request.getText()).thenReturn("{}"); return request; } @Before public void setUp() throws Exception {} @After public void tearDown() throws Exception {} @Test public void getMethodReturnsSuccessStatus() throws Exception { // Rarely used Teapot Code to check. final Boolean successStatusIs200 = true; final ServiceEnabledCommand operation = mockedOperation(HttpMethod.GET, successStatusIs200); classUnderTest = new GeoWaveOperationServiceWrapper(operation, null); classUnderTest.setResponse(new Response(null)); classUnderTest.setRequest(new Request(Method.GET, "foo.bar")); classUnderTest.restGet(); Assert.assertEquals( successStatusIs200, classUnderTest.getResponse().getStatus().equals(Status.SUCCESS_OK)); } @Test public void postMethodReturnsSuccessStatus() throws Exception { // Rarely used Teapot Code to check. final Boolean successStatusIs200 = false; final ServiceEnabledCommand operation = mockedOperation(HttpMethod.POST, successStatusIs200); classUnderTest = new GeoWaveOperationServiceWrapper(operation, null); classUnderTest.setResponse(new Response(null)); classUnderTest.restPost(mockedRequest(MediaType.APPLICATION_JSON)); Assert.assertEquals( successStatusIs200, classUnderTest.getResponse().getStatus().equals(Status.SUCCESS_OK)); } @Test @Ignore public void asyncMethodReturnsSuccessStatus() throws Exception { // Rarely used Teapot Code to check. final Boolean successStatusIs200 = true; final ServiceEnabledCommand operation = mockedOperation(HttpMethod.POST, successStatusIs200, true); classUnderTest = new GeoWaveOperationServiceWrapper(operation, null); classUnderTest.setResponse(new Response(null)); classUnderTest.restPost(null); // TODO: Returns 500. Error Caught at // "final Context appContext = Application.getCurrent().getContext();" Assert.assertEquals( successStatusIs200, classUnderTest.getResponse().getStatus().equals(Status.SUCCESS_OK)); } }
Interest Cannot Be Forced. The Role of Academic Motivation and Teaching Styles in the Development of Students Critical Thinking In a situation of a sharp increase in the volume of information, often including a large number of false facts of various nature (disinformation), critical thinking becomes one of the competencies, the formation of which is decided by the scientific and educational community. Scientists identify academic motivation and teaching styles as factors associated with the development of critical thinking. The relationship between these factors and critical thinking has previously been studied only in relation to the dichotomous scale of academic motivation, consisting of intrinsic and extrinsic motivation. The relationship of other types of motivation identified in the theory of self-determination E.L. Desi and R.M. Ryan has not been studied. This study, conducted on a sample of economics students at the Russian National Research University (4867 students), is intended to contribute to this discussion. Authors determine which teaching style leads to the activation of learning motivation, identified within the theory of self-determination. In addition, which types of learning motivation are predictors of the development of critical thinking. The analysis was carried out using the method of multivariate regression with the inclusion of variables of mediators. This will allow to identify teaching methods associated with the activation of the necessary types of motivation, and, as a result, an increase in the educational results associated with them. However, despite the authors attempts to identify additional types of academic motivation positively associated with CT within the subscale of extrinsic motivation, it was proved that only types of intrinsic motivation were positively associated with the construct under study. They are activated when the constructivist style of teaching is applied, which, among other things, explains its effectiveness in relation to the development of a given construct.
#pragma once #include <stack> #include <string> #include <string_view> #include <optional> #include <bencode/detail/bvalue/basic_bvalue.hpp> #include <bencode/detail/events/concepts.hpp> namespace bencode::detail { template <typename Policy, typename U, event_consumer EC> constexpr void connect_events_runtime_impl( customization_point_type<basic_bvalue<Policy>>, EC& consumer, U&& value, priority_tag<1>) { using vt = bencode::bencode_type; switch (value.type()) { case vt::uninitialized: break; case vt::integer: { consumer.integer(get_integer(value)); break; } case vt::string: { consumer.string(get_string(value)); break; } case vt::list: { const auto& list = get_list(value); std::size_t size = list.size(); consumer.list_begin(size); for (const auto& v : get_list(value)) { connect(consumer, v); consumer.list_item(); } consumer.list_end(); break; } case vt::dict: { const auto& dict = get_dict(value); std::size_t size = dict.size(); consumer.dict_begin(size); for (const auto&[k, v] : dict) { consumer.string(k); consumer.dict_key(); connect(consumer, v); consumer.dict_value(); } consumer.dict_end(); break; } } } } // bencode::detail
#include <iostream> #include <utility> #include <vector> #include <list> #include <unordered_set> #include <set> #include <unordered_map> #include <map> #include <stack> #include <queue> #include <cassert> #include <cmath> #include <algorithm> #include <stdlib.h> #include <stdio.h> #include <fstream> #include <tuple> //....................................................................................................................// using std::cin; using std::cout; using std::vector; using std::list; using std::unordered_set; using std::set; using std::map; using std::unordered_map; using std::multimap; using std::unordered_multimap; using std::pair; using std::make_pair; using std::min; using std::max; using std::swap; using std::stack; using std::deque; using std::queue; using std::ios_base; using std::ifstream; using std::ofstream; using std::string; using std::tuple; using std::make_tuple; using std::get; using std::upper_bound; using std::lower_bound; using std::max_element; using std::min_element; using std::multiset; using std::greater; using std::priority_queue; using std::less; //....................................................................................................................// typedef long long ll; typedef unsigned long long ull; typedef unsigned long ul; [[maybe_unused]] const string endl = "\n"; [[maybe_unused]] const string sep = " "; [[maybe_unused]] const string yes = "YES\n"; [[maybe_unused]] const string no = "NO\n"; [[maybe_unused]] const string ng = "NG\n"; [[maybe_unused]] const string ok = "OK\n"; [[maybe_unused]] const double pi = acos(-1); [[maybe_unused]] const ull modular = 998244353; //....................................................................................................................// int main() { cin.tie(nullptr); cout.tie(nullptr); std::ios_base::sync_with_stdio(false); cout.precision(15); int n, m; cin >> n >> m; map<int, set<int>> M; for (int i = 0; i < m; ++i) { int a, b; cin >> a >> b; M[a].insert(b); M[b].insert(a); } vector<int> V(n + 1, -1); V[1] = 0; V[0] = 0; queue<int> Q; Q.push(1); while(!Q.empty()) { auto x = Q.front(); Q.pop(); for (auto t : M[x]) { if (V[t] == -1) { Q.push(t); V[t] = x; } } } if (*min_element(V.begin(), V.end()) == -1) { cout << "No"; } else { cout << "Yes" << endl; for (int i = 2; i <= n; ++i) { cout << V[i] << endl; } } }
/** * Table model that shows a location, label, and a preview column to * show a preview of the code unit. The location can be in a memory address, * a stack address, or a register address. The label is the primary symbol * at the address, if one exists. Use this model when you have a list of * addresses to build up dynamically. */ public abstract class AddressPreviewTableModel extends AddressBasedTableModel<Address> { private int selectionSize = 1; /** * Constructor. * * @param modelName the name of the model (used for the title) * @param serviceProvider from which to get services * @param program the program upon which this model is being used * @param monitor the monitor to use for tracking progress and cancelling; may be null */ protected AddressPreviewTableModel(String modelName, ServiceProvider serviceProvider, Program program, TaskMonitor monitor) { this(modelName, serviceProvider, program, monitor, false); } /** * Constructor. * * @param modelName the name of the model (used for the title) * @param serviceProvider from which to get services * @param program the program upon which this model is being used * @param monitor the monitor to use for tracking progress and cancelling; may be null * @param loadIncrementally true signals to show table results as they come in */ protected AddressPreviewTableModel(String modelName, ServiceProvider serviceProvider, Program program, TaskMonitor monitor, boolean loadIncrementally) { super(modelName, serviceProvider, program, monitor, loadIncrementally); } /** * Sets the size of the selections generated by this model when asked to create * program selections. For example, some clients know that each table row represents * a contiguous range of 4 addresses. In this case, when the user makes a selection, * that client wants the selection to be 4 addresses, starting at the address in * the given table row. * * @param size the size of the selections generated by this model when asked to create * program selections. */ public void setSelectionSize(int size) { if (size <= 0) { throw new IllegalArgumentException("Selection size must be at least 1; found size " + size); } this.selectionSize = size; } @Override public Address getAddress(int row) { return getRowObject(row); } @Override public ProgramSelection getProgramSelection(int[] rows) { if (selectionSize == 1) { return super.getProgramSelection(rows); } int addOn = selectionSize - 1; AddressSet addressSet = new AddressSet(); for (int element : rows) { Address minAddr = getAddress(element); Address maxAddr = minAddr; try { maxAddr = minAddr.addNoWrap(addOn); addressSet.addRange(minAddr, maxAddr); } catch (AddressOverflowException e) { Msg.debug(this, "Unable to add address range for addresses: " + minAddr + ", " + maxAddr); } } return new ProgramSelection(addressSet); } }
<reponame>xy666aso/OpenSCA-cli /* * @Descripation: 从本地漏洞库获取漏洞 * @Date: 2021-12-08 16:31:45 */ package vuln import ( "encoding/json" "io/ioutil" "opensca/internal/args" "opensca/internal/enum/language" "opensca/internal/logs" "opensca/internal/srt" "strings" ) type vulnInfo struct { Vendor string `json:"vendor"` Product string `json:"product"` Version string `json:"version"` Language string `json:"language"` *srt.Vuln } // 漏洞信息 map[language]map[name][]vulninfo var vulnDB map[string]map[string][]vulnInfo /** * @description: 加载本地漏洞 */ func loadVulnDB() { vulnDB = map[string]map[string][]vulnInfo{} if args.VulnDB != "" { // 读取本地漏洞数据 if data, err := ioutil.ReadFile(args.VulnDB); err != nil { logs.Error(err) } else { // 解析本地漏洞 db := []vulnInfo{} json.Unmarshal(data, &db) for _, info := range db { // 有中文描述则省略英文描述 if info.Description != "" { info.DescriptionEn = "" } // 将漏洞信息存到vulnDB中 name := strings.ToLower(info.Product) if _, ok := vulnDB[info.Language]; !ok { vulnDB[info.Language] = map[string][]vulnInfo{} } vulns := vulnDB[info.Language] vulns[name] = append(vulns[name], info) } } } } /** * @description: 使用本地漏洞库获取漏洞 * @param {[]srt.Dependency} deps 组件依赖信息列表 * @return {[][]*srt.Vuln} 组件漏洞列表 */ func GetLocalVulns(deps []srt.Dependency) (vulns [][]*srt.Vuln) { if vulnDB == nil { loadVulnDB() } vulns = make([][]*srt.Vuln, len(deps)) for i, dep := range deps { vulns[i] = []*srt.Vuln{} if vs, ok := vulnDB[dep.Language.Vuln()][strings.ToLower(dep.Name)]; ok { for _, v := range vs { switch dep.Language { case language.Java: if !strings.EqualFold(v.Vendor, dep.Vendor) { continue } default: } // 在漏洞影响范围内 if srt.InRangeInterval(dep.Version, v.Version) { vulns[i] = append(vulns[i], v.Vuln) } } } } return }
<reponame>dpb587/go-schemaorg package howto import "github.com/dpb587/go-schemaorg" // // Instructions that explain how to achieve a result by performing a sequence of // steps. var Type = schemaorg.NewDataType("http://schema.org", "HowTo") func New() *schemaorg.Thing { return schemaorg.NewThing(Type) }
Evaluation of aerosol generator devices at 3 locations in humidified and non-humidified circuits during adult mechanical ventilation. BACKGROUND The position of the jet or ultrasonic nebulizer in the ventilator circuit impacts drug delivery during mechanical ventilation, but has not been extensively explored, and no study has examined all of the commonly used nebulizers. METHODS Drug delivery from jet, vibrating-mesh, and ultrasonic nebulizers and pressurized metered-dose inhaler (pMDI) with spacer was compared in a model of adult mechanical ventilation, with heated/humidified and non-humidified ventilator circuits. Albuterol sulfate was aerosolized at 3 circuit positions: between the endotracheal tube and the Y-piece; 15 cm from Y-piece; and 15 cm from the ventilator, with each device (n = 3) using adult settings (tidal volume 500 mL, ramp flow pattern, 15 breaths/min, peak inspiratory flow 60 L/min, and PEEP 5 cm HO). The drug deposited on an absolute filter distal to an 8.0-mm inner-diameter endotracheal tube was eluted and analyzed via spectrophotometry (276 nm), and is reported as mean +/- SD percent of total nominal or emitted dose. RESULTS The vibrating-mesh nebulizer, ultrasonic nebulizer, and pMDI with spacer were most efficient in position 2 with both non-humidified (30.2 +/- 1.0%, 24.7 +/- 4.4%, and 27.8 +/- 3.3%, respectively) and heated/humidified circuits (16.8 +/- 2.6%, 16.5 +/- 4.3%, and 17 +/- 1.0%, respectively). In contrast, the jet nebulizer was most efficient in position 3 under both non-humidified (14.7 +/- 1.5%) and heated/humidified (6.0 +/- 0.1%) conditions. In positions 2 and 3, all devices delivered approximately 2-fold more drug under non-humidified than under heated/humidified conditions (P <.01). At position 1 only the pMDI delivered substantially more drug than with the non-humidified circuit. CONCLUSION During mechanical ventilation the optimal drug delivery efficiency depends on the aerosol generator, the ventilator circuit, and the aerosol generator position.
<reponame>cptpcrd/capctl use core::fmt; use crate::sys; use super::cap_text::{caps_from_text, caps_to_text, ParseCapsError}; use super::CapSet; /// Represents the permitted, effective, and inheritable capability sets of a thread. /// /// # `FromStr` and `Display` implementations /// /// This struct's implementations of `FromStr` and `Display` use the same format as `libcap`'s /// `cap_from_text()` and `cap_to_text()`. For example, an empty state can be represented as `=`, a /// "full" state can be represented as `=eip`, and a state containing only `CAP_CHOWN` in the /// effective and permitted sets can be represented by `cap_chown=ep`. #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[derive(Copy, Clone, Debug, Eq, Hash, PartialEq)] pub struct CapState { pub effective: CapSet, pub permitted: CapSet, pub inheritable: CapSet, } impl CapState { /// Construct an empty `CapState` object. #[inline] pub fn empty() -> Self { Self { effective: CapSet::empty(), permitted: CapSet::empty(), inheritable: CapSet::empty(), } } /// Get the capability state of the current thread. /// /// This is equivalent to `CapState::get_for_pid(0)`. #[inline] pub fn get_current() -> crate::Result<Self> { Self::get_for_pid(0) } /// Get the capability state of the process (or thread) with the given PID (or TID). /// /// If `pid` is 0, this method gets the capability state of the current thread. pub fn get_for_pid(pid: libc::pid_t) -> crate::Result<Self> { let mut header = sys::cap_user_header_t { version: sys::_LINUX_CAPABILITY_VERSION_3, pid: pid as libc::c_int, }; let mut raw_dat = [sys::cap_user_data_t { effective: 0, permitted: 0, inheritable: 0, }; 2]; cfg_if::cfg_if! { if #[cfg(feature = "sc")] { crate::sc_res_decode(unsafe { sc::syscall!(CAPGET, &mut header as *mut _, raw_dat.as_mut_ptr()) })?; } else { if unsafe { sys::capget(&mut header, raw_dat.as_mut_ptr()) } < 0 { return Err(crate::Error::last()); } } } Ok(Self { effective: CapSet::from_bitmasks_u32(raw_dat[0].effective, raw_dat[1].effective), permitted: CapSet::from_bitmasks_u32(raw_dat[0].permitted, raw_dat[1].permitted), inheritable: CapSet::from_bitmasks_u32(raw_dat[0].inheritable, raw_dat[1].inheritable), }) } /// Set the current capability state to the state represented by this object. pub fn set_current(&self) -> crate::Result<()> { let mut header = sys::cap_user_header_t { version: sys::_LINUX_CAPABILITY_VERSION_3, pid: 0, }; let effective = self.effective.bits; let permitted = self.permitted.bits; let inheritable = self.inheritable.bits; let raw_dat = [ sys::cap_user_data_t { effective: effective as u32, permitted: permitted as u32, inheritable: inheritable as u32, }, sys::cap_user_data_t { effective: (effective >> 32) as u32, permitted: (permitted >> 32) as u32, inheritable: (inheritable >> 32) as u32, }, ]; cfg_if::cfg_if! { if #[cfg(feature = "sc")] { crate::sc_res_decode(unsafe { sc::syscall!(CAPSET, &mut header as *mut _, raw_dat.as_ptr()) })?; } else { if unsafe { sys::capset(&mut header, raw_dat.as_ptr()) } < 0 { return Err(crate::Error::last()); } } } Ok(()) } } impl fmt::Display for CapState { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { caps_to_text(*self, f) } } impl core::str::FromStr for CapState { type Err = ParseCapStateError; #[inline] fn from_str(s: &str) -> Result<Self, Self::Err> { caps_from_text(s).map_err(ParseCapStateError) } } /// Represents an error when parsing a `CapState` object from a string. #[derive(Clone, Debug, Eq, Hash, PartialEq)] pub struct ParseCapStateError(ParseCapsError); impl fmt::Display for ParseCapStateError { #[inline] fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fmt::Display::fmt(&self.0, f) } } #[cfg_attr(docsrs, doc(cfg(feature = "std")))] #[cfg(feature = "std")] impl std::error::Error for ParseCapStateError {} #[cfg(test)] mod tests { use super::*; use core::str::FromStr; use crate::caps::Cap; use crate::capset; #[test] fn test_capstate_empty() { assert_eq!( CapState::empty(), CapState { effective: CapSet::empty(), permitted: CapSet::empty(), inheritable: CapSet::empty(), } ); } #[test] fn test_capstate_getset_current() { let state = CapState::get_current().unwrap(); assert_eq!(state, CapState::get_for_pid(0).unwrap()); assert_eq!( state, CapState::get_for_pid(unsafe { libc::getpid() }).unwrap() ); state.set_current().unwrap(); } #[test] fn test_capstate_get_bad_pid() { assert_eq!(CapState::get_for_pid(-1).unwrap_err().code(), libc::EINVAL); assert_eq!( CapState::get_for_pid(libc::pid_t::MAX).unwrap_err().code(), libc::ESRCH ); } #[test] fn test_capstate_parse() { // caps_from_text() has more extensive tests; we can be a little loose here assert_eq!( CapState::from_str("cap_chown=eip cap_chown-p cap_syslog+p").unwrap(), CapState { permitted: capset!(Cap::SYSLOG), effective: capset!(Cap::CHOWN), inheritable: capset!(Cap::CHOWN), } ); #[cfg(feature = "std")] assert_eq!( CapState::from_str("cap_noexist+p").unwrap_err().to_string(), "Unknown capability" ); } #[cfg(feature = "std")] #[test] fn test_capstate_display() { // caps_to_text() has no tests in cap_text.rs, so we need to be rigorous assert_eq!(CapState::empty().to_string(), "="); assert_eq!( CapState { permitted: !capset!(), effective: !capset!(), inheritable: capset!(), } .to_string(), "=ep", ); assert_eq!( CapState { permitted: capset!(Cap::CHOWN), effective: capset!(Cap::CHOWN), inheritable: capset!(Cap::CHOWN), } .to_string(), "cap_chown=eip", ); assert_eq!( CapState { permitted: capset!(Cap::CHOWN), effective: capset!(Cap::CHOWN), inheritable: capset!(), } .to_string(), "cap_chown=ep", ); assert_eq!( CapState { permitted: !capset!(Cap::CHOWN), effective: !capset!(Cap::CHOWN), inheritable: capset!(), } .to_string(), "=ep cap_chown-ep", ); for state in [ CapState::empty(), CapState { permitted: !capset!(), effective: !capset!(), inheritable: !capset!(), }, CapState { permitted: !capset!(), effective: capset!(), inheritable: capset!(), }, CapState { permitted: !capset!(Cap::CHOWN), effective: capset!(), inheritable: capset!(), }, CapState { permitted: capset!(), effective: !capset!(Cap::CHOWN), inheritable: capset!(), }, CapState { permitted: capset!(), effective: capset!(), inheritable: !capset!(Cap::CHOWN), }, CapState { permitted: !capset!(Cap::CHOWN), effective: capset!(Cap::CHOWN), inheritable: capset!(), }, CapState { permitted: capset!(Cap::CHOWN), effective: capset!(Cap::CHOWN), inheritable: capset!(Cap::CHOWN), }, CapState { permitted: capset!(Cap::SYSLOG), effective: capset!(Cap::CHOWN), inheritable: capset!(Cap::CHOWN), }, CapState { permitted: capset!(Cap::SYSLOG, Cap::CHOWN), effective: capset!(Cap::CHOWN), inheritable: capset!(Cap::CHOWN), }, CapState { permitted: capset!(Cap::SYSLOG, Cap::CHOWN), effective: capset!(Cap::SYSLOG, Cap::CHOWN), inheritable: capset!(Cap::SYSLOG, Cap::CHOWN), }, CapState { permitted: capset!(), effective: capset!(), inheritable: capset!(Cap::SYSLOG, Cap::CHOWN), }, // Let's try some real-world data CapState::get_current().unwrap(), CapState::get_for_pid(1).unwrap(), ] .iter() { let s = state.to_string(); assert_eq!(s.parse::<CapState>().unwrap(), *state, "{:?}", s); } } }
def hex2bin(hexstr): scale = 16 num_of_bits = len(hexstr) * math.log(scale, 2) binstr = bin(int(hexstr, scale))[2:].zfill(int(num_of_bits)) return binstr
“Fridays are going to be throwback nights with special guest appearances and promotions. It’s going to be a really fun year with a look back at the history of the ballpark,” said Tommy Viola, director of media relations. Former Indians pitcher Gaylord Perry; Atlanta Braves’ first baseman Sid Bream, known for his famous slide; and country singer and wrestler Mickie James are slotted for Friday night appearances, according to Viola. Jobseekers were on hand for the 200 game-day positions available, including ticket takers, promotions and parking. Viola said those interviewed should be hearing from someone in a few weeks.
Mighty Muggs: Darth Vader Review | By Mighty Muggs Darth Vader (Version 2) 5 Inch Scale By: Hasbro 2009 $9.99 Darth Vader was the Sith title given to Anakin Skywalker by Supreme Chancellor Palpatine after he embraced the dark side. Shortly before the Battle of Yavin, Vader was charged with retrieving the stolen plans for the Death Star and finding the hidden base of the Rebel Alliance. Finally challenged by his long lost son Luke Skywalker, Vader overthrew the Emperor. In his final moments, he pleaded with Luke to remove his mask so that he could look on him with his own eyes. Vader found redemption in the light side of the Force. Darth Vader was no more; Anakin Skywalker, the Chosen One, had returned and brought balance to the Force. This is actually my first Mighty Mugg review, although I purchased my first Mugg (Iron Man) nearly two years ago when K*B Toys was going out of business. For whatever reason I never took that one out of the box and despite being tempted to purchase others… I never did. I’ve been wowed by the charm and allure of Muggs again so expect some reviews in the weeks and months ahead. I decided that Vader fit in with the March of the Robots theme. How so? Okay so Darth Vader really isn’t a robot. If anything, he’s a cyborg, but I’ve been pretty lax about what qualifies as a robot for March of the Robots. Plus as Obi-Wan said, “He’s more machine now than man; twisted and evil” and that’s good enough for me. Who are you to doubt Obi-wan?! As for Vader himself, I wouldn’t necessarily say I’m a Star Wars purist, but generally speaking I found the prequels as failures if for nothing other than the fact they pretty much took perhaps the most awesome villain in cinema history and turned him into a pansy. Plus the three prequels build up Darth Vader as if he’s already the centerpiece of the Empire, but in the original Star Wars film he’s not even second in command until Tarkin dies. It’s like the “rise of middle management” or something, but your mileage may vary. Since Vader’s cool persona has been castrated in my mind, so I’m fine with having a Mugg of him. He’s not a bad ass, he’s bobble head and bubble bath fodder now. Packaging : Mighty Muggs are packed into nice little window boxes. Hasbro was clearly taking a page out of designer vinyl when they came up with the Muggs and so the window boxes sort of follow the trends set in that field. However, Hasbro didn’t just phone it in, opting instead to create some nice, stylistic boxes. This is the “version 2” type of Darth Vader. That means that this Vader is from Return of the Jedi when he’s dying and has his mask removed to reveal Hayden Christensen’s face. I’m kidding of course, Lucas hasn’t “fixed” that part of the original trilogy yet. Maybe for the 40th anniversary! Since that’s the exclusive part of this figure, his large Mugg cartoon shows off his bald head. It wraps around the full package. It’s a pretty cool display piece as a result and I know a lot of people keep their Muggs in package. The back of the package shows off the other figures in the series. It also shows off an important feature… This Mugg’s head can turn around to make him NORMAL Darth Vader. That’s important. I say that because I wasn’t ever going to buy this guy because I don’t need an unmasked Mugg Vader, but once I realized this version also allowed me to make a regular Vader, I bought him in a heartbeat. Sculpt : Mighty Muggs mostly use the same sculpt, but they do add to it when appropriate. Vader uses the basic sculpt, but his hand is removable to give the effect of his robotic hand that Luke cuts off in the movie. That’s a neat feature and it gives this figure a bonus point of articulation. The head sculpt underneath the helmet looks surprisingly like Sebastian Shaw, the actor who played unmasked Vader in Return of the Jedi. It’s scary how much that looks like him, considering Mugg’s limitations. If you’ve ever seen Shaw in real life, he pretty much looks like that. The best part though is that you can remove the top of the helmet, turn his head around and have a regular Darth Vader. The helmet fits on pretty snug, but it’s easy to pop off and on. The paint work is really well done on all fronts. I have no complaints whatsoever about the paint. This is really one of the more complicated Muggs in terms of paint detail as well. I do have a minor quibble with the fact that his lightsaber is sculpted into his hand. There’s no real point in that since the other lightsabers are removable. The hand is almost impossible to swap in and out as well. Finally, the cape is worthless. For whatever reason ALL Mighty Muggs’ capes are longer than the figure and thus they can’t wear them and stand. They need to be about a half inch shorter. Articulation : Mighty Muggs have 3 points of articulation. Head swivel, arms swivel. Vader actually has 4 points of articulation making him practically the McFarlance Spider-man of Hasbro’s Muggs. His wrist has another swivel in it, since it’s removable. All this wrist swivel manages to do is make you realize that all the wrists should swivel on these guys. And no, even though it looks like the legs should move, they don’t. Accessories : Since the lightsaber is stuck in his hand, all you really get is a cape that’s too long and the helmet. Personally I think Mighty Muggs should all come with a couple of weapons to balance out the cost, but it is what it is. Real designer vinyl can cost an arm and a leg, so I guess this isn’t so bad. The lightsabe not being removable is dunderheaded though and the capes need to be redesigned. Value : Meh, $10 is pretty steep for a toy that’s got so little going for it. However these are very stylistic and they offer up something that caters to a specific genre. For that reason alone they can’t really be graded in the same way I do most action figures. At $10 a pop these are a “decent” value, but if you’re looking for a true blue toy, you can do better. Score Recap : Packaging – 8 Sculpting – 7 Articulation – 3 Accessories – Removable Hand, Helmet, Cape Value – 6 Overall – 6 out of 10
Milisav Savić Education Attended elementary school in Raška and high school in Novi Pazar. Later, he graduated from University of Belgrade, where he majored in Yugoslav and world literature in 1969. He attained his M. A. and PhD. from the same university, the latter with the dissertation "Memoir and Autobiographical Prose about Serb-Turkish Wars 1876-78".[1] Career Savić was the first editor in chief of the literary periodical "Knjizevna rec" (Literary Word), 1972/1977. In 1980, he was appointed editor-in-chief of the leading literary newspapers "Književne novine" ("Literary Gazette"). In 1983 he became the main editor in the largest publishing house in Serbia, "Prosveta" ("Education"). In 2005/2008 he worked in Rome in The Embassy of Serbia as minister adviser. After his return from Rome, he worked as a professor of literature at the State University of Novi Pazar. In 1977 and 1978, he taught Serb-Croatian at London University, later at SUNY, Albany (1985/87), the University of Florence (1990/92 and the University of Lodz, Poland (1999/2000).[2] Savić is the editor and translator of several anthologies of foreign literature into Serbian (American and Italian) and the writer of three collections of essays.
Health education in general practice. long, despite two thirds of visits being made within one hour and 80% within two hours. However, whether patients are satisfied or not is meaningless if what they were waiting for is not studied. Waiting two hours for an opinion on a nappy rash is an excellent service, whereas an hour's delay for chest pain is unacceptable. Higher expectations among patients will lead to greater dissatisfaction if services are not forthcoming, but are their expectations reasonable, and thus are the particular findings in this paper of great significance? PAUL HOBDAY The Surgery South Lane Sutton Valence, Maidstone Kent ME17 7BD
from .intent import Intent __all__ = ["Intent"]
/** * @author Antonio J. Nebro * @version 1.0 */ public class EpsilonTest { private static final double EPSILON = 0.0000000000001 ; @Rule public ExpectedException exception = ExpectedException.none(); @Test public void shouldExecuteRaiseAnExceptionIfTheFrontApproximationIsNull() { exception.expect(NullParameterException.class); Front referenceFront = null ; new Epsilon<PointSolution>(referenceFront) ; } @Test public void shouldExecuteRaiseAnExceptionIfTheFrontApproximationListIsNull() { exception.expect(JMetalException.class); Front referenceFront = new ArrayFront() ; Epsilon<PointSolution> epsilon = new Epsilon<PointSolution>(referenceFront) ; List<PointSolution> list = null ; epsilon.evaluate(list) ; } @Test public void shouldExecuteReturnZeroIfTheFrontsContainOnePointWhichIsTheSame() { int numberOfPoints = 1 ; int numberOfDimensions = 3 ; Front frontApproximation = new ArrayFront(numberOfPoints, numberOfDimensions); Front referenceFront = new ArrayFront(numberOfPoints, numberOfDimensions); Point point1 = new ArrayPoint(numberOfDimensions) ; point1.setValue(0, 10.0); point1.setValue(1, 12.0); point1.setValue(2, -1.0); frontApproximation.setPoint(0, point1); referenceFront.setPoint(0, point1); QualityIndicator<List<PointSolution>, Double> epsilon = new Epsilon<PointSolution>(referenceFront) ; List<PointSolution> front = FrontUtils.convertFrontToSolutionList(frontApproximation) ; assertEquals(0.0, epsilon.evaluate(front), EPSILON); } /** * Given a front with point [2,3] and a Pareto front with point [1,2], the value of the * epsilon indicator is 1 */ @Test public void shouldExecuteReturnTheRightValueIfTheFrontsContainOnePointWhichIsNotTheSame() { int numberOfPoints = 1 ; int numberOfDimensions = 2 ; Front frontApproximation = new ArrayFront(numberOfPoints, numberOfDimensions); Front referenceFront = new ArrayFront(numberOfPoints, numberOfDimensions); Point point1 = new ArrayPoint(numberOfDimensions) ; point1.setValue(0, 2.0); point1.setValue(1, 3.0); Point point2 = new ArrayPoint(numberOfDimensions) ; point2.setValue(0, 1.0); point2.setValue(1, 2.0); frontApproximation.setPoint(0, point1); referenceFront.setPoint(0, point2); QualityIndicator<List<PointSolution>, Double> epsilon = new Epsilon<PointSolution>(referenceFront) ; List<PointSolution> front = FrontUtils.convertFrontToSolutionList(frontApproximation) ; assertEquals(1.0, epsilon.evaluate(front), EPSILON); } /** * Given a front with points [1.5,4.0], [2.0,3.0],[3.0,2.0] and a Pareto front with points * [1.0,3.0], [1.5,2.0], [2.0, 1.5], the value of the epsilon indicator is 1 */ @Test public void shouldExecuteReturnTheCorrectValueCaseA() { int numberOfPoints = 3 ; int numberOfDimensions = 2 ; Front frontApproximation = new ArrayFront(numberOfPoints, numberOfDimensions); Front referenceFront = new ArrayFront(numberOfPoints, numberOfDimensions); Point point1 = new ArrayPoint(numberOfDimensions) ; point1.setValue(0, 1.5); point1.setValue(1, 4.0); Point point2 = new ArrayPoint(numberOfDimensions) ; point2.setValue(0, 2.0); point2.setValue(1, 3.0); Point point3 = new ArrayPoint(numberOfDimensions) ; point3.setValue(0, 3.0); point3.setValue(1, 2.0); frontApproximation.setPoint(0, point1); frontApproximation.setPoint(1, point2); frontApproximation.setPoint(2, point3); Point point4 = new ArrayPoint(numberOfDimensions) ; point4.setValue(0, 1.0); point4.setValue(1, 3.0); Point point5 = new ArrayPoint(numberOfDimensions) ; point5.setValue(0, 1.5); point5.setValue(1, 2.0); Point point6 = new ArrayPoint(numberOfDimensions) ; point6.setValue(0, 2.0); point6.setValue(1, 1.5); referenceFront.setPoint(0, point4); referenceFront.setPoint(1, point5); referenceFront.setPoint(2, point6); QualityIndicator<List<PointSolution>, Double> epsilon = new Epsilon<PointSolution>(referenceFront) ; List<PointSolution> front = FrontUtils.convertFrontToSolutionList(frontApproximation) ; assertEquals(1.0, epsilon.evaluate(front), EPSILON); } /** * Given a front with points [1.5,4.0], [1.5,2.0],[2.0,1.5] and a Pareto front with points * [1.0,3.0], [1.5,2.0], [2.0, 1.5], the value of the epsilon indicator is 0.5 */ @Test public void shouldExecuteReturnTheCorrectValueCaseB() { int numberOfPoints = 3 ; int numberOfDimensions = 2 ; Front frontApproximation = new ArrayFront(numberOfPoints, numberOfDimensions); Front referenceFront = new ArrayFront(numberOfPoints, numberOfDimensions); Point point1 = new ArrayPoint(numberOfDimensions) ; point1.setValue(0, 1.5); point1.setValue(1, 4.0); Point point2 = new ArrayPoint(numberOfDimensions) ; point2.setValue(0, 1.5); point2.setValue(1, 2.0); Point point3 = new ArrayPoint(numberOfDimensions) ; point3.setValue(0, 2.0); point3.setValue(1, 1.5); frontApproximation.setPoint(0, point1); frontApproximation.setPoint(1, point2); frontApproximation.setPoint(2, point3); Point point4 = new ArrayPoint(numberOfDimensions) ; point4.setValue(0, 1.0); point4.setValue(1, 3.0); Point point5 = new ArrayPoint(numberOfDimensions) ; point5.setValue(0, 1.5); point5.setValue(1, 2.0); Point point6 = new ArrayPoint(numberOfDimensions) ; point6.setValue(0, 2.0); point6.setValue(1, 1.5); referenceFront.setPoint(0, point4); referenceFront.setPoint(1, point5); referenceFront.setPoint(2, point6); QualityIndicator<List<PointSolution>, Double> epsilon = new Epsilon<PointSolution>(referenceFront) ; List<PointSolution> front = FrontUtils.convertFrontToSolutionList(frontApproximation) ; assertEquals(0.5, epsilon.evaluate(front), EPSILON); } /** * The same case as shouldExecuteReturnTheCorrectValueCaseB() but using list of solutions */ /* @Test public void shouldExecuteReturnTheCorrectValueCaseC() { int numberOfPoints = 3 ; int numberOfDimensions = 2 ; Front frontApproximation = new ArrayFront(numberOfPoints, numberOfDimensions); Front referenceFront = new ArrayFront(numberOfPoints, numberOfDimensions); Point point1 = new ArrayPoint(numberOfDimensions) ; point1.setValue(0, 1.5); point1.setValue(1, 4.0); Point point2 = new ArrayPoint(numberOfDimensions) ; point2.setValue(0, 1.5); point2.setValue(1, 2.0); Point point3 = new ArrayPoint(numberOfDimensions) ; point3.setValue(0, 2.0); point3.setValue(1, 1.5); frontApproximation.setPoint(0, point1); frontApproximation.setPoint(1, point2); frontApproximation.setPoint(2, point3); Point point4 = new ArrayPoint(numberOfDimensions) ; point4.setValue(0, 1.0); point4.setValue(1, 3.0); Point point5 = new ArrayPoint(numberOfDimensions) ; point5.setValue(0, 1.5); point5.setValue(1, 2.0); Point point6 = new ArrayPoint(numberOfDimensions) ; point6.setValue(0, 2.0); point6.setValue(1, 1.5); referenceFront.setPoint(0, point4); referenceFront.setPoint(1, point5); referenceFront.setPoint(2, point6); List<PointSolution> listA = FrontUtils.convertFrontToSolutionList(frontApproximation) ; List<PointSolution> listB = FrontUtils.convertFrontToSolutionList(referenceFront) ; assertEquals(0.5, epsilon.execute(listA, listB), EPSILON); } */ @Test public void shouldGetNameReturnTheCorrectValue() { QualityIndicator<?, Double> epsilon = new Epsilon<PointSolution>(new ArrayFront()) ; assertEquals("EP", epsilon.getName()); } }
<gh_stars>10-100 #include <TObjString.h> #include "AliNanoAODStorage.h" #include "AliLog.h" ClassImp(AliNanoAODStorage) void AliNanoAODStorage::AllocateInternalStorage(Int_t size) { AllocateInternalStorage(size, 0); } void AliNanoAODStorage::AllocateInternalStorage(Int_t size, Int_t sizeInt) { /// Creates the internal array if(size == 0){ AliError("Zero size"); return; } fNVars = size; fVars.clear(); fVars.resize(size, 0); // if(fVars) { // delete[] fVars; // } // fVars = new Double_t[fNVars]; // for (Int_t ivar = 0; ivar<fNVars; ivar++) { // fVars[ivar]=0; // } if(sizeInt>0){ fNVarsInt = sizeInt; fVarsInt.clear(); fVarsInt.resize(sizeInt, 0); } } AliNanoAODStorage& AliNanoAODStorage::operator=(const AliNanoAODStorage& sto) { /// Assignment operator AllocateInternalStorage(sto.fNVars, sto.fNVarsInt); if(this!=&sto) { for (Int_t isize = 0; isize<sto.fNVars; isize++) { SetVar(isize, sto.GetVar(isize)); } for (Int_t isize = 0; isize<sto.fNVarsInt; isize++) { SetVarInt(isize, sto.GetVarInt(isize)); } } return *this; } Int_t AliNanoAODStorage::GetIntParameters(const TString varListHeader){ const TString stringVariables = "FiredTriggerClasses,BunchCrossNumber,OrbitNumber,PeriodNumber,NumberOfESDTracks,OfflineTrigger,RunNumber";//list of all possible string variables in AliNanoAODStorage TObjArray * vars = varListHeader.Tokenize(","); TIter it(vars); TObjString *token = 0; Int_t stringVars=0; while ((token = (TObjString*) it.Next())) { TString var = token->GetString().Strip(TString::kBoth, ' '); if(stringVariables.Contains(var)) stringVars++; } return stringVars; } void AliNanoAODStorage::Complain(Int_t index) const { AliFatal(Form("Variable %d not included in this special aod", index)); }
<gh_stars>10-100 // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.2-147 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2010.01.26 at 02:04:22 PM MST // package net.opengis.ows._100; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlSeeAlso; import javax.xml.bind.annotation.XmlType; /** * Human-readable descriptive information for the object it is included within. * This type shall be extended if needed for specific OWS use to include additional metadata for each type of information. This type shall not be restricted for a specific OWS to change the multiplicity (or optionality) of some elements. * * <p>Java class for DescriptionType complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="DescriptionType"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element ref="{http://www.opengis.net/ows}Title" minOccurs="0"/> * &lt;element ref="{http://www.opengis.net/ows}Abstract" minOccurs="0"/> * &lt;element ref="{http://www.opengis.net/ows}Keywords" maxOccurs="unbounded" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "DescriptionType", propOrder = { "title", "_abstract", "keywords" }) @XmlSeeAlso({ IdentificationType.class, ServiceIdentification.class }) public class DescriptionType { @XmlElement(name = "Title") protected String title; @XmlElement(name = "Abstract") protected String _abstract; @XmlElement(name = "Keywords") protected List<KeywordsType> keywords; /** * Gets the value of the title property. * * @return * possible object is * {@link String } * */ public String getTitle() { return title; } /** * Sets the value of the title property. * * @param value * allowed object is * {@link String } * */ public void setTitle(String value) { this.title = value; } /** * Gets the value of the abstract property. * * @return * possible object is * {@link String } * */ public String getAbstract() { return _abstract; } /** * Sets the value of the abstract property. * * @param value * allowed object is * {@link String } * */ public void setAbstract(String value) { this._abstract = value; } /** * Gets the value of the keywords property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the keywords property. * * <p> * For example, to add a new item, do as follows: * <pre> * getKeywords().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link KeywordsType } * * */ public List<KeywordsType> getKeywords() { if (keywords == null) { keywords = new ArrayList<KeywordsType>(); } return this.keywords; } }
LESSON STUDY: USING GROUPWORK ACTIVITY TO ENCHANCE STUDENTS OUTPUT IN EAP CLASSES This article is a product of collaborative work between three university instructors that specifically focused on developing and enhancing students output using groupwork in their English for Academic Purposes (EAP) classes. The experimental part of this paper was based on the method commonly known as lesson study and aimed at observing and analyzing the use of language input covered during the classes by students. To provide favorable environment for the language practice, greater time was allocated for the production part of the lesson, where students did a role play activity in groups. The experiment proved that groupwork indeed enhances student output and engages more of them. At the same time, it was revealed that providing more time for the production part does not always lead to an increase in student talking time. Low-performing students output as well, did not necessarily improve during such activities.
MANILA (Reuters) - Canada’s Prime Minister Justin Trudeau on Tuesday said he had an “extended conversation” with Myanmar leader Aung San Suu Kyi about the plight of Rohingya Muslims, an issue of “tremendous concern” globally. More than 600,000 Rohingya have fled to Bangladesh since Myanmar’s military started clearance operations in response to attacks by Rohingya militants in late August. The crisis has caused international alarm. “I had an extended conversation with state counselor of Myanmar, Aung San Suu Kyi, about the plight of Muslim refugees in Rakhine state,” he told a news conference, without referring to the Rohingya by name.
<gh_stars>10-100 /* Copyright AppsCode Inc. and Contributors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1alpha1 import ( v1alpha1 "kubeform.dev/provider-azurerm-api/apis/siterecovery/v1alpha1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" ) // ReplicatedVmLister helps list ReplicatedVms. // All objects returned here must be treated as read-only. type ReplicatedVmLister interface { // List lists all ReplicatedVms in the indexer. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1alpha1.ReplicatedVm, err error) // ReplicatedVms returns an object that can list and get ReplicatedVms. ReplicatedVms(namespace string) ReplicatedVmNamespaceLister ReplicatedVmListerExpansion } // replicatedVmLister implements the ReplicatedVmLister interface. type replicatedVmLister struct { indexer cache.Indexer } // NewReplicatedVmLister returns a new ReplicatedVmLister. func NewReplicatedVmLister(indexer cache.Indexer) ReplicatedVmLister { return &replicatedVmLister{indexer: indexer} } // List lists all ReplicatedVms in the indexer. func (s *replicatedVmLister) List(selector labels.Selector) (ret []*v1alpha1.ReplicatedVm, err error) { err = cache.ListAll(s.indexer, selector, func(m interface{}) { ret = append(ret, m.(*v1alpha1.ReplicatedVm)) }) return ret, err } // ReplicatedVms returns an object that can list and get ReplicatedVms. func (s *replicatedVmLister) ReplicatedVms(namespace string) ReplicatedVmNamespaceLister { return replicatedVmNamespaceLister{indexer: s.indexer, namespace: namespace} } // ReplicatedVmNamespaceLister helps list and get ReplicatedVms. // All objects returned here must be treated as read-only. type ReplicatedVmNamespaceLister interface { // List lists all ReplicatedVms in the indexer for a given namespace. // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1alpha1.ReplicatedVm, err error) // Get retrieves the ReplicatedVm from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*v1alpha1.ReplicatedVm, error) ReplicatedVmNamespaceListerExpansion } // replicatedVmNamespaceLister implements the ReplicatedVmNamespaceLister // interface. type replicatedVmNamespaceLister struct { indexer cache.Indexer namespace string } // List lists all ReplicatedVms in the indexer for a given namespace. func (s replicatedVmNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.ReplicatedVm, err error) { err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { ret = append(ret, m.(*v1alpha1.ReplicatedVm)) }) return ret, err } // Get retrieves the ReplicatedVm from the indexer for a given namespace and name. func (s replicatedVmNamespaceLister) Get(name string) (*v1alpha1.ReplicatedVm, error) { obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) if err != nil { return nil, err } if !exists { return nil, errors.NewNotFound(v1alpha1.Resource("replicatedvm"), name) } return obj.(*v1alpha1.ReplicatedVm), nil }
/* * Salesforce DTO generated by camel-salesforce-maven-plugin * Generated on: Thu Sep 06 16:51:28 IST 2018 */ package org.apache.camel.salesforce.dto; import javax.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; /** * Salesforce Enumeration DTO for picklist Field */ @Generated("org.apache.camel.maven.CamelSalesforceMojo") public enum MatchingRuleItem_FieldEnum { // Account ACCOUNT("Account"), // AccountNumber ACCOUNTNUMBER("AccountNumber"), // AccountSource ACCOUNTSOURCE("AccountSource"), // Active ACTIVE("Active"), // Address ADDRESS("Address"), // AssistantName ASSISTANTNAME("AssistantName"), // AssistantPhone ASSISTANTPHONE("AssistantPhone"), // BillingAddress BILLINGADDRESS("BillingAddress"), // BillingCity BILLINGCITY("BillingCity"), // BillingCountry BILLINGCOUNTRY("BillingCountry"), // BillingPostalCode BILLINGPOSTALCODE("BillingPostalCode"), // BillingState BILLINGSTATE("BillingState"), // BillingStreet BILLINGSTREET("BillingStreet"), // City CITY("City"), // CleanStatus CLEANSTATUS("CleanStatus"), // Company COMPANY("Company"), // CompanyDunsNumber COMPANYDUNSNUMBER("CompanyDunsNumber"), // Country COUNTRY("Country"), // CurrentGenerators CURRENTGENERATORS("CurrentGenerators"), // CustomerPriority CUSTOMERPRIORITY("CustomerPriority"), // Department DEPARTMENT("Department"), // DunsNumber DUNSNUMBER("DunsNumber"), // Email EMAIL("Email"), // EmailBouncedReason EMAILBOUNCEDREASON("EmailBouncedReason"), // Fax FAX("Fax"), // FirstName FIRSTNAME("FirstName"), // HomePhone HOMEPHONE("HomePhone"), // Industry INDUSTRY("Industry"), // Jigsaw JIGSAW("Jigsaw"), // Languages LANGUAGES("Languages"), // LastName LASTNAME("LastName"), // LeadSource LEADSOURCE("LeadSource"), // Level LEVEL("Level"), // MailingAddress MAILINGADDRESS("MailingAddress"), // MailingCity MAILINGCITY("MailingCity"), // MailingCountry MAILINGCOUNTRY("MailingCountry"), // MailingPostalCode MAILINGPOSTALCODE("MailingPostalCode"), // MailingState MAILINGSTATE("MailingState"), // MailingStreet MAILINGSTREET("MailingStreet"), // MobilePhone MOBILEPHONE("MobilePhone"), // NaicsCode NAICSCODE("NaicsCode"), // NaicsDesc NAICSDESC("NaicsDesc"), // Name NAME("Name"), // NumberOfEmployees NUMBEROFEMPLOYEES("NumberOfEmployees"), // NumberofLocations NUMBEROFLOCATIONS("NumberofLocations"), // OtherAddress OTHERADDRESS("OtherAddress"), // OtherCity OTHERCITY("OtherCity"), // OtherCountry OTHERCOUNTRY("OtherCountry"), // OtherPhone OTHERPHONE("OtherPhone"), // OtherPostalCode OTHERPOSTALCODE("OtherPostalCode"), // OtherState OTHERSTATE("OtherState"), // OtherStreet OTHERSTREET("OtherStreet"), // Ownership OWNERSHIP("Ownership"), // Parent PARENT("Parent"), // Phone PHONE("Phone"), // PostalCode POSTALCODE("PostalCode"), // Primary PRIMARY("Primary"), // ProductInterest PRODUCTINTEREST("ProductInterest"), // Rating RATING("Rating"), // ReportsTo REPORTSTO("ReportsTo"), // SICCode SICCODE("SICCode"), // SLA SLA("SLA"), // SLASerialNumber SLASERIALNUMBER("SLASerialNumber"), // Salutation SALUTATION("Salutation"), // ShippingAddress SHIPPINGADDRESS("ShippingAddress"), // ShippingCity SHIPPINGCITY("ShippingCity"), // ShippingCountry SHIPPINGCOUNTRY("ShippingCountry"), // ShippingPostalCode SHIPPINGPOSTALCODE("ShippingPostalCode"), // ShippingState SHIPPINGSTATE("ShippingState"), // ShippingStreet SHIPPINGSTREET("ShippingStreet"), // Sic SIC("Sic"), // SicDesc SICDESC("SicDesc"), // Site SITE("Site"), // State STATE("State"), // Status STATUS("Status"), // Street STREET("Street"), // TextName TEXTNAME("TextName"), // TickerSymbol TICKERSYMBOL("TickerSymbol"), // Title TITLE("Title"), // Tradestyle TRADESTYLE("Tradestyle"), // Type TYPE("Type"), // UpsellOpportunity UPSELLOPPORTUNITY("UpsellOpportunity"), // Website WEBSITE("Website"), // YearStarted YEARSTARTED("YearStarted"); final String value; private MatchingRuleItem_FieldEnum(String value) { this.value = value; } @JsonValue public String value() { return this.value; } @JsonCreator public static MatchingRuleItem_FieldEnum fromValue(String value) { for (MatchingRuleItem_FieldEnum e : MatchingRuleItem_FieldEnum.values()) { if (e.value.equals(value)) { return e; } } throw new IllegalArgumentException(value); } }
import sys from os.path import dirname, join from com.chaquo.python import Python def main(CodeAreaData): file_dir = str(Python.getPlatform().getApplication().getFilesDir()) filename = join(dirname(file_dir), 'file.txt') try: original_stdout = sys.stdout sys.stdout = open(filename, 'w', encoding = 'utf8', errors="ignore") exec(CodeAreaData) # it will execute our code and save output in file #example => exec("""print("hello")""") output => hello --will we write in the file #now close the file after writing data sys.stdout.close() #reset the standard output to its original value sys.stdout = original_stdout #open file and read output and save in variable output = open(filename, 'r').read() except Exception as e: #to handle error #if any error occur in the code like syntax error then take that error message #in output variable to show on screen sys.stdout = original_stdout #take exception error in output output = e #finally return output return str(output)