content
stringlengths
7
2.61M
Oral administration of a product derived from Clostridium butyricum in rats. Recent studies have suggested that short chain fatty acids (SCFAs) exert a therapeutic effect on some human and experimental animal diseases. Clostridium butyricum produces high levels of SCFAs in the gut lumen. The aim of the present study was to analyze the product derived from Clostridium butyricum in a culture system, and to develop methods to eliminate the odor derived from SCFAs in the product. Clostridium butyricum was incubated in CS medium for 24 h and subsequently in CS broth for 24 h. The suspension of Clostridium butyricum in the broth was centrifugated and the supernatant was analyzed. The results showed this product contained high levels of SCFAs, especially acetic acid and n-butyric acid. Many food materials were tested in order to eliminate the odor derived from SCFAs in the product. Of the food materials tested, yogurt was shown to most effectively eliminate the odor. Using a yogurt base, we prepared a special food additive. Use of the additive completely eliminated the odor of the product derived from Clostridium butyricum. Finally, we administered the product with the additive to Sprague-Dawley rats for 14 days. The rats grew normally for the duration of the experimental period. It is possible that this novel product with the additive exerts therapeutic effects on some gastointestinal disorders.
The GAPS programme with HARPS-N at TNG. I: Observations of the Rossiter-McLaughlin effect and characterisation of the transiting system Qatar-1 A long-term multi-purpose observational programme has started with HARPS-N@TNG aimed to characterise the global architectural properties of exoplanetary systems. In this first paper we fully characterise the transiting system Qatar-1. We exploit HARPS-N high-precision radial velocity measurements obtained during a transit to measure the Rossiter-McLaughlin effect in the Qatar-1 system, and out-of-transit measurements to redetermine the spectroscopic orbit. New photometric transit light-curves are analysed and a spectroscopic characterisation of the host star atmospheric parameters is performed based on various methods (line equivalent width ratios, spectral synthesis, spectral energy distribution). We achieved a significant improvement in the accuracy of the orbital parameters and derived the spin-orbit alignment of the system; this information, combined with the spectroscopic determination of the host star properties, allows us to derive the fundamental physical parameters for star and planet (masses and radii). The orbital solution for the Qatar-1 system is consistent with a circular orbit and the system presents a sky-projected obliquity of lambda = -8.4+-7.1 deg. The planet, with a mass of 1.33+-0.05 M_J, is found to be significantly more massive than previously reported. The host star is confirmed to be metal-rich (= 0.20+-0.10) and slowly rotating (vsinI = 1.7+-0.3 km/s), though moderately active, as indicated by strong chromospheric emission in the Ca II H&K line cores (logR'_HK about -4.60). The system is well aligned and fits well within the general lambda vs Teff trend. We definitely rule out any significant orbital eccentricity. The evolutionary status of the system is inferred based on gyrochronology, and the present orbital configuration and timescale for orbital decay are discussed in terms of star-planet tidal interactions. Introduction The study of extrasolar planets and the determination of their observational properties have made remarkable progress over the past decade. The surveys conducted so far with the most successful techniques (i.e. radial veocities and planetary transits photometry) have revealed planets spanning an unexpectedly wide range of orbital properties. Particularly surprising is the detection of close-in giant planets with orbital periods as short as one day, the so-called hot Jupiters. Today ground-based and space-borne photometric surveys are yielding crucial information on transiting planets (). However, the radial velocity technique is still not only of essential value (e.g., to confirm transiting planet candidates and determine their actual masses), but is now beginning to extend searches to still unexplored ranges of planet and host star properties, thanks to the improved sensitivity and stability of the new generation of high-resolution spectrographs, pioneered by the HARPS instrument on the 3.6m ESO telescope, and now followed by the newly built high-resolution spectrograph HARPS-N, recently come into operation on the Telescopio Nazionale Galileo, TNG (). One of the relevant open questions in the exoplanetary field concerns the characterisation of the architectural properties of extrasolar planets and their possible dependence on the physical properties of the parent stars. For example, known systems with giant planets are usually not followedup to search for additional low-mass companions that might exist at a range of separations: as a consequence, we still lack information about the frequency of solar-system-like systems. Properties such as frequency and orbital characteristics of exoplanets are expected to depend upon stellar properties, such as metallicity (;;) and mass ), as well as on the host star's environment (Desidera & Barbieri 2007;;;). Furthermore, the relative role of different mechanisms of the time evolution of planetary system architecture is still rather uncertain. Crucial information on the mechanisms governing the evolution of planetary systems can be obtained by determining the relative orientation of the host-star spin axis, which is usually regarded as a relic of the angular momentum of the protostellar accretion disc, and the orbital axes of the planets. Of the two main mechanisms invoked to explain inward migration of giant planets from their original location, disc-planet interactions tend to preserve the initial spin-orbit alignment as well as orbit circularity, whereas dynamical interactions, such as planet-planet scattering (Papaloizou & Terquem 2006;) or Kozai resonance due to the presence of an offplane massive perturber (Fabrycky & Tremaine 2007), are expected to alter both the inclination and eccentricity of the orbit. Planet-planet scattering must occur after the disc dissipated, otherwise the disc interaction would drag the planet back on the median plane (Bitsch & Kley 2011;Marzari & Nelson 2009). Although, as suggested recently by Teyssandier et al., for a sufficiently high initial inclination of the orbital plane, even a disc could lead to Kozai cycles, and hence to spin-orbit misalignment. The orbital eccentricity can become very high during Kozai cycles with consequent decrease of periastron distance and set-in of star-planet tidal interactions until the orbit eventually becomes very tight and circularised (;Lithwick & Naoz 2011). Determining the orientation of a planet orbital axis with respect to the stellar spin axis is therefore a way to assess the relative importance of the two migration mechanisms. This can be accomplished through the observation of the Rossiter-McLaughlin (RM) effect, well known from the study of eclipsing binaries (Rossiter 1924;McLaughlin 1924). The RM effect is an anomaly in the radial velocity (RV) curve occurring during a planetary transit, whose shape yields information on the sky-projected angle between the star spin axis and the planet orbital axis. Therefore, measuring the RM effect provides a unique observational constraint to the actual spin-orbit misalignment (). In some cases, the analysis of starspots can also provide a good determination of the sky-projected obliquity and, in the most favourable ones, can even yield the true obliquity () of the orbit (;). So far, has been measured for a growing number of transiting planets 1 (over 60 to date), the majority of which do show values of close to zero, pretty much like the planetary bodies orbiting our Sun, although a considerable fraction (nearly 40%) shows substantial misalignment (). In this paper and in a companion Letter (Paper II of the series) by Desidera et al., we present the first results obtained in the framework of the project Global Architecture of Planetary Systems (GAPS), a large observational programme with HARPS-N which has recently been competitively awarded long-term status at the TNG. GAPS is a structured, largely synergetic observational programme specifically designed to maximise the scientific return in several aspects of exoplanetary astrophysics, taking advantage of the unique capabilities provided by HARPS-N. The GAPS programme is composed of three main elements, including a) radial-velocity searches for low-mass planets around stars with and without known planets over a broad range of properties (mass, metallicity) of the hosts, b) characterisation measurements of known transiting systems, and c) improved determinations of relevant physical parameters (masses, radii, ages) and of the degree of starplanet interactions for selected planet hosts. In particular, within the framework of the GAPS programme element devoted to investigating the outcome of planet-disc and planet-planet interaction scenarios in exoplanet systems, we present here the first determination of the RM effect for the recently discovered transiting system Qatar-1 (≡ GSC 04240-00470) (). This system contains a hot Jupiter orbiting a V=12.84, metal-rich K-dwarf star, one of the faintest around which a planet has been discovered so far by ground-based surveys. Furthermore, Qatar-1 represents an interesting study case for investigating the star-planet interaction and will set constraints on theories of tidal evolution for other systems that contain very hot Jupiters orbiting low-mass stars. For this purpose, it is mandatory to rely on refined orbital parameters as well as on accurate determinations of the physical properties for the star and the planet. The plan of the paper is the following: in Sec. 2 we present the HARPS-N observations and in Sec. 3 we introduce the complementary photometric observations. In Sec. 4 we describe the analysis and present the results of the photometric and spectroscopic data, in Sec. 5 we derive the atmospheric properties of the host star based on different methods, while in Sec. 6 we infer the system properties related to rotation and activity indicators and discuss them in terms of star-planet tidal interaction. In Sec. 7 we summarise our results and main conclusions. HARPS-N observations and data reduction The spectroscopic observations of the transit were obtained on 2012 September 3, using the HARPS-N (High Accuracy Radial velocity Planet Searcher-North) spectrograph at the 3.58m Telescopio Nazionale Galileo (TNG) (). HARPS-N, a near twin of the HARPS instrument in operation on the ESO 3.6m telescope at La Silla (Chile), covers the wavelength range from 3800 to 6900 with a resolving power of R∼115,000. Each resolution element is sampled by 3.3 CCD pixels. While out-of-transit data were obtained with the simultaneous Th-Ar calibration, the in-transit spectra were acquired with the second fibre on-sky to avoid the risk of contaminating the stellar spectrum by the calibration lamp. Knowing the spectroscopic orbital parameters, in particular the semi-amplitude K of the radial velocity (RV) curve and the systemic RV is mandatory for a correct interpretation of the RM effect. Following the successful acquisition of a spectral time series covering the Qatar-1 b transit, we were prompted to gather additional HARPS-N data aiming to cover out-of-transit phases and improve the orbital solution. Thanks to the flexible scheduling of observations inside the GAPS programme, during following nights (September 5,6,7,8,9,and 11) we were able to obtain seven additional spectra evenly distributed over the different orbital phases. The RV measurements of Qatar-1 are reported in Table 1. All spectra were acquired with an exposure time of 900 s. The spectrograph is equipped with an exposure meter to accurately measure the flux-weighted mean time of each exposure. The RV measurements and corresponding errors were obtained using the HARPS-N on-line pipeline, based on the numerical cross-correlation function (CCF) method () with the weighted and cleaned-mask modification (), by applying the K5 mask. To perform the detailed analysis of light curves and radial velocities data the time-tag of each exposure was reduced to the solar system barycentric time using the software Tempo2 () with the DE405 JPL Ephemerides (Standish 1998) in barycentric coordinate time (TCB) scale (SI units). The assumed celestial coordinates of the source are: RA(J2000) = 20 h 13 m 31 s.615 DEC(J2000) = +65 09 43.48, with proper motions (in mas/yr) = 7.1, = 58.0. In Table 1, we report the RV after barycentering with Tempo2 in TCB units. Ancillary data: transit photometry New photometric data of Qatar-1 b transits were obtained with the Asiago 1.82m and Calar Alto 1.23m telescopes. The journal of photometric observations is given in Table 2, while the photometric data are provided in Table 3. Photometric observations from the Asiago Observatory Two complete transits of Qatar-1 b were observed on 2011 May 29 and 2012 Aug 24 within the TASTE project (). The weather conditions in both nights were characterised by veils and thin cirrus, yet neither caused interruptions in the time series nor stops in the autoguide. Both observations were performed with the Asiago Faint Object Spectrograph and Camera (AFOSC) at the 1.82m Copernico telescope in northern Italy. AFOSC is a classical focal-reducer camera equipped with a thinned, back-illuminated E2V 42-20 2048 2048 CCD (0.26 /pix in unbinned mode), providing a 9 9 field of view. Both transits were observed in imaging mode through a standard Cousins R filter, with a constant exposure time of 7 s. CCD windowing and 4 4 binning were set to increase the time series duty-cycle, while a suitable set of reference stars was imaged on the same read-out window. Stellar images were defocused to ∼ 4 FWHM to avoid saturation and minimize flat-field residual errors. After a standard correction for bias and flat-field, the frames were reduced with the STARSKY code, the TASTE photometric pipeline (), which also includes a diagnostic tool to discard the data points most affected by transparency variations. Differential light curves were extracted by normalising the raw flux from the target with an optimally weighted average flux from the reference stars. Finally, light curves were corrected for systematic errors by decorrelating flux against external parameters (including e.g., star position on the detector, FWHM, background level, and airmass) and selecting the solution with the smallest off-transit scatter. Photometric observations from the Calar Alto Observatory Three transits of Qatar-1 b were observed on 2011 August 25 and on 2012 July 21 and September 10, using the 1.23 m telescope at the German-Spanish Calar Alto Observatory (CAHA) near Almera (Spain), which was already successfully used to follow-up several transiting planets (). During the 2011 observations, we used the Table 2. Details of the photometric observations presented in this work. N obs is the number of observations, Moon is the fractional illumination of the Moon at the midpoint of the transit, and t exp is the exposure time in seconds. The aperture sizes are the radii in pixels of the software apertures for the star, inner sky, and outer sky, respectively. Scatter is the r.m.s. scatter of the data versus a fitted model in mmag. Times and dates are in UT. 2k2k SITE#2b optical CCD 2 with a FOV of 16 16 and a pixel size of 24 m, which translates to a pixel scale of 0.5 per pixel. We defocused the telescope in order to lower the flat-fielding noise. The photometric data were gathered through a Cousins R filter with an observing cadence of 60 sec. To limit the dead time between exposures, we reduced the amount of time lost to CCD readout by reading out only a small window. Autoguiding was used. The two 2012 transits were obtained in filter Cousins R with the new DLRMKIII camera, which is equipped with an E2V CCD231-84-NIMO-BI-DD sensor with 4k4k pixels of 15m and a FOV of 21 21. Both transits were observed with the CCD unbinned, the telescope heavily defocused, and an observing cadence of 120 s. The autoguider was properly focused to preserve a good pointing of the telescope. The observations were analysed using the idl pipeline from Southworth et al.. The images were debiased and flat-fielded using standard methods, then subjected to aperture photometry using the IDL task aper 3. Pointing variations were followed by cross-correlating each image against a reference image. We chose the aperture sizes and comparison stars that yielded the lowest scatter in the final differential-photometry light curve. The relative weights of the comparison stars were optimised simultaneously by fitting a second-order polynomial to the outside-transit observations to normalise them to unit flux. Data analysis In this section we describe the analysis of the data presented in Sec. 3 and present the results we obtained. The analysis of our five photometric data sets was performed by employing the software code JKTEBOP (version 28) to fit a transit light-curve (LC) model (Southworth 2008). New ephemerides for Qatar-1 b transits As a first step we derived new ephemerides by combining the determinations of the mid-transit times from our five data sets with those derived from Alsubai et al.. All timings were placed on BJD(TCB) time system. The resulting measurements of transit midpoints were fitted with a straight line to obtain new orbital ephemerides: where E is the number of orbital cycles after the reference epoch (the midpoint of the first transit observed by ) and the quantities in brackets denote the uncertainty in the last digits of the preceding number. The corresponding O−C diagramme is shown in Fig. 1, in which the mid-transit times available from the Exoplanet Transit Database (ETD) 4 are also displayed, though they were not used in the fit. Combined solution of photometric light-curves The main parameters of the model are the fractional radii of the star and planet, r and r p, defined as the stellar radius R and the planetary radius R p scaled by the semi-major axis a, respectively, and the orbital inclination i p. The LC solution was attempted using the linear and quadratic limb-darkening (LD) law, and with the LD coefficients either fixed at the theoretical values tabulated by Claret & Bloemen or included as fit parameters. We obtained the best result by fitting the LD(u 1 ) coefficient using a linear law. We fitted individual light curves for the sum and ratio of the fractional radii r p + r, r p /r, the orbital inclination i, the central transit time T 0, and the limb darkening coefficient LD(u 1 ). Evaluation of robust uncertainties on our best-fit parameters was performed by a bootstrap algorithm, i.e. generating for each light curve 10 000 resampled data sets to be fitted, and analysing the resulting distribution (). The lightcurves and their best-fitting models are shown in Fig. 2, whereas the results of our analysis are reported in along with the weighted means (WMs) for each parameter evaluated over all five transits. For some parameters (r p /r and LD(u 1 ) the best-fit values are more scattered than expected by applying Gaussian statistics. A possible reason for these slight discrepancies could be intrinsic variations due to stellar activity of Qatar-1. Stellar spots, faculae and other active regions are known to alter the parameters inferred from photometric data, even when they are not occulted during the transit and thus no unusual feature is visible in the light curves (). The ratio r p /r is one of the most critical parameters in this regard. We checked for long-term variability of Qatar-1 by performing differential photometry with the same comparison stars on the Asiago time series, A1 and A2, taken at the same site and airmass. We found a brightness variation between the two epochs of +0.034 ± 0.005 and +0.030 ± 0.006 mag (using two different reference stars), while the variation of our "check" star is −0.004 ± 0.004 mag. Although this finding is not fully conclusive, it suggests that stellar activity could play a role and possibly explain the differences in the LC solutions for different epochs. Improved spectroscopic orbit solution The 11 RV measurements corresponding to out-of-transit phases (see Table 1) form the data set we used to fit the spectroscopic orbit solution. The solution of the RV curve was performed considering both the cases of circular and eccentric orbit. The results of our RV curve fits are summarised in Table 5, and the orbital solution corresponding to the fit obtained with the eccentricity as free parameter is shown in Fig. 3. The errors on the best-fit parameters were determined with the bootstrap method from 1000 mock data sets. The comparison with the best-fit parameters reported in Alsubai et al. shows a number of significant differences. The Alsubai estimate of =-37835±63 m s −1 deviates from ours formally by more than 3. The most likely explanation for this discrepancy lies in a systematic RV zeropoint difference between the two instruments used. The higher precision of the HARPS-N RV measurements allows us to rule out an eccentric orbit for Qatar-1 b. Our determination of e = 0.020 +0.011 −0.010 is compatible with a circular orbit within 2, as expected for close-in planets with orbital periods shorter than a few days ( Therefore, for the following analysis we adopted the best-fit parameters from the circular solution. Finally, we obtained K=265.7 ± 3.5 m s −1, which is about 20% higher than the value in Alsubai et al.. Accordingly, the estimates of the mass and density of Qatar-1 b will be higher by the same percentage. Analysis of the RM effect and determination of the spin-orbit alignment To analyse the RM effect we implemented a numerical model based on the following assumptions. We tried to reproduce the observed CCF by modelling the average photospheric line profile. The stellar disc is sampled by a matrix of 20002000 elements, each element being represented by a Gaussian line profile with a given width el, Dopplershifted according to the stellar rotation, and weighted by appropriate limb-darkening coefficients. The resulting line profile is then convolved by the instrumental profile (assumed to be Gaussian) of HARPS-N, IP = 1.108 km s −1. The model also takes into account the actual occulted area of the stellar photospheric disc and the smearing due to the planet's displacement during an exposure. The corresponding RV shift is then computed by a Gaussian fit of this resulting line profile, analogously to the HARPS-N pipeline. The model depends on twelve parameters. The orbital period P orb, mid-transit epoch T 0, transit duration T 14, star and planet radii R and R p, the linear limb-darkening coefficient LD(u 1 ), and the impact parameter b were fixed to the values we derived from the light-curve solution, while the star RV semi-amplitude K was set to the best-fit value obtained from the spectroscopic orbit with null eccentricity. The remaining parameters, i.e. the stellar projected rotational velocity vsin I, the systemic velocity, the stellar disc resolution element line width el, and the orbital obliquity were treated as free parameters. By using a "trust region" least-squares minimisation algorithm (;), we obtained the following best-fit values: = −8.4 ± 7.1 deg, vsin I = 1.7 ± 0.3 km s −1, el = 2238 ± 155 m s −1, = −38059.5 ± 2.0 m s −1, and normalised 2 = 1.217. The errors were determined with the same bootstrap method as for the orbital RV curve fit from 200 mock data sets. Although an independent determination of the systemic velocity is provided by the orbital RV curve fit, we preferred to treat as a free parameter, because of its strong correlation with the parameter (see Fig. 5). In fact, by fixing the value of to the value derived from the orbital RV curve fit, we obtained a best-fit value of = −1, with a normalised 2 of 1.301. By letting free to vary, we also allowed for a possible RV shift caused by stellar spots, whose configuration on the stellar disc can be assumed to remain constant over the time-span of the transit. This analysis shows that the system is well aligned. The results are reported in Table 6. Fig. 5 shows the 2 -maps for various pairs of parameters. A preliminary calibration of the FWHM of the CCF in terms of projected rotational velocity based on a sample of stars with planets observed as part of GAPS yields vsin I=1.6±0.5 km s −1, consistent with the value derived as part of the RM effect modelling. Characterisation of the host star A proper determination of the stellar parameters is mandatory to obtain the physical properties of the planet. Because of the uncertainty on the amount of interstellar extinction, photometric data alone cannot provide an accurate determination of the fundamental parameters of the star. According to the TASS Mark IV catalogue (), the apparent V-band magnitude of Qatar-1 is V= 12.84 mag. The K2 V spectral type of the host star (from ) translates into an absolute magnitude of M v =6.5 mag (Straizys & Kuriliene 1981). Depending on the amount of reddening, the distance to Qatar-1 is expected to span roughly between ∼190 pc for negligible extinction, and ∼130 pc for a normal interstellar extinction law (i.e., R v = 3.1) and the maximum colour excess value (i.e., E B−V = 0.232 ± 0.003) obtained from the reddening map by Schlegel et al.. Spectroscopic determination of stellar parameters The HARPS-N spectra were used to perfom a spectroscopic characterisation of the host star Qatar-1 and estimate the effective temperature T eff, surface gravity log g, projected rotational velocity vsin I, and the iron abundance ). The effective temperature was initially determined from the HARPS-N spectra by applying the method of equivalent width (EW) ratios of spectral absorption lines by means of the ARES 5 automatic code (), using the calibration for FGK dwarf stars by Sousa et al.. For this purpose, we used an average spectrum of Qatar-1 obtained by a weighted mean of the 18 spectra available (after verifying that no contamination was present in the spectra taken with the simultaneous ThAr 5 http://www.astro.up.pt/∼sousasag/ares/ calibration), each properly shifted by the corresponding radial velocity to the rest wavelength frame, obtaining T eff = 4990 ± 100K. Furthermore, the atmospheric stellar parameters were derived using the program MOOG (Sneden 1973), version 2010, and through EW measurements of iron lines as described in detail by Biazzo et al.. In particular, the effective temperature was determined by imposing the condition that the Fe i abundance does not depend on the excitation potential of the lines, the microturbulence velocity () was derived by imposing that the surface Fe i abundance is independent on the line EWs, and the surface gravity was estimated by imposing the Fe i/Fe ii ionization equilibrium. Then, we were also able to measure the iron abundance of Qatar-1. This analysis was performed differentially with respect to the Sun. For this purpose, we analysed the Qatar-1 spectrum and a Ganymede spectrum acquired with HARPS at ESO (). We thus obtained log n(Fe i) = log n(Fe ii) = 7.53 ± 0.05 for the Sun. In the end, we found the following atmospheric parameters and iron abundance for the star: T eff = 4820±100 K, log g = 4.43 ± 0.10, = 0.90 ± 0.05 km s −1, = 0.15 ± 0.10, and = 0.15 ± 0.08, which agree with the previous determinations by Alsubai et al.. In addition, the stellar parameters were derived independently using the methodology presented in Santos et al. and Sousa et al.. This analysis was also based on iron line excitation and ionization equilibrium, using a grid of Kurucz model atmospheres and the 2002 version of MOOG. The ARES code was used to measure the equivalent widths for a sub-set of iron lines from the list in Sousa et al. that is especially suited for determining the parameters of stars with temperature below 5200 K (for details see Tsantaki et al., A&A, submitted). The derived parameters are T eff =4786±95 K, log g=4.41±0.24, = 0.78 ± 0.29 km s −1, and =0.18±0.06. These values agree fairly well with those reported above. As a final consistency check, we exploited the fact that there is only one temperature for which the surface gravity from evolutionary models will meet the one obtained from the ionization equilibrium. By imposing this condition, the surface gravity was obtained by comparison with the BaSTI 6 evolutionary models. This yields the set of values T eff = 4910 ± 100 K, log g = 4.66 ± 0.10, and = 0.20 ± 0.10. Fig. 6 shows the observed and the synthetic spectrum corresponding to the latter set of parameters and adopting for the projected rotational velocity the value v sin I = 1.7km s −1, as derived from the RM best-fit solution (see Sect 4.4). This set of values was finally adopted by us in the following. SED, reddening, and distance We constructed the spectral energy distribution (SED) of Qatar-1 by merging the V and R optical magnitudes from the TASS Mark IV catalogue () with the infrared photometry from the 2MASS and WISE databases (;Cutri & et al. 2012), as shown in Fig. 7. We simultaneously fitted the colours encompassed by the SED to ad hoc synthetic magnitudes derived from a NextGen stellar atmosphere model () with the same T eff, log g, and metallicity as the star. To 6 URL http://wwwas.oats.inaf.it/IA2/BaSTI/ Fig. 7. De-reddened spectral energy distribution of Qatar-1, for A v = 0.1 and d=195 pc. Optical V and R photometric data are taken from the TASS Mark IV catalogue (). Infrared data are taken from the 2MASS and WISE databases (;Cutri & et al. 2012). The NextGen synthetic low-resolution spectrum () with the same photospheric parameters as Qatar-1 is over-plotted with a light-blue line. estimate the interstellar extinction A v and distance d to Qatar-1, we followed the method described in Gandolfi et al. and combined the availabe set of photometric data with the spectroscopically derived parameters. Assuming a total-to-selective extinction R v = A v /E B−V = 3.1 and a black body emission at the star effective temperature and radius yields an extinction A v = 0.10 ± 0.10 mag and a distance to the star d = 195 ± 25 pc, fairly consistent with the range of values estimated above. Weak interstellar components are visible within the broad and blended Na i D 1,2 stellar doublet, as shown in Figure 8. Their equivalent widths are 0.017 and 0.009 (±0.001), respectively, i.e. very close to the asymptotic 2.0 limit ratio for optically thin 5889.951 and 5895.924 lines. Some contamination from the adjacent not perfectly subtracted night-sky lines is possible. Adopting the Munari & Zwitter calibration between reddening and equivalent width of interstellar Na i 5889.951 line, the reddening affecting Qatar-1 is E B−V =0.004 (±0.0005). Finally, using a method based on the near-infrared SED published in Masana et al., as described in Section 2.3 of Ribas et al., and adopting the values of log g and derived from the spectroscopic analysis (though their impact on the final values is very small, similarly to the immunity of the infrared flux method to those parameters), we obtained an effective temperature of T eff = 4880 ± 70 K. The main source of error is the uncertainty in the extinction value, assumed to be Av=0.1+/-0.1 mag. Hence, the resulting effective temperature perfectly agrees with the spectroscopic determination. Table 6 summarises the physical properties we derived for the star and the planet in the Qatar-1 system. To determine the stellar fundamental properties, we exploited quantities obtained directly from the analysis of the transit light curves following the prescriptions by Sozzetti et al.. In particular, we derived the density of the star = 1.62 ± 0.08 from the scaled stellar radius R /a and used it together with T eff and obtained from the spectroscopic anaslysis to infer the stellar mass and radius by comparison with stellar evolution models. Using the BaSTI models, this yields a stellar mass M = 0.85 M ± 0.03 M and a radius R = 0.80 ± 0.05 R, which coincide with the values reported by Alsubai et al.. In turn, the surface gravity of the planet, log g p = 3.372 ± 0.024, and the planet equilibrium temperature, T P = 1389 ± 39 K, with their corresponding uncertainties were obtained following Sozzetti et al. and Cowan & Agol, respectively. The planetary radius and mass are found to be 1.18 ± 0.09 R J and 1.33 ± 0.05 M J. Hence, while only marginally larger in radius, the planet is found to be significantly more massive than reported by Alsubai et al.. Discussion As discussed by Enoch et al., the radius of an exoplanet may be affected by a number of factors, which include the mass of the planet and its heavy element content as well as the irradiation received from the host star. For Qatar-1 b, we expect strong irradiation and tidal effects because of its proximity to the host star. Below, we examine rotation and activity indicators and discuss the possible evolutionary effects caused by tidal interaction. Stellar rotation, activity, and age Adopting the vsin I of 1.7 ± 0.3 km s −1 and radius of 0.80 ± 0.05 R for Qatar-1, and assuming that the star is viewed equator-on, the rotation period is calculated to be 24 ± 6 days. The gyrochronological age, t gyro, can hence be estimated using the relation given by Barnes (equation 3). For a (B − V) = 0.9, corresponding to a T eff of 4910 K of the star, we obtain t gyro = 1.7 ± 1.1 Gyr. On the other hand, adopting the revised gyrochronology by Lanza for stars with hot Jupiters, we estimate an age of ∼ 4.5 Gyr that better agrees with that derived from stellar evolutionary tracks (cf. Fig. 5 of ). Chromospheric emission is present in the Ca ii H&K lines. Unfortunately, the S/N of individual HARPS-N spectra in the wavelength range below 4000 is inadequate to obtain reliable measurements of the log R HK index. Therefore it is not possible to look for eventual variations in the chromospheric activity. However, using the passband definitions in Duncan et al. and a preliminary calibration of the flux in the Ca ii H&K lines, we obtained S HK = 0.389 from the average spectrum used in Sec. 5.1. Then, by adopting (B − V) = 0.9 and the calibrations of Noyes et al., we find log R HK = −4.60. Therefore, Qatar-1 appears to be a moderately active star, similar to, e.g., HD 189733 and TrES-3 (). Using the relations given by Noyes et al. and Mamajek & Hillenbrand, the expected rotation period for log R HK = −4.60 and (B − V) = 0.9 would be 23.8 d and 23.0 d, respectively, hence within the range estimated from vsin I. However, using relation from Mamajek & Hillenbrand of age as a function of log R HK, yields an age of about 1.1 Gyr, which is considerably younger than the value inferred from gyrochronology (see also Pace 2013 for an updated analysis on the use of chromospheric activity as an age indicator). Finally, we note that Qatar-1 b fits well within the log R HK -log g p correlation pointed out by Hartman for close-in planets (a < 0.1 AU) with M p > 0.1 M J, orbiting stars with 4200 K< T eff < 6200 K. It appears also to be consistent with the indication reported by Krejov & Budaj that the level of the chromospheric activity of stars with T eff < 5500 K hosting close-in planets (a < 0.15 AU) may be enhanced by the presence of Jupitermass planets. Star-planet tidal interaction The orbital period of the planet in the Qatar-1 system is much shorter than the rotation period of the star estimated in Sec. 6.1. Therefore, tides produce a decay of the orbit with a continuous transfer of angular momentum from the orbital motion to the spin of the star. The orbital angular momentum is only 0.28 of the present stellar spin, which is insufficient to reach an equilibrium synchronous state. In other words, as a consequence of the tidal evolution, the planet is expected to be engulfed by the star. The timescale for the orbital decay −1 a ≡ (1/a)(da/dt), where a is the orbital semi-major axis and t the time, depends on the efficiency of the tidal dissipation inside the star that is parameterised by its modified tidal quality factor Q s. Considering the tidal dissipation efficiency required to account for orbital circularisation and synchronisation in close binary systems, Ogilvie & Lin estimated that Q s is of the order of 10 6 for late-type main-sequence stars. Adopting this value and the stellar and planetary parameters in Table 6, we obtain a ∼ 0.5 Gyr for Qatar-1 using the tidal evolutionary model of Leconte et al.. The timescale for the alignment of the orbital angular momentum and the stellar spin can be estimated from the same tidal model and is −1 ≡ (1/ )(d /dt), where is the obliquity of the stellar equator with respect to the orbital plane. Assuming Q s = 10 6 and an initial obliquity (t = 0) = 30 yields ≈ 0.2 Gyr. It is interesting to note that the timescale of orbital decay computed with Q s = 10 6 is significantly shorter than the estimated age of the star from Sect 6.1. The difference is not as dramatic as in the case of, e.g., OGLE-TR-56 (Ogilvie & Lin 2007), or Kepler-17 (Bonomo & Lanza 2012), where the orbital decay timescale turns out to be as short as 40-70 Myr, but this result suggests that the use of the same value of Q s as derived for close stellar binary systems also for star-planet systems is not appropriate (cf. other analyses trying to constrain Q s, e.g., Ptzold & Rauer 2002;Ogilvie & Lin 2007;Carone & Ptzold 2007;;). In principle, a lower limit on Q can be established by an accurate timing of the transits extended over a baseline of several decades, which allows one to test the predictions of the above models. Specifically, for Q s = 10 6, the orbital decay is expected to produce a variation of the observed epoch of mid-transit with respect to a constant-period ephemeris of O − C ∼ 17 s in twenty years. The tidal evolution of stellar obliquity has been recently discussed by Lai from a theoretical point of view, and by Albrecht et al. considering RM observation statistics. Summary and conclusions We reported on observations of the RM effect for the Qatar-1 system and a new determination of the orbital solution based on HARPS-N at TNG observations. With these data we also obtained the spectroscopic characterisation of the host star. Combining the radial velocity data with new transit photometry and with photometric data from the literature, we derived new ephemerides and improved the orbital parameters for the system. The most notable results from this analysis can be summarised as follows: 1. The new spectroscopic orbital solution is found to be consistent with a circular orbit and any significant eccentricity of the orbit can be ruled out. 2. The RM effect was measured and the sky-projected obliquity was determined, from which we can conclude that the orbital plane of the system is well-aligned with the spin axis of the star. This result and the derived properties of Qatar-1 b appear to be in line with the general trend observed for close-in planets around stars cooler than about 6250 K (). 3. The host star is confirmed to be a slowly rotating, metal-rich K-dwarf, which yet is found to be moderately active, as inferred from the strength of the chromospheric emission in the Ca II H&K line cores and from changes in the photometric light-curves at different epochs, which hint at the presence of stellar spots. 4. The planet is found to be significantly more massive than previously estimated by Alsubai et al.. 5. Qatar-1 appears to be consistent with the indication that the level of the chromospheric activity in stars cooler than 5500 K that host close-in giant planets may be enhanced. An attempt at estimating the timescale for the orbital decay by tidal dissipation was also presented, which deserves further investigation. Derived by combining the determinations of the mid-transit times from our photometric data sets with those derived from Alsubai et al.. Kept fixed in the orbital and Rossiter RV fitting. Derived as weighted mean of the best-fit determinations from our five transit light curves. Derived by fitting the orbital RV curve to out-of-transit RV measurements. Derived following Sozzetti et al.. Derived from evolutionary models. Derived by using the expression of the mass function. Derived from parameters above. Derived by fitting our RM effect model to in-transit RV measurements.
BIRMINGHAM, Alabama - A man died early Sunday after he was shot twice during a robbery attempt in a parking lot across the street from a downtown Birmingham nightclub. At 5 a.m., North Precinct officers responded to a report of a person shot in the 200 block of 17th Street North, Birmingham police spokesman Lt. Sean Edwards said in a news release. The victim, who had been shot twice in the leg, was found inside his car in a private parking lot across the street from Club Platinum. Birmingham Fire and Rescue took him to UAB Hospital, where he died. The man's name will be released once his family has been notified. Based on the preliminary investigation, Edwards gave this account of the shooting: Investigators learned that the man was shot during a robbery attempt while he and his girlfriend were getting into the car after leaving the club. An armed black man approached them and demanded money. The victim instead retrieved a gun from his car, and the men exchanged fire. The suspect fled in scene in a silver vehicle but was brought to UAB Hospital shortly after the shooting occurred. He also had been shot several times. Witnesses identified the man as the person who tried to rob the victim. Anyone with information about the case can contact the Birmingham Police Department's Homicide Unit at 205-254-1764 or Crime Stoppers at 205-254-7777. Updated at 7:20 p.m. to correct location where shooting took place
We road-test three exercises designed to stretch the imagination. Welcome to Guinea Pig, a new occasional feature in which we test services to see if they’ll help you become a better employee and, dare we say, a better person. This month: Do creativity exercises get the brain pumping new ideas? Place a pad and pen by your sofa. Relax on the couch, holding a spoon over a plate placed on the floor. As you begin to get drowsy, the spoon will drop to the floor, hitting the plate, waking you up. Grab the pad and sketch out whatever you were seeing during that drowsy state. The goal is to focus attention and preserve unusual ideas. Epstein says Salvador Dali got ideas this way, and Thomas Edison had a similar approach. How it worked for me: Incomplete. I slumped off the couch like one of Dali’s clocks in The Persistence of Memory, the spoon ended up in the sofa cushions, and it took me three hours to wake up from my nap. What are you trying to fix? Write it down. Then pick a random word from the dictionary — the first noun on the page you turn to. Play the association game with that noun and come up with a number of words you think of when you hear that word. For example, “banana” might produce the words “fruit,” “mushy,” “sweet,” “yellow,” and “peel.” Then take those words and relate them back to what you’re focusing on. How it worked for me: This gets the juices flowing. My focus issue was to meet deadlines better, and yes, words such as “banana,” “mouse,” and “frog” generated some good ideas that got me thinking about ways not to slip and — eek! — jump into trouble with my boss. Michalko recommended a technique invented by Alex Osborn, a pioneer in understanding creativity, in which you accept that there really are no new ideas, only updates of existing ones. With that in mind, take the subject you want to think about and ask the questions below to generate ideas. SCAMPER is a mnemonic to remind you of what to ask. S=Substitute? Who else? What else? C=Combine? Can you merge an idea with another one? A=Adapt? What else is like this? What could you copy or emulate? M=Magnify and modify? What can be added? Time? Power? Features? What can be altered? Can we change the color, shape, sound, or smell? P=Put to other uses? Can we use this dessert topping as a floor wax? Can we extend it? Can we do spin-offs? Can we enter other markets? E=Eliminate? What can be subtracted? Can we make this smaller? Lighter? More streamlined? R=Rearrange and reverse? Can we interchange components? Can we change the pace, the schedule? Can we turn this upside down? Can we reverse roles? How it worked for me: Mixed. With a blank-sheet-of-paper subject, such as generating new story ideas, this method didn’t work at all. But when I pretended to be a product manager looking to revitalize a brand of cookies or design an MP3 player, SCAMPER sent me running to the keyboard to enter in everything I came up with. Got an idea for Guinea Pig? Send it to David Lidsky.
<reponame>rtikyani/cs634-summer-2020-capstone # -*- coding: utf-8 -*- """Agent_Based_Model_Simulation.ipynb Automatically generated by Colaboratory. Original file is located at https://colab.research.google.com/drive/1WeDl_uBpFfhCKpp2YsGiEu9yTA0mpcSj A colleague of yours is asking why we need a model, cant we just use the taxi trips directly? You could, but you need to be able to keep the state of each of the agents across time. Agents (people) shouldn’t just vanish from trip to trip. If an agent becomes exposed and finally infected that agent should be remembered as being in this state for sometime and in fact transition to other states (e.g. recover) depending on an epidemiological model (see below). You point out that the Berlin visualization is based on this dynamic epidemiological model and you suggest that a team must use the Mesa Agent Based Modeling library to simulate the agents and keep track of all agents’ state (movements, health state transitions) and finally export all agents in a data file for analysis and plotting of infection rates etc. Relevant Links: https://pantelis.github.io/cs634/docs/common/projects/mobility-control/ https://github.com/pantelis/cs634-summer-2020-capstone https://github.com/pantelis/cs634-summer-2020-capstone/tree/develop https://colab.research.google.com/drive/1dqbgCM7z5fAUMdpfAz7Q5bAps3Fenwcv https://en.wikipedia.org/wiki/Agent-based_model https://github.com/projectmesa/mesa https://github.com/projectmesa/mesa/blob/master/docs/tutorials/intro_tutorial.ipynb """ #Install Mesa !pip install mesa #Retrieve/Assign Unique Identifier for each agent #Retrieve Data from Mobility Model & Epidemiological Model #Get/Set Current Position #Get/Set Previous Movements #Health State Transitions #Pass data to mobility controller """Test Mesa **Setting up Model** *Money*""" from mesa import Agent, Model class MoneyAgent(Agent): """An agent with fixed initial wealth.""" def __init__(self, unique_id, model): super().__init__(unique_id, model) self.wealth = 1 class MoneyModel(Model): """A model with some number of agents.""" def __init__(self, N): self.num_agents = N # Create agents for i in range(self.num_agents): a = MoneyAgent(i, self) """Adding the Scheduler""" from mesa import Agent, Model from mesa.time import RandomActivation class MoneyAgent(Agent): """ An agent with fixed initial wealth.""" def __init__(self, unique_id, model): super().__init__(unique_id, model) self.wealth = 1 def step(self): # The agent's step will go here. # For demonstration purposes we will print the agent's unique_id print ("Hi, I am agent " + str(self.unique_id) +".") class MoneyModel(Model): """A model with some number of agents.""" def __init__(self, N): self.num_agents = N self.schedule = RandomActivation(self) # Create agents for i in range(self.num_agents): a = MoneyAgent(i, self) self.schedule.add(a) def step(self): '''Advance the model by one step.''' self.schedule.step() """**Create Model Object, Run for 1 Step**""" empty_model = MoneyModel(10) empty_model.step()
— Bryce Reeves on Sunday, December 4th, 2016 in a radio interview. By Sean Gorman on Monday, December 19th, 2016 at 3:00 a.m. State Sen. Bryce Reeves is running in a crowded Republican primary field for lieutenant governor on a small-government platform. "My goal, as lieutenant governor, is to reform taxes, help to get people off of welfare," Reeves, R-Spotsylvania, said on "The John Fredericks Show" radio program. "If you’re a single mom and you have two kids in the city of Richmond, you can almost make $50,000 a year on the public dole." We wondered whether that single mom in Richmond really could receive so much public assistance. Reeves’ claim is based on a report by the Virginia Department of Social Services that examines the "road to self-sufficiency" taken by a fictitious Richmond mom with two boys, ages 3 and 7, as she gradually works toward a higher income level where she can pay completely for her family’s basic needs without relying on public assistance. All of that assistance comes to $31,164 a year. That doesn’t include the value of medical benefits the three-person family would get. Necole Simmonds, a Department of Social Services spokeswoman, told us in an email that the mom might be eligible for Medicaid while her children would be eligible for FAMIS Plus, a medical insurance program for children in low-income families. We asked about the cost of providing the fictitious Richmond family with medical insurance. Simmonds pointed us to estimates by the Kaiser Family Foundation of per-capita Medicaid spending in Virginia in 2011 - the latest year available. It came to $4,411 for an adult and $2,698 per child. These are not ideal figures because they’re bit old and, as we noted, the kids would be insured by FAMIS Plus, not Medicaid. The Department of Social Services couldn’t provide an estimate on per-capita benefits from FAMIS Plus. Despite these issues, the figures provide an approximation of the cost of publicly funded medical services for the fictitious family. And when we add the medical costs to the other benefits listed above, the family would be receiving close to $40,000 in total public assistance - short of the figure Reeves cited. Simmonds told us in an email that "the total value of the benefits a woman with two young kids making minimum wage may receive does not add up to $50,000." When we reached out to Reeves’ campaign, a spokeswoman told us the senator misspoke and said Reeves was not trying to suggest that the single mom would be getting nearly $50,000 from the public dole. "What he was trying to say was: ‘If you’re a single mom, and you’ve two kids in the city of Richmond, you almost have to make $50,000 a year to get off the public dole," Sam Azzarelli, communications director for the Reeves campaign, wrote us in an email. There are some problems with this amended claim that we also should point out, even though it’s not the focus of this fact-check. The fictitious mother loses most of her public assistance by the time she’s earning $33,800. At that point she no longer qualifies for welfare, food stamps, child care and housing assistance. As a result, she’s left with an income that leaves her hundreds of dollars short each month of meeting her family’s basic needs. The only major benefit her family continues to get is medical assistance for her two children, and that ends when her income reaches $42,120. But the family is not self-sufficient at this point and won’t be, according to the Department of Social Services report, until the mother is earning $50,440. At that earning level, the mother is able to pay all of the basic expenses of housing, food, child care, health care and transportation. Reeves said, "If you’re a single mom, and you’ve two kids in the city of Richmond, you can almost make $50,000 a year on the public dole." Although Reeves acknowledges he misspoke, he wasn’t far off. That mother, if she was working full time at minimum wage, could receive about $40,000 a year in public assistance. So we rate Reeves’ statement Mostly True. Published: Monday, December 19th, 2016 at 3:00 a.m. Sen. Bryce Reeves’ comments on the John Fredericks show, Dec. 4, 2016. (His statement is at 13:45 into the video). Email from Samantha Azzarelli, director of communications for Reeves’ campaign for lieutenant governor, Dec. 7, 2016. Virginia Department of Social Services, "The Road to Self Sufficiency," accessed Dec. 7, 2016. Emails from Necole Simmonds, spokeswoman for the Virginia Department of Social Services, Dec. 8-Dec. 16, 2016. USA.gov, "Government benefits," accessed Dec. 13, 2016.
1. Field of the Invention This invention relates to the production of synthesis gas by the partial oxidation of hydrocarbonaceous materials. More particularly, this invention relates to controlling the pH of water used to quench and scrub raw synthesis gas. 2. Description of the Prior Art The partial oxidation of hydrocarbonaceous materials to produce synthesis gas, a mixture of hydrogen and carbon monoxide, is well known in the art. A wide variety of carbon-containing materials have been employed as feed to partial oxidation processes including both solid carbonaceous fuels, such as coal, lignite, oil shale and tar sands, as well as liquid carbonaceous fuels, such as heavy fuel bottoms and residua. The carbonaceous fuel is introduced into the gas generator together with a free-oxygen containing gas to produce the mixture of raw synthesis gas which contains entrained solids, e.g., soot and ash, as well as quantities of other gases, which may include H.sub.2 O, CO.sub.2, H.sub.2 S, COS, CH.sub.4, NH.sub.3, N.sub.2 and Ar. The raw synthesis gas exits from the reaction zone at a temperature in the range of 1300.degree. to 3000.degree. F. The hot synthesis gas passes from the generator and is scrubbed and quenched with a water stream to remove soot and ash and cool the gas. The water stream, containing soot and ash, as well as some of the gases from the synthesis gas, is then mixed with naphtha and introduced into a decanter where two phases form. A soot-rich naphtha phase is removed from the decanter for further processing while an aqueous phase, commonly known as gray water, is removed for further processing. This aqueous phase contains dissolved salts, dissolved gases and ash while the organic phase consists of an organic extractant and the soot, i.e., particulate carbon. The use of a quench-scrubber and the two phase decanter is taught in U.S. Pat. Nos. 4,014,786 of Potter, et al. and 4,141,695 of Marion, et al. U.S. Pat. Nos. 4,141,695; 4,205,962 and 4,205,963, all of Marion, et al., 4,466,810 of Dille, et al. and 4,588,418 of Gabler, et al. all disclose the processing of the aqueous phase whereby it is sent to a flash column to remove gases, followed by settling to remove particulate matter therefrom with a subsequent recycle of the recovered water to the quench-scrubber. The organic extractant-soot phase may be treated to recover the extractant for reuse and to incorporate the particulate carbon into the hydrocarbonaceous material serving as feed to the synthesis gas generator as disclosed in Marion '695 and U.S. Pat. Nos. 4,211,638 of Akell, et al., 4,705,537 of Yaghmaie, et al. and the Dille and Gabler patents disclose the use of a hydrocyclone for the removal of particulate matter from the gray water. The use of surfactants to promote the separation of particulate matter is disclosed in Dille (cationic polyelectrolyte polymer) and Yaghmaie (anionic sulfonated product of humic acids or their salts). The process disclosed in Yaghmaie does not employ an inorganic extractant, but rather separates the particulate ash and dissolved materials without employing an organic extractant or the decanter employed in other prior art processes. Marion '695, '962 and '963, Dille and Gabler disclose the recycling of the water for reuse in the quench-scrubber after the water has been processed to remove significant quantities of particulate matter and dissolved gases. U.S. Pat. No. 4,588,418 of Gabler, et al. discloses the use of water to remove ash and soot from the synthesis gas, the mixing of the water with an organic extractant, the separating of these two streams in a decanter to form an aqueous phase and an organic phase, the subsequent treatment of the aqueous phase in a flash separator to remove dissolved gases and the separation of the solids from the water bottoms of the flash separator in a hydrocyclone with a recycle of the remaining water to the quench scrubber. A purge stream from the hydrocyclone which contains the solids from the water flash bottoms in concentrated form, is normally about 5 to 25% of the total water flash separator bottoms and is adjusted to keep the ash concentration at reasonable levels in the remaining water recycled to the synthesis gas quench system. Both acidic compounds, such as formic acid, as well as basic compounds, such as ammonia, are formed in the partial oxidation reaction and in the subsequent quenching process. The use of some hydrocarbonaceous feedstocks employed in the partial oxidation process result in an unacceptable acidic pH in the quench system, which in some prior art processes is alleviated by the injection of anhydrous ammonia or aqueous ammonia directly into the high pressure quench system or to the portion of the water flash separator bottoms stream that is recycled to the quench portion of the process. Additions of sodium hydroxide to raise the pH in this system is not appropriate, because the presence of sodium can cause additional ash formation resulting in unacceptable fouling of the processing equipment. It is an object of this invention to provide effective control of pH in the water quench-scrubber system and in the subsequent water processing portion of a partial oxidation process. It is a further object of this invention to utilize available streams having a basic pH for use in controlling the pH in the water-scrubber and attendant water processing equipment in a partial oxidation process. It is a further object of this invention to process and recycle ammonia-bearing water as a means of controlling the pH in the water-quench scrubber and attendant waste processing equipment of a partial oxidation process. The achievement of these and other objects will be apparent from the following description of the subject invention.
package org.doubt.tanner; import java.util.ArrayList; import java.util.List; public final class ActionController { private List<Action> actions = new ArrayList<>(); public int onLoop() throws InterruptedException { for (Action action : actions) { if (action.shouldExecute()) { action.execute(); break; } } return Global.config.sleepDuration(); } public void addAction(Action action) { actions.add(action); actions.sort((a, b)->a.getPriority().compareTo(b.getPriority())); } }
// Compute the true large sum, given the "requested large sum" int largesum(int K, int rsum, vector<int> &A) { int sumsofar = 0; int nblocks = 1; for (int i=0; i<A.size(); i++) { if (sumsofar+A[i] < rsum) { sumsofar+=A[i]; } else if (sumsofar+A[i] == rsum) { sumsofar=0; nblocks++; } else { sumsofar = A[i]; nblocks++; } if (nblocks==K) { i++; while (i<A.size()) { sumsofar+=A[i++]; } break; } } return (sumsofar>rsum)? sumsofar : rsum; }
French emergency services reach crisis point French hospitals are in a state of crisis, with emergency wards oversaturated in recent weeks because of a shortage of doctors and nurses. In Lille and other cities in the north of the country, some emergency patients and babies born prematurely had to be transferred to hospitals in Belgium. Emergency services in Marseilles have been disorganised owing to the resignation of several doctors. In the south west, nurses are being imported from Spain, whereas in the east many are being attracted by offers from Switzerland. An unexpected increase in the number of births, and particularly multiple and premature births, has placed an additional burden on maternity wards. The number of births,
(Money Magazine) -- We'll go out on a limb and assume you've heard the rumor that Social Security and Medicare are headed for trouble. You've seen alarming stats thrown around and maybe wondered what to make of them. (For example, the two programs are said to have a $43 trillion deficit payable over 75 years. Is that a lot? And if it's as big as it sounds, how is the government still running?) Perhaps you've even slogged through one of the reform plans that politicians, academics and retired CEOs are always dreaming up. But what you really want to know is more basic: How am I supposed to plan for this? Here's where politics meets your portfolio. And as tricky as it is to guess the direction of stocks, it's even harder to predict the long-run electoral fortunes of Republicans and Democrats or the compromises legislators will hammer out. That said, there are some things you can expect when you get to retirement: You'll have a significant Social Security benefit, especially if you're a boomer. The system's problems are quite fixable. Medicare, on the other hand, is headed for crisis. A total meltdown. And soon. For the health insurance program to survive, it will have to make huge changes, and you must start preparing for them. Both programs will be fixed with a combination of benefit cuts and higher taxes. Many of the higher taxes will be levied on your paycheck. But it's also possible that higher taxes on income and investments will hit you in retirement. Well-off retirees - and by that we mean people with pensions and biggish IRAs, not just former hedge fund managers - will increasingly pay stealth taxes on their benefits. And we're not talking about some far-off proposal here. This one's already a done deal. No matter what happens, Social Security and Medicare (in some form) are still going to play a major role in your retirement. So even if your last day of work is 10, 20 or 30 years off, you need to have a basic grasp of the challenges these systems face and the price you'll be asked to pay to keep them alive and kicking. Getting ready is partly a matter of how much you save - but as you'll see, it also matters where you save it. Social Security: How much trouble is it in? Established back in 1935, when the U.S. was mired in the Great Depression, the Social Security program now replaces just under 40% of the average retiree's pre-retirement earnings. Even for higher-paid workers, it represents a significant source of income: For people who currently earn $100,000 or more on the job, Social Security is expected to replace about 25% of their incomes, on average, in retirement. So it had better be there. But thanks largely to the baby boom, there's a funding gap in the not-too-distant future. Social Security is a "pay as you go" retirement system - that is, the Social Security taxes that get deducted from your paycheck today are used to pay out benefits to today's retirees. Right now the Social Security system is taking in more money in tax revenue than it is paying out in benefits, with the surplus being entered into the government's books as the system's "trust fund." But with so many boomers headed into retirement, that situation is likely to reverse sometime around 2017. Benefits will exceed revenue, and Social Security will have to draw on that trust fund. By 2041 the trust fund will be tapped out too. At that point Social Security payroll taxes will be enough to fund only about 78% of promised benefits. The oldest boomers will be 95 that year. The youngest will be 77, with perhaps another decade or two of retirement to fund. The price you'll pay As bad as this all sounds, Social Security could be brought into balance without extreme pain. None of the reform proposals that have gotten the slightest political traction, including President George W. Bush's effort, would touch benefits for anyone over 55 when enacted. Retirement ages could be increased, but with life expectancy rising, that may not be so terrible, at least in a white-collar job. One well-regarded proposal, by economists Peter Diamond and Peter Orszag, would reduce promised benefits gradually, with today's twentysomethings losing just 8.6% of their benefit. Payroll taxes would rise from 6.2% to 7.1% by 2055. That's hardly earth-shattering. And once you were retired, of course, you'd be off the hook for those higher payroll taxes. But you may not be off the hook for all Social Security taxes. You see, Social Security has been in bigger financial trouble before. And the last time it went in for repair, lawmakers put in place some obscure new taxes on affluent retirees to shore up the system. Those taxes are automatically going to snag more and more people. To understand these stealth taxes, you have to look back to the early 1980s. Ronald Reagan appointed a commission, chaired by future Federal Reserve chief Alan Greenspan, to come up with ways to keep Social Security solvent. The commission's recommendation: Make the wealthiest retirees pay partial taxes on their Social Security benefits. In 1984 that recommendation became law. This tax is confusing, to put it mildly. When half of your Social Security benefit, plus all your other income, exceeds $25,000, or $32,000 as a married couple, some of your Social Security benefit starts to count as taxable income. That "other" income includes withdrawals from regular 401(k) accounts and traditional IRAs, as well as payments from a traditional pension plan and any employment income. It also includes dividends, interest and capital gains on investments - even the interest on tax-free municipal bonds is thrown into the calculation. For each dollar of income over that $25,000 threshold, 50� of Social Security counts as taxable income until 50% of your benefit is subject to taxes. (Told you it was confusing.) There's more. In 1994 the Clinton administration upped the ante. Now when half of your Social Security plus other income tops $34,000, or $44,000 for a couple, you have to add 85� of your Social Security to taxable income for each additional dollar of earnings. And the pain doesn't stop until 85% of your benefits have been tossed into your taxable income. At first these rules didn't affect a lot of people. But here's the catch: Like the dreaded alternative minimum tax, those crucial income thresholds weren't indexed to inflation. As a result, a third of all retirees are now paying federal income tax on their Social Security benefits. In 10 years, 43% of retirees will be subject to at least some of this tax. For those caught in it, the tax makes the shelter of 401(k)s and traditional IRAs less valuable than you might have assumed. Let's say you get $24,000 a year from Social Security and draw $22,000 from a pension. That's enough to start moving you into the 85% zone. Every additional dollar you withdraw or earn will have you reporting an additional $1.85 in taxable income. Hit the 25% tax bracket and that adds up to a 46� levy on what surely must have seemed like, and spent like, only a buck of income. Presto: You have an effective marginal tax rate of 46%. Unless, that is, you get your income from somewhere else - but more on that in a moment. This tax is sticking around, says Andrew Biggs, a Social Security expert at the American Enterprise Institute. "If the government dropped the tax, they'd have to come up with something to replace it, which they don't have," he says. Send feedback to Money Magazine
Undescended testis: 513 patients characteristics, age at orchidopexy and patterns of referral Objective Undescended testis (UDT) affects 16% of males. Current recommendations are to correct maldescent by 1year of age. We identify the population characteristics of children referred and managed for UDT, age at referral and orchidopexy, and patterns of referral. Design, setting and patients Retrospective 5-year review of all patients operated for UDT from 2007 to 2011 in our institution. Patient demographics, neonatal diagnosis of UDT, age at referral, referral source and age at first orchidopexy were recorded. Data are reported as median (range). Results There were 513 boys with 576 undescended gonads; 450 (88%) had unilateral UDT. Congenital (present at birth) UDT was diagnosed in 287 (56%) children. Seventy-nine (15%) were premature births, 41 (8%) had associated major genitourinary abnormalities. Median age at referral was 1.1 (016.2) years; median age at first orchidopexy was 1.6 (017.2) years. When corrected for age, those with a history of prematurity and associated major genitourinary malformations were referred and operated on earlier. There was no difference in age at referral and orchidopexy when comparing unilateral versus bilateral maldescent, and palpability of UDT. Of those with congenital UDT, 70% were operated at beyond 1year of age. Those referred from public tertiary hospitals were younger than those referred from community clinics (p<0.0001) and private healthcare institutions (p=0.003). Conclusions Despite early diagnosis in many patients with UDT, most are referred and operated after 1year of age, even in congenital UDT. Premature babies, those with major genitourinary anomalies, and those seen in public tertiary hospitals are referred earlier. Community health initiatives must emphasise prompt referral to allay the impact of delayed surgery.
Actinomycosis. Surgical aspects. Actinomycosis is an anaerobic infection caused by actinomycetes, which are part of the normal flora in the oral cavity and intestine. Antecedent disease or surgery predisposes to infection, and involved tissue becomes indurated and forms multiple draining fistulae discharging characteristic sulfur granules. Three principal clinical syndromes are described: cervicofacial, thoracic, and abdominal. Recently pelvic actinomycosis has become more prevalent and associated with women who use the intrauterine device. The diagnosis of actinomycosis usually is made at surgery. Biopsied material histologically demonstrates sulfur granules and filamentous gram-positive rods. The differential diagnosis includes cancer and other chronic infections. Treatment consists of appropriate antimicrobial therapy and often surgery including incision and drainage or excision of abscesses, drainage of empyemas, and removal of persistent sinuses.
<filename>cli/helpers_test.go package main import ( "bytes" "io" "io/ioutil" "os" "path/filepath" "strings" "testing" ) type TestResult struct { stdout string err error } func runWithArgs(additionalArgs ...string) TestResult { args := os.Args[0:1] args = append(args, additionalArgs...) old := os.Stdout // keep backup of the real stdout r, w, _ := os.Pipe() os.Stdout = w err := run(args) outC := make(chan string) // copy the output in a separate goroutine so printing can't block indefinitely go func() { var buf bytes.Buffer io.Copy(&buf, r) outC <- buf.String() }() // back to normal state w.Close() os.Stdout = old // restoring the real stdout return TestResult{ stdout: <-outC, err: err, } } func (result TestResult) Success() bool { return result.err == nil } func (result TestResult) Error() error { return result.err } func (result TestResult) Stdout() string { return result.stdout } func (result TestResult) StdoutContains(pattern string) bool { return strings.Contains(result.Stdout(), pattern) } type TestIOContext struct { path string } func NewTestIOContext(t *testing.T) TestIOContext { dir, err := ioutil.TempDir("", "ngssc_test") if err != nil { panic(err) } context := TestIOContext{path: dir} t.Cleanup(func() { err := os.RemoveAll(context.path) if err != nil { panic(err) } }) return context } func (context TestIOContext) CreateFile(fileName string, content string) { filePath := filepath.Join(context.path, fileName) ioutil.WriteFile(filePath, []byte(content), 0644) } func (context TestIOContext) FileContains(fileName string, pattern string) bool { return strings.Contains(context.ReadFile(fileName), pattern) } func (context TestIOContext) ReadFile(fileName string) string { filePath := filepath.Join(context.path, fileName) fileContent, err := ioutil.ReadFile(filePath) if err != nil { panic(err) } return string(fileContent) } func (context TestIOContext) CreateLanguageContext(language string) TestIOContext { path := filepath.Join(context.path, language) err := os.Mkdir(path, 0755) if err != nil { panic(err) } languageContext := TestIOContext{path} return languageContext }
// Problem: https://leetcode.com/problems/next-permutation/ #include <vector> #include "utils.h" namespace next_permutation { class Solution { public: // Time: O(n), Space: O(1) void run(std::vector<int>& nums) { if (nums.size() <= 1) return; // Find the tail sorted in decreasing order in nums: // nums[0] ... nums[i] < nums[i+1] >= nums[i+2] >= ... >= nums[n-1] int i = nums.size() - 2; while (i >= 0 && nums[i] >= nums[i + 1]) i--; // The tail nums[i+1, n] is lexicographically the largest possible // sequence of elements {nums[i+1], ..., nums[n-1]}. So, the next // lexicographical nums must differ from the original one at position i. // Therefore, nums[i] must be replaced with an element from the tail, // and this element must be the lowest one but still greater nums[i]: // nums[0] ... nums[i] < nums[i+1] >= ... >= nums[x] >= nums[x+1] >= ... >= nums[n-1], // nums[i] < nums[x] and nums[i] >= nums[x+1] if (i >= 0) { int x = i + 2; while (x < nums.size() && nums[i] < nums[x]) x++; std::swap(nums[x - 1], nums[i]); } // The new tail is also sorted in descending order, i.e. the largest // lexicographical sequence among such tails. So reverse it to // get the lowest one, so that new nums become the next permutation. for (int i1 = i + 1, i2 = nums.size() - 1; i1 < i2; i1++, i2--) std::swap(nums[i1], nums[i2]); } }; int main() { std::vector<int> v; ASSERT(( Solution().run(v = {}), v == std::vector<int>{} )); ASSERT(( Solution().run(v = {1}), v == std::vector<int>{1} )); ASSERT(( Solution().run(v = {1, 2}), v == std::vector<int>{2, 1} )); ASSERT(( Solution().run(v = {1, 2, 3}), v == std::vector<int>{1, 3, 2} )); ASSERT(( Solution().run(v = {1, 3, 2}), v == std::vector<int>{2, 1, 3} )); ASSERT(( Solution().run(v = {2, 1, 3}), v == std::vector<int>{2, 3, 1} )); ASSERT(( Solution().run(v = {2, 3, 1}), v == std::vector<int>{3, 1, 2} )); ASSERT(( Solution().run(v = {3, 1, 2}), v == std::vector<int>{3, 2, 1} )); ASSERT(( Solution().run(v = {3, 2, 1}), v == std::vector<int>{1, 2, 3} )); ASSERT(( Solution().run(v = {1, 1, 1}), v == std::vector<int>{1, 1, 1} )); ASSERT(( Solution().run(v = {1, 1, 2}), v == std::vector<int>{1, 2, 1} )); ASSERT(( Solution().run(v = {1, 2, 1}), v == std::vector<int>{2, 1, 1} )); return 0; } }
GADIA: A Greedy Asynchronous Distributed Interference Avoidance Algorithm In this paper, the problem of distributed dynamic frequency allocation is considered for a canonical communication network, which spans several networks such as cognitive radio networks and digital subscriber lines (DSLs). A greedy asynchronous distributed interference avoidance (GADIA) algorithm for horizontal spectrum sharing has been proposed that achieves performance close to that of a centralized optimal algorithm. The convergence of the GADIA algorithm to a near-optimal frequency allocation strategy is proved and several asymptotic performance bounds have been established for various spatial configurations of the network nodes. Furthermore, the near-equilibrium dynamics of the GADIA algorithm has been studied using the Glauber dynamics, by identifying the problem with the antiferromagnetic inhomogeneous long-range Potts model. Using the near-equilibrium dynamics and methods from stochastic analysis, the robustness of the algorithm with respect to time variations in the activity of network nodes is studied. These analytic results along with simulation studies reveal that the performance is close to that of an optimum centralized frequency allocation algorithm. Further simulation studies confirm that our proposed algorithm outperforms the iterative water-filling algorithm in the low signal-to-interference-plus-noise ratio (SINR) regime, in terms of achieved sum rate, complexity, convergence rate, and robustness to time-varying node activities.
<filename>components/ingest-service/pipeline/publisher/noop.go package publisher import ( "github.com/chef/automate/components/ingest-service/pipeline/message" ) func noop(in <-chan message.ChefRun) <-chan message.ChefRun { out := make(chan message.ChefRun, 10) go func() { for msg := range in { message.PropagateChefRun(out, &msg) } }() return out } func actionsNoop(in <-chan message.ChefAction) <-chan message.ChefAction { out := make(chan message.ChefAction, 10) go func() { for msg := range in { message.PropagateChefAction(out, &msg) } }() return out }
/* Copyright ©2019 lq186.com Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /* FileName: OpenIdOAuth2TokenServiceImpl.java Date: 2019/3/26 Author: lq */ package com.lq186.shiro.oauth2.service.impl; import com.lq186.shiro.oauth2.bean.AdditionalInfoOAuthToken; import com.lq186.shiro.oauth2.consts.AccessTokenProperties; import com.lq186.shiro.oauth2.consts.ErrorDescriptions; import com.lq186.shiro.oauth2.enitty.OAuth2Client; import com.lq186.shiro.oauth2.enitty.OAuth2OpenId; import com.lq186.shiro.oauth2.enitty.OAuth2User; import com.lq186.shiro.oauth2.service.OAuth2OpenIdService; import com.lq186.shiro.oauth2.service.OAuth2TokenService; import com.lq186.shiro.oauth2.service.OAuth2TokenStoreService; import com.lq186.shiro.oauth2.service.OAuth2UserService; import org.apache.oltu.oauth2.as.issuer.OAuthIssuer; import org.apache.oltu.oauth2.common.error.OAuthError; import org.apache.oltu.oauth2.common.exception.OAuthProblemException; import org.apache.oltu.oauth2.common.exception.OAuthSystemException; import org.apache.oltu.oauth2.common.token.OAuthToken; import org.apache.shiro.SecurityUtils; import org.apache.shiro.authc.SimpleAuthenticationInfo; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.Optional; @Service public class OpenIdOAuth2TokenServiceImpl implements OAuth2TokenService { @Resource private OAuth2OpenIdService openIdService; @Resource private OAuth2UserService userService; @Resource private OAuthIssuer oAuthIssuer; @Resource private OAuth2TokenStoreService tokenStoreService; @Override public OAuthToken loadOrCreateToken(OAuth2Client client, String scopes) throws OAuthSystemException, OAuthProblemException { Object principal = SecurityUtils.getSubject().getPrincipal(); String username; if (principal instanceof String) { username = (String) principal; } else if (principal instanceof SimpleAuthenticationInfo) { username = (String) ((SimpleAuthenticationInfo) principal).getPrincipals().getPrimaryPrincipal(); } else { throw OAuthProblemException.error(OAuthError.CodeResponse.ACCESS_DENIED, ErrorDescriptions.ACCESS_DENIED); } Optional<OAuth2User> userOptional = userService.getByUsername(username); if (!userOptional.isPresent()) { throw OAuthProblemException.error(OAuthError.CodeResponse.ACCESS_DENIED, ErrorDescriptions.ACCESS_DENIED); } AdditionalInfoOAuthToken token = new AdditionalInfoOAuthToken(oAuthIssuer.accessToken(), AccessTokenProperties.TOKEN_TYPE_VALUE, AccessTokenProperties.EXPIRES_IN_VALUE, oAuthIssuer.refreshToken(), scopes); OAuth2OpenId oAuth2OpenId = openIdService.getOpenIdCreateNewIfNotExists(client, userOptional.get()); token.addAdditionalInfo("openid", oAuth2OpenId.getOpenid()); tokenStoreService.saveToken(token, client, userOptional.get()); return token; } @Override public Optional<OAuthToken> readAccessToken(String accessToken) { return tokenStoreService.getByAccessToken(accessToken); } @Override public Optional<OAuth2User> getOAuth2UserByAccessToken(String accessToken) { return tokenStoreService.getUsernameByAccessToken(accessToken); } }
Sharon Dunn and John Clayton are members of the Hands Across the Hills project, an initiative to connect the people of Leverett, where about 90 percent voted for Hillary Clinton, with those of Letcher County, Kentucky, where 80 percent voted for Trump. Clayton wrote an essay with Sharon’s help on the Kentuckians visiting Leverett. In April, folks from Leverett went down to Kentucky for a return visit, and Dunn wrote an essay about that with Clayton’s help. Listen as they discuss how their dialogues with folks on the other end of the political spectrum went, and how they found more in common than they thought.
<reponame>Tonysp/RankedPvP<filename>src/main/java/dev/tonysp/rankedpvp/Utils.java /* * * * This file is part of RankedPvP, licensed under the MIT License. * * * * Copyright (c) 2020 <NAME> * * * * Permission is hereby granted, free of charge, to any person obtaining a copy * * of this software and associated documentation files (the "Software"), to deal * * in the Software without restriction, including without limitation the rights * * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * * copies of the Software, and to permit persons to whom the Software is * * furnished to do so, subject to the following conditions: * * * * The above copyright notice and this permission notice shall be included in all * * copies or substantial portions of the Software. * * * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * * SOFTWARE. * */ package dev.tonysp.rankedpvp; import net.md_5.bungee.api.ChatColor; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.World; import java.sql.Timestamp; import java.util.Optional; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Utils { private static final Pattern hexColorPattern = Pattern.compile("(\\{#[a-fA-F0-9]{6}})"); public static String formatString(String text){ Matcher hexColorMatcher = hexColorPattern.matcher(text); while (hexColorMatcher.find()) { text = text.replace(hexColorMatcher.group(1), "" + ChatColor.of(hexColorMatcher.group(1).replace("{", "").replace("}", ""))); } return ChatColor.translateAlternateColorCodes('&', text); } public static String secondStringRemaining (int seconds) { if (seconds >= 5 || seconds == 0) { return Messages.FIVE_OR_MORE_REMAINING.getMessage() + " " + secondString(seconds) + "."; } else if (seconds >= 2) { return Messages.TWO_TO_FOUR_REMAINING.getMessage() + " " + secondString(seconds) + "."; } else { return Messages.ONE_REMAINING.getMessage() + " " + secondString(seconds) + "."; } } public static String secondString (int seconds) { if (seconds >= 5 || seconds == 0) { return seconds + " " + Messages.FIVE_OR_MORE_SECONDS.getMessage(); } else if (seconds >= 2) { return seconds + " " + Messages.TWO_TO_FOUR_SECONDS.getMessage(); } else { return seconds + " " + Messages.ONE_SECOND.getMessage(); } } public static String minutesString (int minutes) { if (minutes >= 5 || minutes == 0) { return minutes + " " + Messages.FIVE_OR_MORE_MINUTES.getMessage(); } else if (minutes >= 2) { return minutes + " " + Messages.TWO_TO_FOUR_MINUTES.getMessage(); } else { return minutes + " " + Messages.ONE_MINUTE.getMessage(); } } public static String playersString (int amount) { if (amount >= 5 || amount == 0) { return Messages.FIVE_OR_MORE_PLAYERS.getMessage(); } else if (amount >= 2) { return Messages.TWO_TO_FOUR_PLAYERS.getMessage(); } else { return Messages.ONE_PLAYER.getMessage(); } } public static Timestamp getCurrentTimeStamp() { java.util.Date today = new java.util.Date(); return new java.sql.Timestamp(today.getTime()); } public static Optional<Location> teleportLocationFromString (String locationString) { Location location; try { String[] parts = locationString.split(","); World world = Bukkit.getWorld(parts[5]); if (world == null) { return Optional.empty(); } location = new Location(world, Double.parseDouble(parts[0]), Double.parseDouble(parts[1]), Double.parseDouble(parts[2]), Float.parseFloat(parts[3]), Float.parseFloat(parts[4])); } catch (Exception e) { e.printStackTrace(); return Optional.empty(); } return Optional.of(location); } }
/** * Created by tomas on 3/10/16. */ public class DefaultCallbackServiceWrapper implements CallbackServiceWrapper { private static final Logger LOGGER = LoggerFactory.getLogger(DefaultCallbackServiceWrapper.class); private final AquariumInput aquariumInput; private final DefaultAquariumCallbackService baseAquariumCallbackService; public DefaultCallbackServiceWrapper(AquariumInput aquariumInput, DefaultAquariumCallbackService baseAquariumCallbackService) { this.aquariumInput = aquariumInput; this.baseAquariumCallbackService = baseAquariumCallbackService; } @Override public void execute(String url, AquariumInternal aquariumInternal){ baseAquariumCallbackService.process(aquariumInput, aquariumInternal); } }
<filename>projects/batfish-common-protocol/src/main/java/org/batfish/common/bdd/BDDInteger.java package org.batfish.common.bdd; import static com.google.common.base.Preconditions.checkArgument; import com.google.common.collect.ImmutableList; import java.util.ArrayList; import java.util.List; import java.util.Optional; import net.sf.javabdd.BDD; import net.sf.javabdd.BDDFactory; import org.batfish.datamodel.Ip; import org.batfish.datamodel.IpWildcard; import org.batfish.datamodel.Prefix; public abstract class BDDInteger { protected final BDDFactory _factory; protected final BDD[] _bitvec; protected final long _maxVal; // Temporary ArrayLists used to optimize some internal computations. private final List<BDD> _trues; private final List<BDD> _falses; protected BDDInteger(BDDFactory factory, BDD[] bitvec) { checkArgument(bitvec.length < 64, "Only lengths up to 63 are supported"); _factory = factory; _bitvec = bitvec; _maxVal = 0xFFFF_FFFF_FFFF_FFFFL >>> (64 - bitvec.length); _trues = new ArrayList<>(bitvec.length); _falses = new ArrayList<>(bitvec.length); } /** Returns the number of bits in this {@link BDDInteger}. */ public int size() { return _bitvec.length; } /** Find a representative value of the represented integer that satisfies a given constraint. */ public abstract Optional<Long> getValueSatisfying(BDD bdd); public abstract long satAssignmentToLong(BDD satAssignment); public int satAssignmentToInt(BDD bdd) { checkArgument( _bitvec.length <= 31, "Only BDDInteger of 31 or fewer bits can be converted to int"); return (int) satAssignmentToLong(bdd); } /** * Return a list of values satisfying the input {@link BDD}, up to some maximum number. * * @param bdd A constraint on this. * @param max The maximum number of values desired. * @return The satisfying values. */ public List<Long> getValuesSatisfying(BDD bdd, int max) { ImmutableList.Builder<Long> values = new ImmutableList.Builder<>(); checkArgument(max > 0, "max must be > 0"); int num = 0; BDD pred = bdd; while (num < max) { if (pred.isZero()) { break; } long val = satAssignmentToLong(pred.satOne()); values.add(val); pred = pred.diff(value(val)); num++; } return values.build(); } /** Build a constraint that matches the set of IPs contained by the input {@link Prefix}. */ public BDD toBDD(Prefix prefix) { return firstBitsEqual(prefix.getStartIp(), prefix.getPrefixLength()); } /** Build a constraint that matches the input {@link Ip}. */ public BDD toBDD(Ip ip) { return firstBitsEqual(ip, Prefix.MAX_PREFIX_LENGTH); } /** Build a constraint that matches the {@link Ip IPs} matched by the input {@link IpWildcard}. */ public BDD toBDD(IpWildcard ipWildcard) { checkArgument(_bitvec.length >= Prefix.MAX_PREFIX_LENGTH); long ip = ipWildcard.getIp().asLong(); long wildcard = ipWildcard.getWildcardMask(); _trues.clear(); _falses.clear(); for (int i = Prefix.MAX_PREFIX_LENGTH - 1; i >= 0; i--) { boolean significant = !Ip.getBitAtPosition(wildcard, i); if (significant) { boolean bitValue = Ip.getBitAtPosition(ip, i); if (bitValue) { _trues.add(_bitvec[i]); } else { _falses.add(_bitvec[i]); } } } return _factory.andAll(_trues).diffWith(_factory.orAll(_falses)); } /** Check if the first length bits match the BDDInteger representing the advertisement prefix. */ private BDD firstBitsEqual(Ip ip, int length) { checkArgument(length <= _bitvec.length, "Not enough bits"); long b = ip.asLong(); _trues.clear(); _falses.clear(); for (int i = length - 1; i >= 0; i--) { boolean bitValue = Ip.getBitAtPosition(b, i); if (bitValue) { _trues.add(_bitvec[i]); } else { _falses.add(_bitvec[i]); } } return _factory.andAll(_trues).diffWith(_factory.orAll(_falses)); } /* * Create a BDD representing the exact value */ public BDD value(long val) { checkArgument(val >= 0, "value is negative"); checkArgument(val <= _maxVal, "value %s is out of range [0, %s]", val, _maxVal); long currentVal = val; _trues.clear(); _falses.clear(); for (int i = _bitvec.length - 1; i >= 0; i--) { if ((currentVal & 1) != 0) { _trues.add(_bitvec[i]); } else { _falses.add(_bitvec[i]); } currentVal >>= 1; } return _factory.andAll(_trues).diffWith(_factory.orAll(_falses)); } // Helper function to compute leq on the last N bits of the input value. private BDD leqN(long val, int n) { assert n <= _bitvec.length; long currentVal = val; BDD acc = _factory.one(); // whether the suffix of BDD is leq suffix of val. for (int i = 0; i < n; ++i) { BDD bit = _bitvec[_bitvec.length - i - 1]; if ((currentVal & 1) != 0) { // since this bit of val is 1: 0 implies lt OR 1 and suffix leq. ('1 and' is redundant). acc.invimpEq(bit); // "not i or acc" rewritten "i implies acc" and flipped. } else { // since this bit of val is 0: must be 0 and have leq suffix. acc.diffEq(bit); // "not i and acc" rewritten "i less acc" and flipped. } currentVal >>= 1; } return acc; } /* * Less than or equal to on integers */ public BDD leq(long val) { checkArgument(val >= 0, "value is negative"); checkArgument(val <= _maxVal, "value %s is out of range [0, %s]", val, _maxVal); return leqN(val, _bitvec.length); } // Helper function to compute geq on the last N bits of the input value. private BDD geqN(long val, int n) { assert n <= _bitvec.length; long currentVal = val; BDD acc = _factory.one(); // whether the suffix of BDD is geq suffix of val. for (int i = 0; i < n; ++i) { BDD bit = _bitvec[_bitvec.length - i - 1]; if ((currentVal & 1) != 0) { // since this bit of val is 1: must be 1 and have geq suffix. acc.andEq(bit); } else { // since this bit of val is 0: 1 implies gt OR 0 and suffix geq. ('0 and' is redundant.) acc.orEq(bit); } currentVal >>= 1; } return acc; } /* * Greater than or equal to on integers */ public BDD geq(long val) { checkArgument(val >= 0, "value is negative"); checkArgument(val <= _maxVal, "value %s is out of range [0, %s]", val, _maxVal); return geqN(val, _bitvec.length); } /* * Integers in the given range, inclusive, where {@code a} is less than or equal to {@code b}. */ // This is basically this.geq(a).and(this.leq(b)). Differences: // 1. Short-circuit a == b // 2. Save work in the case where a and b have a common prefix, including when a and/or b is the // start/end of the prefix. public BDD range(long a, long b) { checkArgument(a <= b, "range is not ordered correctly"); checkArgument(a >= 0, "value is negative"); checkArgument(b <= _maxVal, "value %s is out of range [0, %s]", b, _maxVal); if (a == b) { return value(a); } long bitOfFirstDifference = Long.highestOneBit(a ^ b); int sizeOfDifferentSuffix = Long.numberOfTrailingZeros(bitOfFirstDifference) + 1; assert sizeOfDifferentSuffix < 64; long suffixMask = 0xFFFF_FFFF_FFFF_FFFFL >>> (64 - sizeOfDifferentSuffix); BDD lower = ((a & suffixMask) == 0) ? _factory.one() : geqN(a, sizeOfDifferentSuffix); BDD upper = ((b & suffixMask) == suffixMask) ? _factory.one() : leqN(b, sizeOfDifferentSuffix); BDD between = lower.andWith(upper); long currentVal = a >> sizeOfDifferentSuffix; for (int i = sizeOfDifferentSuffix; i < _bitvec.length; ++i) { BDD bit = _bitvec[_bitvec.length - i - 1]; if ((currentVal & 1) != 0) { between = between.andEq(bit); } else { between = between.diffEq(bit); // "not i and x" rewritten "i less x" } currentVal >>= 1; } return between; } public BDDFactory getFactory() { return _factory; } }
import React, { PureComponent } from 'react'; import { ImageSourcePropType, ImageStyle, StyleProp, TextStyle, TouchableOpacityProps, ViewStyle, ViewProps } from 'react-native'; declare const LABEL_FORMATTER_VALUES: readonly [1, 2, 3, 4]; export declare enum BADGE_SIZES { pimpleSmall = 6, pimpleBig = 10, pimpleHuge = 14, small = 16, default = 20, large = 24 } declare type LabelFormatterValues = typeof LABEL_FORMATTER_VALUES[number]; export declare type BadgeSizes = keyof typeof BADGE_SIZES; export declare type BadgeProps = ViewProps & TouchableOpacityProps & { /** * Text to show inside the badge. * Not passing a label (undefined) will present a pimple badge. */ label?: string; /** * Color of the badge background */ backgroundColor?: string; /** * the badge size (default, small) */ size?: BadgeSizes | number; /** * Press handler */ onPress?: (props: any) => void; /** * Defines how far a touch event can start away from the badge. */ hitSlop?: ViewProps['hitSlop']; /** * width of border around the badge */ borderWidth?: number; /** * radius of border around the badge */ borderRadius?: number; /** * color of border around the badge */ borderColor?: ImageStyle['borderColor']; /** * Additional styles for the top container */ containerStyle?: StyleProp<ViewStyle>; /** * Additional styles for the badge label */ labelStyle?: TextStyle; /** * Receives a number from 1 to 4, representing the label's max digit length. * Beyond the max number for that digit length, a "+" will show at the end. * If set to a value not included in LABEL_FORMATTER_VALUES, no formatting will occur. * Example: labelLengthFormater={2}, label={124}, label will present "99+". */ labelFormatterLimit?: LabelFormatterValues; /** * Renders an icon badge */ icon?: ImageSourcePropType; /** * Additional styling to badge icon */ iconStyle?: object; /** * Additional props passed to icon */ iconProps?: object; /** * Custom element to render instead of an icon */ customElement?: JSX.Element; /** * Use to identify the badge in tests */ testId?: string; }; /** * @description: Round colored badge, typically used to show a number * @extends: Animatable.View * @extendsLink: https://github.com/oblador/react-native-animatable * @image: https://user-images.githubusercontent.com/33805983/34480753-df7a868a-efb6-11e7-9072-80f5c110a4f3.png * @example: https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/BadgesScreen.tsx */ declare class Badge extends PureComponent<BadgeProps> { styles: ReturnType<typeof createStyles>; static displayName: string; constructor(props: BadgeProps); get size(): number | "small" | "default" | "pimpleSmall" | "pimpleBig" | "pimpleHuge" | "large"; getAccessibilityProps(): { accessible: boolean; accessibilityRole: string; accessibilityLabel: string | undefined; }; isSmallBadge(): boolean; getBadgeSizeStyle(): any; getFormattedLabel(): any; getBorderStyling(): ViewStyle; renderLabel(): JSX.Element | undefined; renderCustomElement(): JSX.Element | undefined; renderIcon(): 0 | JSX.Element | undefined; render(): JSX.Element; } declare function createStyles(props: BadgeProps): { badge: { alignSelf: "flex-start"; borderRadius: any; backgroundColor: any; alignItems: "center"; justifyContent: "center"; overflow: "hidden"; }; label: any; labelSmall: any; }; export { Badge }; declare const _default: React.ComponentClass<ViewProps & TouchableOpacityProps & { /** * Text to show inside the badge. * Not passing a label (undefined) will present a pimple badge. */ label?: string | undefined; /** * Color of the badge background */ backgroundColor?: string | undefined; /** * the badge size (default, small) */ size?: number | "small" | "default" | "pimpleSmall" | "pimpleBig" | "pimpleHuge" | "large" | undefined; /** * Press handler */ onPress?: ((props: any) => void) | undefined; /** * Defines how far a touch event can start away from the badge. */ hitSlop?: import("react-native").Insets | undefined; /** * width of border around the badge */ borderWidth?: number | undefined; /** * radius of border around the badge */ borderRadius?: number | undefined; /** * color of border around the badge */ borderColor?: string | typeof import("react-native").OpaqueColorValue | undefined; /** * Additional styles for the top container */ containerStyle?: StyleProp<ViewStyle>; /** * Additional styles for the badge label */ labelStyle?: TextStyle | undefined; /** * Receives a number from 1 to 4, representing the label's max digit length. * Beyond the max number for that digit length, a "+" will show at the end. * If set to a value not included in LABEL_FORMATTER_VALUES, no formatting will occur. * Example: labelLengthFormater={2}, label={124}, label will present "99+". */ labelFormatterLimit?: 1 | 3 | 2 | 4 | undefined; /** * Renders an icon badge */ icon?: number | import("react-native").ImageURISource | import("react-native").ImageURISource[] | undefined; /** * Additional styling to badge icon */ iconStyle?: object | undefined; /** * Additional props passed to icon */ iconProps?: object | undefined; /** * Custom element to render instead of an icon */ customElement?: JSX.Element | undefined; /** * Use to identify the badge in tests */ testId?: string | undefined; } & { useCustomTheme?: boolean | undefined; }, any> & typeof Badge; export default _default;
import time import streamlit as st my_bar = st.progress(0) for percent_complete in range(100): time.sleep(0.1) my_bar.progress(percent_complete + 1)
package com.wu.sbdemo.shiro.po; import com.wu.sbdemo.shiro.constant.UserStatus; import org.hibernate.annotations.GenericGenerator; import javax.persistence.*; import java.util.ArrayList; import java.util.List; /** * 资源 * @author: wusq * @date: 2018/11/16 */ @Entity @Table(name="user_test") public class User { @Id @GenericGenerator(name = "uuid", strategy = "uuid") @GeneratedValue(generator = "uuid") @Column(length = 32, unique = true, nullable = false) private String id; @Column(length = 32, nullable = false) private String username; @Column(length = 32, nullable = false) private String password; @Column(length = 32, nullable = false) private String salt; @Column(length = 32, nullable = false) private String status = UserStatus.NORMAL.value; @ManyToMany(fetch = FetchType.EAGER) // 立即从数据库中进行加载数据; @JoinTable(name = "user_role_test", joinColumns = { @JoinColumn(name = "user_id") }, inverseJoinColumns = {@JoinColumn(name = "role_id") }) private List<Role> roleList = new ArrayList<>(); public String getCredentialsSalt(){ return this.username + this.salt; } public String getId() { return id; } public void setId(String id) { this.id = id; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getSalt() { return salt; } public void setSalt(String salt) { this.salt = salt; } public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } public List<Role> getRoleList() { return roleList; } public void setRoleList(List<Role> roleList) { this.roleList = roleList; } }
// Usage return the usage message of ClientType func (ct ClientType) Usage() string { switch ct { case ClientMake: return ClientMakeUsage case ClientCMake: return ClientCMakeUsage case ClientBazel: return ClientBazelUsage case ClientBlade: return ClientBladeUsage case ClientNinja: return ClientNinjaUsage } return "unknown" }
Practicing is the most important thing you can do as a musician. Or so everyone says…But let’s be honest, practicing can be a real drag sometimes. It can feel like the daily chore that you can never escape. Hours of tedious warm-up routines, endless technical exercises, and slogging through every key while staring at the seconds ticking by on the clock… Yet, somehow the world’s greatest musicians learned to embrace the art of practicing and even love it. And if you’re serious about becoming a successful musician, you’ve got to do it too. So what was their secret? Well, the key to loving your practice often comes down to what you’re not doing. And what you’re not doing are 3 simple techniques that turn practice from a daily chore into one of the most productive activities in your musical life. Let’s start with number one… I) Your practice doesn’t have a personal goal Why do you practice? What’s the point? For most musicians the reason for practicing comes from other people. Your parents push you to practice, your teachers give you assignments, that cranky old piano instructor threatens you every week, and there’s the constant pressure to keep up with your friends and colleagues. All of this is hanging over your head as you walk into the practice room… As a musician, you know that practice is expected of you…but have you ever stopped to ask what you want? Finding the answer to this question is the single most important thing you can do to improve and actually enjoy your practice time. So stop practicing to please other people or to fulfill an obligation. You should have a personal reason to walk into the practice room – a mission that’s connected to the reason you were drawn to music. Inspiration, wonder, excitement, fun. Because at the end of the day your practice is all about you. It’s your time to develop technique, your time to listen to your favorite players, and your time to choose the direction you want to take in music. Think about it: What musicians do you aspire to sound like? What solos do you want to transcribe? What tunes are you going to learn? What have you always wished you could do as a musician? These are the things you should be practicing. Connect to the driving force from your love of music and go into the practice room with the aim of achieving these goals. Not only will you improve faster – it’ll actually be fun! Curious about what to practice or looking for some effective ideas for the woodshed? Take a look at this slideshow to learn how to get more focused and productive with your daily practice: II) You’re starting with the wrong mindset What most musicians don’t know is that effective practice starts before you even touch your instrument… It starts with your mindset. We all carry around certain beliefs or feelings about music. Experiences from past performances, mistakes in learning, limiting beliefs about our skill set or lingering self-doubt. All of this can subconsciously affect your productivity in the practice room. Maybe you’re getting forced into the practice room by other people and music is starting to feel like a homework assignment. Or maybe you’re rushing through exercises because of competition, self doubt, boredom, a lack of creativity. It’s this mental “baggage” and uncreative environment that can destroy your practice time and even affect your relationship with music. We’ve all been there. But this doesn’t mean that you should give up on practicing or even music. You simply need to change your mindset before you get into the practice room. Strive to get into a relaxed, productive and creative space every time you play your instrument. Aim to free your mind from negativity, stress, and the pressure of competition. This is your time to slow down, focus and work on reaching your musical goals. Try spending a few minutes each day meditating before you start your practice session. And if you want a structured daily guide to reaching peak performance, check out Reprogramming the Musical Mind and discover how to reset your practice and performance mindset. When you reconnect with your love for music and clear your mind, your practice will be much more effective. Remember, it’s enough work learning how to improvise, you shouldn’t let nerves, competition, and negative mindsets get in your way. III) You’re not consistent Effective practice is all about showing up everyday. In fact, consistent and focused time with your instrument is the only way that you’re going to make progress. Now this doesn’t mean that you have to spend 10 hours a day in the practice room to see improvement, but you do have to be consistent in working toward your goals. This means allotting some time each day to focus on music. It can be time on your instrument, time spent working on ear training, or even some focused listening to your favorite solos. All of it will improve your musicianship. Remember, having a “cram session” once a week is less effective than spending 20 focused minutes every day. So pick a goal and spend some time each day working on achieving it piece by piece. This is your chance to improve at the thing that you love doing. Instead of a chore that you force yourself to do every now and then, it’ll become a daily habit that you won’t want to miss. You’ll actually look forward to that time each day that you get the opportunity to improve your craft. That time in the practice room that you have each day to work on your goals. If you want to retain the information that you’re practicing, you’ve got to be consistent. How to enjoy practicing again I still catch myself practicing the wrong way… Picking up my instrument without a goal, going through the motions, feeling pressure to rush ahead and sudden nerves for an upcoming performance. This is life as a musician. But the difference now is that I know to stop, take a deep breath and correct myself. To spend a few minutes getting into the right mindset, to reassess my musical goals, and to make sure I devote some time each day to practice. It all sounds simple in theory, yet it’s highly effective when you put it into practice. Try out these three techniques and I promise you that you’ll look forward to that time in the practice room!
def _does_type_derive_from(self, instance_type, possible_parent_type): return possible_parent_type.refers_to in self.loader.ancestor_set(instance_type.refers_to)
<reponame>khitermedachraf/language-C- #include <stdio.h> #include <stdlib.h> typedef struct Liste Liste; struct Liste { int info; Liste *suiv; }; Liste* Fusion_listes (Liste *L1, *L2) { Liste *L3=NULL, *DL3=NULL; while (L1 != NULL && L2 != NULL) { if (L1->info <= L2->info) { if (L3 != NULL) { DL3 ->suiv =L1; DL3 = L1; } else { L3=L1; DL3=L3; } L1=L1->suiv; } else { if (L3 != NULL) { DL3 ->suiv =L2; DL3 = L2; } else { L3=L2; DL3=L3; } L2=L2->suiv; } } if (L1 != NULL) { DL3 ->suiv =L1; } else { DL3 ->suiv =L2; } L1=L3; return L1 ; } Liste* creation (Liste* T) { Liste *P=NULL, *Q=NULL; int x; scanf("%d", &x); T->info = x; Q =T; scanf("%d", &x); while (x != -1) { P=malloc(sizeof(Liste)); P->info =x; P->suiv =NULL; Q->suiv = P; Q = P; free(P); scanf("%d", &x); } return T; } Liste* affich (Liste* T) { Liste* L=NULL; L=P; while (L != NULL) { printf("%d-->", L->info); L = L->suiv; } } int main() { Liste *M, *N; printf("Remplissez la premiere liste tiree (inserez '-1' pour la terminer)\n"); M=malloc(sizeof(Liste)); creation(Liste* M); printf("Remplissez la deusieme liste triee (inserez '-1' pour la terminer)\n"); N=malloc(sizeof(Liste)); creation(Liste* N); Fusion_listes(Liste *M, *N); printf("Voici la fusion des 2 liste triee:\n"); affich(Liste* M); return 0; }
FLAT CABLE CHARACTERISTIC IMPEDANCE REDUCTION AND MEASUREMENT TECHNIQUES Flat multiconductor cable of the type used for mass insulation displacement connection (i.d.c.) typically has a characteristic impedance (Z0) in the 90 to 150 range. In some applications, it is desirable to have less than half this Z0. A properly configured four-conductor configuration allows us to achieve a low Z0. This technique is extendable to printed-wiring flexible-circuits (flex circuits) as well. The primary application for this four-conductor application is for differential low Z0 applications. Z0 measurements were made using both time-domain reflectometry (t.d.r.) methods and inductance-capacitance (LC) methods. Limitations of both measurement methods are briefly discussed. Lossless line equations are assumed. Flat multiconductor cable is frequently used in a ground-signal-ground-signal application. Measurements were made to determine the effects of different conductor placements. Wednesday, October 3, 2001 11 ANNUAL REGIONAL SYMPOSIUM ON ELECTROMAGNETIC COMPATIBILITY Rocky Mountain Chapter of the IEEE EMC Society, at the Radisson Inn, Northglenn, Colorado. ☺.R. Buhler Storage Technology Corporation MS 4274 One StorageTek Drive Louisville, Colorado 80028-4274 673-7109 [email protected]
The invention relates to an intravenous infusion counter/alarm which quantifies the infusion flow, displays the rate of infusion, and alarms when the infusion malfunctions. The invention includes a main body, an adjusting means which can be inserted into the main body to which a drip infusion tube is attached, and a control circuit providing a light source, light sensing means, and a signal means which verifies the proper flow of infusion, and which sets off an alarm when the flow deviates significantly from a set value. A conventional intravenous infusion set has a drip container, a drip infusion tube, and a transmitting hose extending therefrom, along with an adjusting valve to control the flow of the infusion. Conventionally no monitor is attached to the intravenous set, which displays the rate of infusion and which sets off an alarm when a malfunction is detected. Malfunctions, such as a blockage in the drip infusion tube or a loose adjusting valve, could be lethal to a patient. There is a need for a monitor on the intravenous infusion setup. At the present, the only monitors available are medical personnel, but the cost of diligent monitoring is high. Therefore, it is the purpose of the present invention to obviate the inadequacies of conventional intravenous infusion setups, providing a monitor and alarm such that medical staff time can be more efficiently utilized.
A POSTERIORI ERROR ESTIMATION FOR THE FINITE ELEMENT METHOD-OF-LINES SOLUTION OF PARABOLIC PROBLEMS Babuska and Yu constructed a posteriori estimates for finite element discretization errors of linear elliptic problems utilizing a dichotomy principal stating that the errors of odd-order approximations arise near element edges as mesh spacing decreases while those of even-order approximations arise in element interiors. We construct similar a posteriori estimates for the spatial errors of finite element method-of-lines solutions of linear parabolic partial differential equations on square-element meshes. Error estimates computed in this manner are proven to be asymptotically correct; thus, they converge in strain energy under mesh refinement at the same rate as the actual errors.
A BLOCKED-OFF-REGION STRATEGY TO COMPUTE FIRE-SPREAD SCENARIOS INVOLVING INTERNAL FLAMMABLE TARGETS ABSTRACT A finite-volume blocked-off-region procedure is developed to represent internal flammable targets in fire-spread scenarios. In this procedure, the computational domain includes both gas and solid regions. The standard numerical scheme is modified to render hydrodynamically inactive the solid regions and to match the interface conditions at the burning solid surface correctly. A two-grid refinement procedure is used to solve the conjugate heat and mass transfer problem accurately. The first large-scale scenario concerns the flame spread over a vertical panel exposed to a burner flame. Second, the procedure is used to simulate cone calorimeter tests of particle board. For the latter application, the predicted mass loss rates are in qualitative agreement with experimental data.
Saudia Cargo Background Saudia Cargo provides multi-specialized cargo handling as it operates a fleet of 10 freighter aircraft (B747-8F, B747-400 and B777F) to 13 cargo destinations as well as over 58 belly international destinations across 6 continents. The CEO is Omar Talal Hariri, a member of the Cargo Committee of the International Air Transport Association (IATA). The company won the International Cargo Airline of the year in Africa for 2017 and the Air Cargo Industry Achievement Award in Munich for the same year, as well as the STAT Times International Marketer of the Year Award in 2018. Saudia Cargo has a fleet of B747-8F, B747-400/ERF, B747-400B CF and B777F aircraft. They serve an international group of clients. History A subsidiary of Saudi Arabian Airlines, the company was established as part of a privatization in 2008. In 2008, the company joined the IATA interest group Cargo iQ. In September 2018, the company announced two new terminal projects for King Abdulaziz International Airport in Jeddah, and King Khaled International Airport in Riyadh scheduled to be completed in 2022. It has also expanded to Cairo and Dubai. In 2019, Saudia Cargo sponsored the Saudi International Golf Tournament as the formal logistics partner.
FAMILY and friends have paid their last respects to a much-loved woman who penned her own obit to inform loved ones she had "popped her clogs". Jean Hedley, of Ferryhill, had prepared her death notice which was featured in The Northern Echo last week and contained an invite to her send-off yesterday. She said: "Jean Hedley would like to say to all her loving family and friends that she has finally POPPED HER CLOGS [sic] and gone to be with Ted, her loving late husband who she has missed terribly for 25 years. "Don't be sad, she was ready, it was time to go. There are to be no flowers, no tears, no sad poems or hymns. "Only smiles, happy memories and pretty colours at her send off in Durham Crematorium on Wednesday. "Your love, support and kindness have been wonderful and I'll miss you all." According to her niece Pam Boland, Mrs Hedley was born "in the middle of a snow storm" in Bishop Auckland on May 20, 1927. As child she lived in the town, Escomb and Leeholme before moving to Kirk Merrington in 1947 and then to Ferryhill in 1966 where she stayed. Mrs Hedley had a career in finance, working for the Coal Board and Sedgefield District Council, and married "the love of her life" and late husband Ted in 1947. Following his death in 1993, Mrs Hedley was supported by friend of 70 years Betty Shepherd and "made a new life" in the heart of the Ferryhill community. She became a founder member of the Friends of Ferryhill, in support of Dean Bank and Ferryhill Institute, helped fundraise thousands of pounds for local causes and set up a line dancing class which she ran for 20 years. Ms Boland said: "She always said after she pops her clogs she hopes everyone else keeps their dancing shoes on." For the last year Mrs Hedley had been living in Aycliffe Care Home, in Newton Aycliffe. It was there that she received more than 100 cards for her 91st birthday in May, which family saw as a testament to those who admired her. Paying tribute to her aunt, Ms Boland said: "She was the richest lady ever - family and friends rich, the best kind of rich. She invested her time, expertise and love in people and was surrounded always by love and admiration for her warmth, generosity, self deprecating humour, and her many talents including fundraising, baking, sewing, embroidery, knitting, crochet, and the list goes on." She added: "Jean had a heart so big that it comfortably fit all of us in, it treasured each and every one and made us all feel special." Mrs Hedley died aged 91 on October 24.
Conclusion: what can we learn? This chapter recalls the intriguing set of interviews with twentieth-century social researchers that are available for further reading, listening to and scrutiny. It examines how empirical social research was conducted and given shape in mid-twentieth-century Britain. The chapter aims to put on record the fascinating stories of some earlier creative researchers working in intriguing new ways before they become forgotten. The chapter also seeks to understand better how research happens in practice and to bring together a wider account of how social research was starting to emerge, the puzzles it faced, the institutions it was building. History, and even more sociology, always speaks to a wider story than a single life can hope to achieve. In that sense, the chapter demonstrates some of the very problems our researchers discuss. Ultimately, the chapter analyzes the emergence of a very grounded theory and account of the creative research practice. It then demonstrates the research methods and the elements of the research's fuller account.
// // Created by fanyang on 16-7-24. // #include "../graph.h" #include "../utils.h" #include <fstream> using namespace std; int main(int argc, char** argv) { auto path = getDataPath(); string Ns[] = { "1000", "10000", "100000", "1000000" }; for (const auto& N: Ns) { auto pG21 = Graph::fromFile(path + "/data/pl_" + N + "_2.1.txt"); auto pG25 = Graph::fromFile(path + "/data/pl_" + N + "_2.5.txt"); auto pG29 = Graph::fromFile(path + "/data/pl_" + N + "_2.9.txt"); auto max21 = pG21->maxDegree(), max25 = pG25->maxDegree(), max29 = pG29->maxDegree(); ofstream outFile((path + "/result/star_" + N + "_2.159.txt").c_str()); cout << "Will up to: " << max21 << endl; for (size_t i = 1; i < 1000000; ++i) { if (i - 1 > max21 + 2) break; if (i % 200 == 0) cout << i << endl; auto result21 = pG21->getSubgraphNumber_Star(i).get_str(10); auto result25 = pG25->getSubgraphNumber_Star(i).get_str(10); auto result29 = pG29->getSubgraphNumber_Star(i).get_str(10); outFile << result21.substr(0, 3) << " " << result21.size() << " "; outFile << result25.substr(0, 3) << " " << result25.size() << " "; outFile << result29.substr(0, 3) << " " << result29.size() << " "; outFile << endl; } outFile.close(); } return 0; }
Triclosan applications for biocidal functionalization of polyester and cotton surfaces For 20years, antibacterial functionalization has been one of the most attractive research fields in the textile industry. Nowadays, globalization has spread the microorganisms everywhere and produced many epidemics and pandemics such as smallpox, cholera, tuberculosis, yellow fever, Spanish flu, and coronavirus. The textile materials treated with triclosan would be a strong alternative to obtain antibacterial function against microorganisms for the medical applications, such as face masks, lab coats, and wound dresses. This study aimed to investigate the characterization, antibacterial properties, and durability of triclosan on polyester, polyester/cotton, and cotton surfaces. The pure triclosan and presence of triclosan in solutions were detected by gas chromatographymass spectrometry chromatograms. It can be seen that surfaces were homogeneously covered by triclosan on scanning electron microscope micrographs, and there were new bands on Fourier transform infrared spectra after treatments. Large inhibition zones around all surfaces were observed, and antibacterial activity slightly increased depending on increasing chemical concentrations. The samples demonstrated strong biocidal activity to bacteria for 3h. They lost their antibacterial properties after washing, but they showed good antibacterial (bactericidal) properties and satisfactory durability to washes. The results show that triclosan is a highly effective and durable chemical on polyester and cotton surfaces for medical textile applications. Introduction In recent years, there has been a lot of news about outbreaks and diseases in the world, which negatively affects human life, including coronavirus, influenza, hepatitis, Salmonella, and Escherichia coli infections. 1-3 Therefore, consumers focused extremely on medical products and then, as a natural consequence, the use of textiles on medical, hygiene, and health care fields has become significantly widespread with new antimicrobials, functional fibers, new chemical finishes, and technologies. 4 As a result of all these, Medical Textiles Market is estimated to be valued at 10.5 billion USD by 2022, 5 and medical textiles are one of the most dynamically growing sectors because of changes in demographics, aging, growth of population, global warming, and health risks. Furthermore, the applications in medical textiles are also fairly extensive, for example, biocompatible tissues and implants, bandages and wound dressings, and prosthetics. For medical textiles, the textile industry has focused on developing novel antibacterial chemicals, fibers, and materials since the demand for antibacterial products is growing in including hospitals, military, and personal care products. The textile materials and also human skin can support the growth of microorganisms, transmission, or crossinfection of diseases. Natural fibers such as cotton have been particularly known as a suitable environment to accelerate the growth of microorganisms, and therefore, microbial attacks easily occur on these surfaces. Synthetic fibers such as polyester strongly resist attacks by microorganisms owing to their molecular and hydrophobic structure. However, synthetic fibers and their blends cause more perspiration wetness, and as a result, microbial growth on the human body and textile surfaces occurs quickly. Meanwhile, the functionalization of inert surfaces such as polyester is also a big challenge because of the lack of tethering groups. Consequently, the antibacterial applications for synthetics have become extremely important, and the antibacterial agents used in textiles have also dramatically increased for the last years. For getting antibacterial activity, chemical agents such as chitosan, quaternary ammonium salts (quats), N-halamines, and halogenated phenols have been extensively used in surface functionalization, with antibacterial and fungicidal properties. Antibacterial applications have also been reported in other systems and also poly(ethylene terephthalate) (PET) surfaces could be a promising matrix for metacomposites with negative electromagnetic parameters. Triclosan is a member of halogenated phenoxy phenols 31,32 and also an aromatic compound that has ethers, phenols, and chlorines in its structure. It shows broad-spectrum antibacterial and antifungal activities. For example, sutures with triclosan reduced the infection rate by 30%. Therefore, many healthcare products, such as toothpaste, soaps, and creams, include triclosan. Detergents, including 2% triclosan, are generally tolerated, and handwash goods do uncommonly have allergic reactions. Triclosan is also extremely recommended for textile wet treatments because of its low toxicity to human skin. 15,16,21, In this study, the antibacterial properties and durability of triclosan on polyester, polyester/cotton, and cotton surfaces for medical applications were investigated. Triclosan was treated on surfaces with different concentrations through pad-dry method. The presence of triclosan in the chemical solution was investigated by gas chromatography-mass spectrometry (GC-MS). The structure of treated surfaces was characterized by Fourier transform infrared (FTIR), and the morphological changes were observed by scanning electron microscope (SEM). The antibacterial performances and durability of triclosan and treated surfaces were also studied according to different standard methods against S. aureus and E. coli. For getting antibacterial property on textiles, the solutions of TCS 2 were prepared as 45, 60, and 80 g/L of chemical concentration with water/methyl alcohol mixtures (80/20) and they were applied to fabrics (~6 g) by the pad-dry process with Mathis rollers. The samples were dried at 90°C for 6 min. The weight change on polyester, polyester/cotton, and cotton fabrics after treatments were determined as 0.023, 0.026, and 0.038 g, respectively. The TCS 1 and TCS 2 were analyzed by Agilent GC-MS 6890, and carrier gas was helium. The morphological changes on the surface were investigated with JEOL 6060 SEM, and all surfaces were coated with gold for 200 s before running. The surface spectra were taken from Thermo Nicolet iS50 FTIR spectrometer. The scanned frequencies, number of scan times, and resolution were from 4000 to 400 cm −1, 32, and 2 cm −1, respectively. For TCS 1 and TCS 2, minimum inhibitory concentration (MIC) and minimum bactericidal concentration (MBC) were calculated according to the CLSI M07 A9. During studies, the corresponding supplementary sheets were strictly followed. Tests were applied on 96-well plates. Each well was filled with 100 mL of defined antibacterial dilution and 10 L of bacteria. The turbidity in wells after 24 h was evaluated as to whether bacteria are present or not. For the determination of the MBC, the solution in the wells was transferred onto agar and evaluated for growth after 24 h. For qualitative antibacterial evaluation, the tests were run according to ISO 20645. The activity was measured by microbial growth around the surface. For quantitative antibacterial evaluation, the tests were run according to ASTM 2149. The efficiency was calculated by the percentage reduction rate (R) of bacteria. S. aureus (ATCC 6538) and E. coli (ATCC 35218) were used in all antibacterial tests. Reduction rate (R%) of bacteria was calculated using the formula (equation ) where A is the number of bacteria recovered from inoculated treated test sample in jar incubated for 24 h, and B is the number of bacteria recovered from inoculated treated test sample at "0" contact time. The durability of chemicals on surfaces against repeated washing cycles was tested according to AATCC 61. Samples (2.54 cm 5.08 cm) were subjected to repeated washes in vessels with 50 balls and 150 mL (of 0.15% AATCC detergent) solution. Vessels rotated at 42 r/min and 50°C for 45 min. This one washing cycle is equivalent to five machine washing cycles. After washings, samples were tested according to ASTM 2149. Results and discussion The triclosan-containing chemicals were analyzed by GC-MS. TCS 1 and TCS 2 were dissolved in 1 mL of methyl alcohol with 1, 5, 10, 20, 40, and 80 L concentrations, and these solutions were shaken for 2 min. The gas chromatograms, gas spectra, and mass spectra values were given in Figures 1 and 2 and Table 1, respectively. For TCS 1, the peak has sharply emerged around 12.02-12.18 min, which means the main peak of triclosan (Figures 1(b) and 2(b), Table 1). While focusing on TCS 2, four peaks represented by different chemicals such as diphenylalkane and triclosan in the TCS 2 solution at different retention times. The peak at 12.04 min can be thought of as triclosan (Figures 1(a) and 2(a), Table 1). This result confirmed that triclosan was present in the TCS 2 solution. The morphological changes were observed by SEM, and pictures are given in Figure 3. PET fibers in Figure 3(a) had around a relatively smooth, uniform, and cylindrical surface morphology, but some residuals can be viewed on the fiber surfaces. It can be clearly seen from Figure (c) that PET/CO surfaces have more impurities because of the cotton fibers in their own structure while comparing the PET fibers in Figure 3(a). CO fibers in Figure 3(e) had naturally rougher, more residuals, visible grooves, and irregular shaped cross-sections on the surfaces. The fiber surfaces were homogeneously covered by TCS 2 after treatments. The coating effect on the fibers could be seen in Figure 3(b, d, f) because triclosan can quickly crystallize. The changes on the surface after treatments were analyzed by FTIR, and spectra and specific wavenumber are shown in Figure 4 and Table 2, respectively. The FTIR spectra of TCS 2 were only given for avoiding repetition here since similar results are obtained after treated with TCS 1. The aromatic rings in the structure are easily detected from C-H and C=C-C vibrations. According to TCS 2 spectrum in Figure 4(a), the peaks between 1596 and 1348 cm −1 were the result of C-C stretching in the benzene ring, when the peaks between 1286 and 1098 cm −1 corresponded bending of the aromatic ring C-H bonds. 39 Triclosan might precisely be identified through the peaks at 1473 and 862 cm −1, which referred to the vibration of hydrogen atoms in the aromatic ring and C-C stretching of benzene rings. The carbon-halogen bond has strong absorption, and the major bands of aromatic compounds occur between 1000 and 670 cm −1. The C-Cl stretching should theoretically occur in the range 746-720 cm −1. Meanwhile, the interaction with C=C in chlorinated aromatics can raise as high as 845 cm −1. 40 Previous studies had reported the C-Cl stretching mode at 890 cm −1. 41,42 The Figure 4(c), the aromatic groups and C-Cl vibrational stretching bands of TCS 2 could not clearly be distinguished since they overlapped with the carbonyl stretching bands of the PET. However, new peaks were detected between 1792 and 1761, 1653, 1636, 1541, 1488, 1438, 1387, and 900 cm −1. The shifted and wider band at 900 cm −1 was detected after treated with TCS 2 and this band attributed to the C-Cl vibrational bands of TCS 2. In Table 2, these new bands can link to TCS 2 on the surface of PET. It has been known that CO has numerous hydroxyl groups (Figure 4(d)). The broad peak around 3300 cm −1 and a weak band at 1640 cm −1 are appointed to a hydroxyl group and by the water of hydration, respectively. After treatment (Figure 4(e)), the new peaks appeared at 1597 and 1244 cm −1, which can be attributed to benzene ring vibrations. CO showed the typical peak at 1160 cm −1, but this spectrum changed when TCS 2 is deposited on CO because of C-O-C in cellulose at 1103 cm −1. The intense peaks of TCS 2 on CO were visible in the spectra at 1345, 1103, 863, and 792 cm −1. These new C-Cl stretching peaks confirmed that TCS 2 had been successfully coated onto CO surface after treatments and SEM pictures also supported them. The stretching bands also lost their intensity after treatments. This can be because TCS 2 is attached to surfaces. MIC and MBC values are important to determine the resistance of microorganisms to an antibacterial agent. In vitro, triclosan shows bacteriostatic activity at lower concentrations, 43 and it also has bactericidal activity at higher concentrations 44 since it causes enormous damage to cell membranes and disrupts protein and lipid by inhibiting the enzyme enoyl reductase. 33,34 Meanwhile, the activity is also higher to Gram-positive bacteria than Gram-negative bacteria. 45 Previous studies showed that MIC values of TCS 1 tested in broth and agar generally range between 0.01 and 4 mg/L against S. aureus, 36,46,47 and between 0.09 and 8 mg/L against E. coli. 33,48 However, the concentration in commercial products vary, and it is usually used in liquid soaps of 2-5 mg/L, in hand disinfectants of 2-20 mg/L, and in toothpaste of 3 mg/L. 49,50 For determining MIC and MBC, TCS 1 and TCS 2 were prepared in concentration of 10 mg/L, and results tested in broth and agar are shown in Table 3 Antibacterial activity was qualitatively tested according to ISO 20645. For determination, the absence of bacterial growth underneath the sample (20 mm 20 mm) and the presence of inhibition zone confirm the antibacterial activity. Considering antibacterial protection, the zone should at least be H ⩾ 1 mm. Here, the significant differences between diameters of inhibition zones underneath all samples treated with TCS 2 after taking samples from agar plates were precisely observed. It can also be seen that the zone sizes (antibacterial activity) enlarged with the increase in chemical concentrations, whereas the untreated samples showed no such zones (no antibacterial activity) ( Table 4 and Figure 6). Even at the lowest concentrations, samples treated with TCS 2 inhibited the bacteria with the zones of between 13, 17, and 18 for S. aureus and between 12, 13, and 13 mm for E. coli, respectively. Triclosan not only prevented the growth under the surfaces but also leached continuously out from the surface by restricting the growth of organisms. As a result, these studies have indicated that triclosan killed bacteria on the surface and had good antibacterial activity against both bacteria. Antibacterial activity was quantitatively tested according to ASTM E2149. Considering antibacterial protection, the reduction rate (R) of bacteria should be more than 90%. It can be viewed that untreated PET, PET/CO, and CO samples did not exhibit any significant antibacterial efficacy. The antibacterial property slightly increased depending on chemical concentrations and displayed a remarkable effect on bacteria, even at lower concentrations for 3 h, 95.42%, 96.95%, 97.86%, 91.21%, 92.31%, and 93.41% for bacteria (Tables 5 and 6). It is understood that triclosan targeted fatty acid synthesis by inhibiting the enzyme enoyl reductase, and this inhibition was slow. 35, At higher concentrations, the bisphenol is likely to damage the bacterial membrane. 55 In brief, it was also found that triclosan had good antibacterial and biocidal activities on bacteria and also had more efficiency against S. aureus than E. coli. It is well known that Gram-negative bacteria have an extra outer membrane formed of phospholipids, polysaccharides, and proteins and are therefore known to be generally more resistant to biocides. 56,57 These findings are consistent in the literature. For medical applications, the antibacterial efficacy on the surface should remain constant for as long as possible, preferentially for the lifetime of the textiles. The durability to washes depends substantially on the chemical concentration on the surface, and the reduction of concentration results obviously in loss of effectiveness. The treatments were performed before and after washes according to AATCC 61, as presented in Table 7. The treated samples lost their antibacterial properties after washes. The bacterial reductions of S. aureus and E. coli were about 91.60% and 87.91%, respectively, and fabrics showed good antibacterial (bactericidal) properties also after 10 washes. However, the antibacterial properties decreased to about 70.99% and 69.23% for both bacteria after 20 washes, and fabrics exhibited satisfactory antibacterial activity (bacteriostatic) to washes. Consequently, the treated samples showed satisfactory durability to washes. Conclusion In recent years, the increasing demand for medical textiles and antimicrobial finishings has occurred rapidly because of the increased health and hygiene interests of the consumers. Chitosan, quats, N-halamines, and halogenated phenols have been widely used as antibacterial agents in textile finishing treatments. In this study, the processing, characterization, and antibacterial activity of triclosan on polyester, polyester/cotton, and cotton surfaces were investigated. SEM and FTIR studies proved that triclosan could be introduced into the surface, and fiber surface was coated by triclosan after treatments. Triclosan was found to be effective and stable on getting antibacterial textile surfaces for medical applications, and triclosan-added surfaces provided significant inactivation and long-term activity against S. aureus and E. coli of about 10 5 colony-forming unit (CFU)/mL, even at a lower concentration, while the untreated surfaces did not show any antibacterial activity. This study showed that triclosan is one of the most effective antibacterial chemicals, and it gave new opportunities for medical applications, with incorporated bactericidal effects.
<filename>external/hiir/hiir/StageProcSseV4.hpp /***************************************************************************** StageProcSseV4.hpp Author: <NAME>, 2005 --- Legal stuff --- This program is free software. It comes without any warranty, to the extent permitted by applicable law. You can redistribute it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See http://sam.zoy.org/wtfpl/COPYING for more details. *Tab=3***********************************************************************/ #if defined (hiir_StageProcSseV4_CURRENT_CODEHEADER) #error Recursive inclusion of StageProcSseV4 code header. #endif #define hiir_StageProcSseV4_CURRENT_CODEHEADER #if ! defined (hiir_StageProcSseV4_CODEHEADER_INCLUDED) #define hiir_StageProcSseV4_CODEHEADER_INCLUDED /*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ #include "./StageDataSse.h" #if defined (_MSC_VER) #pragma inline_depth (255) #endif namespace hiir { /*\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ template <int CUR> void StageProcSseV4 <CUR>::process_sample_pos (StageDataSse *stage_ptr, __m128 &y, __m128 &mem) { StageProcSseV4 <CUR - 1>::process_sample_pos (stage_ptr, y, mem); const __m128 x = mem; _mm_store_ps (stage_ptr [PREV]._mem, y); mem = _mm_load_ps (stage_ptr [CUR]._mem); y = _mm_sub_ps (y, mem); const __m128 coef = _mm_load_ps (stage_ptr [CUR]._coef); y = _mm_mul_ps (y, coef); y = _mm_add_ps (y, x); } template <> hiir_FORCEINLINE void StageProcSseV4 <0>::process_sample_pos (StageDataSse * /* stage_ptr */, __m128 & /* y */, __m128 & /* mem */) { // Nothing, stops the recursion } template <int CUR> void StageProcSseV4 <CUR>::process_sample_neg (StageDataSse *stage_ptr, __m128 &y, __m128 &mem) { StageProcSseV4 <CUR - 1>::process_sample_neg (stage_ptr, y, mem); const __m128 x = mem; _mm_store_ps (stage_ptr [PREV]._mem, y); mem = _mm_load_ps (stage_ptr [CUR]._mem); y = _mm_add_ps (y, mem); const __m128 coef = _mm_load_ps (stage_ptr [CUR]._coef); y = _mm_mul_ps (y, coef); y = _mm_sub_ps (y, x); } template <> hiir_FORCEINLINE void StageProcSseV4 <0>::process_sample_neg (StageDataSse * /* stage_ptr */, __m128 & /* y */, __m128 & /* mem */) { // Nothing, stops the recursion } /*\\\ PROTECTED \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ /*\\\ PRIVATE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ } // namespace hiir #endif // hiir_StageProcSseV4_CODEHEADER_INCLUDED #undef hiir_StageProcSseV4_CURRENT_CODEHEADER /*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
Q: Which stocks fell first after some event? I have a panel of daily stock prices $\{Y_{it}\}$, $t \in \{1,...,1000\}$ and some event that occurs at $t=700$ which causes the average stock price to decrease by about 10% over the next 15 days. How do I answer the question "which stocks fell first"? I want to know of the characteristics of stocks that tended to be correlated with very early falls (like, first 1 or 2 days). I have many ideas for sub-sample analysis but none that I want to use involving econometrics. Broad econometric-based ideas welcome. Can survival analysis be used here? Note; I did make an earlier post on this issue that was answered, but I constrained the question way too much and didn't get what I wanted. EDIT: Please don't absolutely answer the question (up to model specification). I just want ideas/suggestions of areas that might be good and a very general approach/suggestion. Then I want to develop it all myself from there. A: I'm not completely clear on the question. It sounds like you may have a supervised learning problem - you have a training set, and want to use that to predict which other stocks are likely to behave in a similar way. Alternatively, perhaps you want to know what your dependent variable really is? What does it mean to "fall early"? Which technique you use will largely be based on whether you're looking for a model which is most interpretable, or a model which is most predictive. Given that it sounds like you know which stocks fell early (i.e. you know which category they belong to) then you could technically just use SVM for classification. This would allow you to find a maximally separating hyperplane in the feature space, and would probably be the most effective way to predict whether other stocks will behave the same way. LDA, logistic regression, neural networks, random forests can all create strong classifiers, but interpretability of the latter methods is low. If this is what you're looking for, then you can easily create a predictor, as you have known groups. However, I think the main problem you're going to experience is that you haven't really specified your dependent variable well. You've mentioned that you know which group a variable falls into, but it sounds like you just want to use statistics to justify that decision - generally, that seems like bad practise. You can't use statistics to justify the assignment of a given subject to a group, that's a matter for logic. Survival analysis would let you analyse the survival curve, but it would require you to set a point below the stock is considered "dead" to the analysis. That point will still be somewhat arbitrary. Because of that, perhaps the real dependent variable you want to analyse is actually some aspect of the price fluctuation following E, such as the volatility, derivative between t1 and t2 etc. Once you decide what you really want to predict, you'll have an easier time choosing the correct technique. Because of that, I think you need to figure out what it means for a stock to "fall early". Logic is the best way, but if you want to handle things in an atheoretical, data driven way, the best way to do that may be: Generate a set of metrics (similar to the ones I mentioned, volatility, derivatives, second derivatives, over various periods) See which of those concrete mathematical measures are most correlated with this predefined group of stocks which "fell early". For example, you might find that having an inflexion point (after smoothing the curve with some parameters) on days t+0 - t+2 was highly correlated with being in the "fell early" group. You may also want to make sure that the measures you're testing (eg. whether there was an inflexion point) are representing significant features in the data, or simply random variability. In pursuit of that goal, you may look to historical data to ascertain the probability that features of that magnitude appear regularly. A: The question you want to ask I think is not "what stocks fell first," that is clear as Zen said, it seems that you want to know what characteristics are common to stocks that fell "first." You must define what that means, ie. what the cutoff point for stocks that fell first is. You mention one day or two days after t=700 in your question, as long as you have a justification for that timeline, that is fine. Just define the period you want to analyse. Robustness checks could be performed by examining different period lengths. I think that if you do that, you can create an indicator variable (1/0) for whether or not the stock "fell early", maybe deciding that using the SVM classifier as mentioned above. I would recommend using a non parametric technique to compare the stocks. If you were interested in a causal interpretation of whether some variable caused prices to drop first, you could use a matching estimator (if your data fulfills the relevant criteria) that compares the 1 group with the 0 group. Alternatively, you could analyse the data parametrically, again using the indicator variable with a probit or logit model, or if you are looking for something causal use an IV probit estimator. There are many more options. Point is, I think you should focus on modelling the "early fall", and use a theory-based choice for what is considered early. This is based on a slightly different interpretation of what you described in the question, but I hope it is constructive for you, since I think as it is written you do not have a hypothesis that requires any regression or other inferential statistics.
export class Post { postId: string; title: string; content: string; author: string; createdDate: any; tags: any; img_url: string; constructor() { this.title = ''; this.content = ''; this.img_url = '' this.tags = '' } }
package com.leetcode.algorithm.medium.splitbst; import com.leetcode.algorithm.common.TreeNode; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertArrayEquals; public class SolutionTest { @Test public void testCase1() { Solution solution = new Solution(); TreeNode root = new TreeNode(4); root.left = new TreeNode(2); root.left.left = new TreeNode(1); root.left.right = new TreeNode(3); root.right = new TreeNode(6); root.right.left = new TreeNode(5); root.right.right = new TreeNode(7); TreeNode expected1 = new TreeNode(4); expected1.left = new TreeNode(3); expected1.right = new TreeNode(6); expected1.right.left = new TreeNode(5); expected1.right.right = new TreeNode(7); TreeNode expected2 = new TreeNode(2); expected2.left = new TreeNode(1); assertArrayEquals(new TreeNode[] {expected2, expected1}, solution.splitBST(root, 2)); } }
I worked with a family and their 3-week-old recently, and it was obvious how much their family dog means to them. The house is decorated with professional photos of the dog, comfy pet beds fill the corners and soft blankets cover special chairs. The dog had still not eaten her breakfast by the time I arrived at noon, causing angst in the mom. Let’s face it, we love our pets. But when our babies arrive, well, our pets may take a back seat. We often don’t have the time or ability yet to handle keeping up with our newborn AND giving our beloved pets the attention they were getting B.C. (before child). As with all important decisions, I recommend waiting until the feelings of overwhelm have eased before making drastic changes that you might regret later. In order to lighten the load, “loan” your pet to a friend or family member until you can resume adequate care. Some of my clients will make arrangements for their pets to go to a grandparent's home temporarily or will utilize local doggie day cares or pet sitters and walkers. This has worked out so well for some families that they continue to share custody of the pet years later. Consider how you felt about your pets before the baby arrived. If the emotions are positive, then giving it time (12 weeks is a good span), while also reaching out for help, makes sense. You can always revisit the idea of finding new homes for your pets if you still feel overwhelmed after things have calmed down and your thinking is more clear. Family Paws, a Cary company that provides specialized programs for new and expecting families with dogs, actually has a hotline for situations just like this. Owner Jen Shyrock says they get calls frequently from new parents considering “re-homing” their dogs. Go to familypaws.com/hotlineor call 877-247-3407 to learn how they can help you through this crisis. Family Paws also offers a tip sheet with advice for helping everyone in your family adjust to a new addition. I’m sure photos of the baby will soon be gracing the walls and shelves of my new clients’ home, not to replace the dog’s photos but to join them. In the meantime, know that you are not alone in trying to figure out how to balance the needs of your new baby, your pets and yourselves! If you have a question about your child's health or happiness, ask Pam or any of our experts by sending email to [email protected].
Realisation and robustness evaluation of a blind spatial domain watermarking technique ABSTRACT A blind digital image watermarking scheme based on spatial domain is presented and investigated in this paper. The watermark has been embedded in intermediate significant bit planes besides the least significant bit plane at the address locations determined by pseudorandom address vector (PAV). The watermark embedding using PAV makes it difficult for an adversary to locate the watermark and hence adds to security of the system. The scheme has been evaluated to ascertain the spatial locations that are robust to various image processing and geometric attacks JPEG compression, additive white Gaussian noise, salt and pepper noise, filtering and rotation. The experimental results obtained, reveal an interesting fact, that, for all the above mentioned attacks, other than rotation, higher the bit plane in which watermark is embedded more robust the system. Further, the perceptual quality of the watermarked images obtained in the proposed system has been compared with some state-of-art watermarking techniques. The proposed technique outperforms the techniques under comparison, even if compared with the worst case peak signal-to-noise ratio obtained in our scheme.
// CheckIfdialable Checks if peer reachable with 5s timeout. func checkIfDialable(h host.Host, i peer.AddrInfo) bool { if h.ID() == i.ID { return true } reachable := false ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) if err := h.Connect(ctx, i); err == nil { reachable = true } cancel() return reachable }
Applications of SPR for the characterization of molecules important in the pathogenesis and treatment of neurodegenerative diseases Characterization of binding kinetics and affinity between a potential drug and its receptor are key steps in the development of new drugs. Among the techniques available to determine binding affinities, surface plasmon resonance has emerged as the gold standard because it can measure binding and dissociation rates in real-time in a label-free fashion. Surface plasmon resonance is now finding applications in the characterization of molecules for treatment of neurodegenerative diseases, characterization of molecules associated with pathogenesis of neurodegenerative diseases and detection of neurodegenerative disease biomarkers. In addition it has been used in the characterization of a new class of natural autoantibodies that have therapeutic potential in a number of neurologic diseases. In this review we will introduce surface plasmon resonance and describe some applications of the technique that pertain to neurodegenerative disorders and their treatment.
Vern Johnson - State Farm Insurance Agent is located at the address 402 Nw 5th Street in Corvallis, Oregon 97330. They can be contacted via phone at (541) 757-7005 or via fax at (541) 758-0138 for pricing, hours and directions. Vern Johnson - State Farm Insurance Agent specializes in Restaurants, Factories, Vision. Posted on October 03, 2013. Brought to you by judysbook. Since 1991, Vernon S Johnson Insurance Agency Inc has been providing Insurance Agents, Brokers, And Service from Corvallis. Vernon S Johnson Insurance Agency Inc is incorporated in Oregon.
Gender Difference in Alcoholic Liver Disease Alcoholic liver disease occurs after prolonged heavy drinking, particularly among persons who are physically dependent on alcohol. Alcoholic liver disease is pathologically classified into three forms: fatty liver (hepatic steatosis), alcoholic hepatitis, and cirrhosis. There is considerable overlap among these conditions. The incidence of alcoholic liver disease increases in a dose-dependent manner proportionally to the cumulative alcoholic intake. Alcoholism is increasing among females, owing to a decline in the social stigma attached to drinking and to the ready availability of alcohol in supermarkets. In general, however, males have a greater opportunity for drinking. In the United States, the National Comorbidity Survey estimated that, at some time in their lives, 6.4% of females and 12.5% of males will meet the criteria for alcoholic abuse (). The Italian longitudinal study on aging showed that 42% of elderly females and 12% of elderly males were lifelong abstainers (). In Japan, based on data from the National Nutrition Survey, heavy drinkers with a daily consumption exceeded 40 g of ethanol per day for females and 60 g of ethanol per day for males were more frequently observed in males (Figure 1). Despite the male predominance for alcoholism, chronic alcohol consumption induces more rapid and more severe liver injury in females than males. Introduction Alcoholic liver disease occurs after prolonged heavy drinking, particularly among persons who are physically dependent on alcohol. Alcoholic liver disease is pathologically classified into three forms: fatty liver (hepatic steatosis), alcoholic hepatitis, and cirrhosis. There is considerable overlap among these conditions. The incidence of alcoholic liver disease increases in a dose-dependent manner proportionally to the cumulative alcoholic intake. Alcoholism is increasing among females, owing to a decline in the social stigma attached to drinking and to the ready availability of alcohol in supermarkets. In general, however, males have a greater opportunity for drinking. In the United States, the National Comorbidity Survey estimated that, at some time in their lives, 6.4% of females and 12.5% of males will meet the criteria for alcoholic abuse (). The Italian longitudinal study on aging showed that 42% of elderly females and 12% of elderly males were lifelong abstainers (). In Japan, based on data from the National Nutrition Survey, heavy drinkers with a daily consumption exceeded 40 g of ethanol per day for females and 60 g of ethanol per day for males were more frequently observed in males ( Figure 1). Despite the male predominance for alcoholism, chronic alcohol consumption induces more rapid and more severe liver injury in females than males. In contrast, the progression of hepatic fibrosis in chronic hepatitis B and C appears to be slower in females than in males (;;;). Hepatic fibrosis is fibrous scarring of the liver in which excessive collagens build up along with the duration and extent of persistence of liver injury. In other words, overproduced collagens are deposited in injured areas instead of destroyed hepatocytes. Moreover, females, especially before menopause, produce antibodies against hepatitis B virus (HBV) surface antigen (HBsAg) and HBV e antigen (HBeAg) at higher frequency than males (;). In chronic infection with hepatitis C virus (HCV), the clearance rate of blood HCV RNA appears to be higher in females (). Most asymptomatic carriers of HCV with persistent normal alanine aminotransferase (ALT) are females and have a good prognosis with a low risk of progression of hepatic fibrosis to the end-stage cirrhosis and its complications such as hepatocellular carcinoma (HCC) (;). The menopause is associated with accelerated progression of hepatic fibrosis, and the HCC risk is inversely related to the age at natural menopause (Shimizu, 2003;a). The "female paradox" observed in patients with alcoholic liver disease in comparison with chronic viral hepatitis is based on susceptibility by females to liver damage from smaller quantities of ethanol. Alcoholic liver disease in females The amount of alcohol required producing hepatitis or cirrhosis varies among individuals, but as little as 40 g/day (Table 1) for 10 years is associated with an increased incidence of cirrhosis. There is considerable evidence to suggest that females require less total alcohol consumption (20 g ethanol/day) to produce clinically significant liver disease. Indeed, it is reported that the lowest point of weekly alcohol intake that helps to develop liver disease was higher in males (168-324 g) than in females (84-156 g), and that, in the case of heavy drinkers with a weekly consumption of 336-492 g, the relative risk for alcoholic liver disease was 3.7 in males and 7.3 in females, while it was 1.0 in the group with a weekly consumption of 12-72 g (). Thus, safe drinking guidelines recommend that females do not drink more than 20 g ethanol per day, and males not more than 40 g ethanol. A common, reasonable recommendation is not to exceed 70 g of ethanol a week. The incidence of alcoholic liver disease correlates with the national per capita consumption of ethanol derived from sales of beer, wine and spirits ( Figure 2). For instance, in France, the www.intechopen.com United Kingdom and Germany, the annual per capita (average consumed by each person) ethanol consumption is over 9 litres per person per year, but in Asia such as China and Japan, it is 4 to 6.5 litres per person per year. Ethanol is metabolized by hepatic alcohol dehydrogenase (ADH) and the hepatic microsomal ethanol oxidizing system (MEOS) to acetaldehyde, which is subsequently converted by aldehyde dehydrogenase (ALDH) to acetate. The accumulation of acetaldehyde leads to the clinical syndrome of flushing, nausea and vomiting. Isoenzymes of ALDH with low activities are common among Asian populations and are associated with lower rates of alcoholism. These persons experience a similar flushing syndrome after consuming ethanol. This inhibits Asian populations from taking alcohol and is a negative risk for the development of alcoholic liver disease (). In a study on the sex difference in Japanese patients hospitalized in Tokushima, western Japan, the incidence of alcoholic cirrhosis was 9-fold higher in males than females ( Figure 3). However, females develop higher blood ethanol levels following a standard dose, at least in part, because of a smaller mean apparent volume of ethanol distribution. Moreover, sex differences in hepatic metabolism with increased production of acetaldehyde may contribute to vulnerability of females to alcohol consumption () (see below), suggesting that chronic alcohol consumption may induce more rapid and more severe liver injury in females than males. Females with alcoholic cirrhosis survive a shorter time than males (Sherlock & Dooley, 2002). Ethanol hepatotoxicity Alcoholic liver injury is mainly due to ethanol hepatotoxicity linked to its metabolism by means of the ADH and cytochrome P450 2E1 (CYP2E1) pathways and the resulting production of toxic acetaldehyde ( Figure 4). CYP2E1 is the key enzyme of the MEOS, and it is involved in the oxygenation of substrates such as ethanol and fatty acids. Although most ethanol is oxidized by ADH, CYP2E1 assumes a more important role in ethanol oxidation at elevated levels of ethanol or after chronic consumption of ethanol. CYP2E1 has a very high NADPH oxidase activity. NADPH/NADH oxidase is a primary source of reactive oxygen species (ROS) production in non-phagocytic cells such as hepatic stellate cells (HSCs) in the space of Disse ( Figure 5). Therefore, excess of ethanol and fatty acids and their metabolism by means of CYP2E1 pathway produce extensively ROS, which cause oxidative stress with lipid peroxidation and membrane damage, leading to cell death. ROS and products of lipid peroxidation activate not only inflammatory cells including neutrophils, macrophages and Kupffer cells (hepatic resident macrophages), but HSCs as well. In the injured liver, HSCs are regarded as the primary target cells for inflammatory and oxidative stimuli, and undergo proliferation and transformation into myofibroblast-like cells. These HSCs are activated cells and are responsible for much of the collagen synthesis observed during hepatic fibrosis to cirrhosis.. CYP2E1 produces ROS (superoxide, O 2 -). Acetaldehyde is converted by aldehyde dehydrogenase (ALDH) to acetate. Both reactions of ethanol to acetaldehyde and then acetate reduce nicotinamide adenine dinucleotide (NAD) to its reduced form (NADH). Excess NADH causes inhibition of fatty acid oxidation, leading to fat accumulation (hepatic steatosis).. Kupffer cells (hepatic resident macrophages) rest on fenestrated endothelial cells. HSCs are located in the space of Disse in close contact with endothelial cells and hepatocytes, functioning as the primary retinoid storage area. Collagen fibrils course through the space of Disse between endothelial cells and the cords of hepatocytes. Excess fatty acids lead to hepatic steatosis Increased lipid peroxidation and accumulation of end products of lipid peroxidation are commonly observed in alcoholic liver disease and non-alcoholic fatty liver disease (NAFLD) based on studies of human alcohol-related liver injury and animal models of diet-induced hepatic steatosis and drug-induced steatohepatitis (;;). Fatty liver is the result of the deposition of triglycerides via the accumulation of fatty acids in hepatocytes. In the progression of fatty liver disease, lipid peroxidation products are generated because of impaired -oxidation of the accumulated fatty acids. The major site for fatty acid -oxidation (degradation of fatty acids) in the liver is hepatocyte mitochondria ( Figure 6). Key mediators of impaired fatty acid -oxidation include a reduced mitochondrial electron transport (respiratory chain dysfunction). In addition to impaired mitochondrial -oxidation of fatty acids, an activity of CYP2E1 in the Fig. 6. Increased hepatic uptake of free fatty acids, increased triglyceride synthesis, and impaired transport of very low-density lipoprotein (triglyceride-rich lipoprotein) into the blood mainly contribute to the accumulation of hepatocellular triglycerides. Microsomal trigyceride transfer protein (MTP) is essential for the secretion of very low-density lipoprotein. Excess triglycerides are stored as lipid droplets in hepatocytes, which in turn results in a preferential shift to fatty acid degradation ( -oxidation), leading to the formation of ROS and lipid peroxidation products. www.intechopen.com microsomes is increased. Elevated CYP2E1 and mitochondrial defects result in an increase in the ROS formation and lipid peroxidation products. ROS and lipid peroxidation in turn cause further mitochondrial dysfunction and oxidative stress, thus contributing to cell death via ROS-induced DNA injury and membrane lipid peroxidation and discharge of products of lipid peroxidation, malondialdehyde (MDA) and 4-hydroxynonecal (HNE), into the space of Disse. MDA and HNE besides ROS are able to activate inflammatory cells (neutrophils, macrophages and Kupffer cells) and HSCs. Activated inflammatory cells in turn produce chemokines as well as tumor necrosis factor-(TNF-) and ROS. Chemokines such as monocytes chemoattractant protein-1 (MCP-1) and interleukin-8 (IL-8) attract neutrophils, lymphocytes, monocytes, macrophages, and Kupffer cells to inflammatory sites, leading to the persistent liver injury. CYP2E1 Oxidation of ethanol through the ADH and CYP2E1 pathways produces acetaldehyde which is also toxic to the hepatocyte mitochondria. Acetaldehyde aggravates oxidative stress by binding to reduced glutathione, an antioxidant, and promoting its leakage, which triggers an inflammatory response of the host. This involves the activation of Kupffer cells and the attraction of inflammatory cells to injured sites. The inflammatory cells in the liver produce transforming growth factor-(TGF-) and proinflammatory mediators including TNF-and ROS, leading to oxidative tress and hepatic fibrosis. Thus, TNF-mediates not only the early stages of alcoholic liver disease but also the transition to more advanced stages of liver damage. Reactions of ethanol converted to acetaldehyde and subsequently acetate reduce nicotinamide adenine dinucleotide (NAD) to its reduced form (NADH). Excess NADH causes a number of metabolic disorders, including stimulation of the fatty acid synthesis and inhibition of the Krebs cycle and of its fatty acid oxidation. The stimulation of the fatty acid synthesis and inhibition of fatty acid oxidation favor fat accumulation (hepatic steatosis) and hyperlipidemia. CYP2E1 activity is elevated in the livers of obese animals () and nonalcoholic steatohepatitis (NASH) patients () as well as patients with alcoholic liver disease. The role of CYP2E1 in fatty acid metabolism supports the concept of a nutritional role for CYP2E1. Indeed, besides its ethanol-oxidizing activity, CYP2E1 catalyzes fatty acid -hydroxylations (microsomal -oxidation of fatty acids) and metabolizes ketones. Fatty acids and ketones increase especially in obesity and diabetes, and their excess up-regulates CYP2E1. CYP2E1 leaks ROS as part of its operation, and when increased ROS production exceed the cellular antioxidant defense systems, excess ROS result in oxidative stress with its pathologic consequences. This is true when excess alcohol has to be metabolized, as in alcoholic steatohepatitis, or when CYP2E1 is confronted by an excess of fatty acids and ketones associated with obesity, diabetes, or both, resulting in NASH. Endotoxin in alcoholic liver injury Alcohol ingestion disrupts gastrointestinal barrier function and subsequently induces the diffusion of luminal bacterial products including bacterial lipopolysaccharides (endotoxins) www.intechopen.com into the portal vein. Experiments using animals show direct evidence of increased translocation of endotoxin from the gut lumen into the portal bloodstream caused by ethanol (). Acute ethanol ingestion, especially at high concentrations, facilitates the absorption of endotoxin from rat small intestine via an increase in intestinal permeability, which may play an important role in endotoxemia observed in alcoholic liver injury (). Increased endotoxin levels in the portal blood are essential for initiation and progression of alcoholic liver disease (Bode & Bode, 2005). Bacterial translocation from the gastrointestinal tract, namely spillover endotoxemia, is important in the relationship between endotoxin and hepatotoxicity in the reticuloendothelial system such as monocytes-macrophages and Kupffer cells. Gut-derived endotoxin activates Kupffer cells, which produce proinflammatory mediators such as TNFand ROS. The ability of Kupffer cells to eliminate and detoxify various exogenous and endogenous substances including endotoxin is an important physiological regulatory function (Figure 7). Fig. 7. Activation of Kupffer cells by gut-derived endotoxin plays a pivotal role in alcoholic liver injury. Following chronic alcohol ingestion, endotoxin, also called lipopolysaccharide, released from intestinal gram-negative bacteria moves from gastrointestinal tract (gut) into the liver via the portal bloodstream. Like chronic ethanol feeding, TNF-cytotoxicity is also with alteration of mitochondrial function. The mitochondria of TNF--exposed cells overproduce ROS derived from the respiratory chain. The mitochondria themselves then become the targets of ROS, thus setting up a cycle of injury (). In addition to ROS production, TNF-prompts the opening of the mitochondrial permeability transition (MPT). The MPT is the regulatable opening of a large and non-specific pore across the outer and inner mitochondrial membrane. Ethanol may also increase the susceptibility of MPT induction by TNF-at the www.intechopen.com mitochondrial level, possibly through an increase in ROS production caused by respiratory chain dysfunction and/or CYP2E1 (Pastorino & Hoek, 2000). Ethanol-induced oxidative stress is the result of the combined impairment of antioxidant defense and the ROS production by the mitochondrial electron transport chain, the ethanolinduced CYP2E1 and activated phagocyte such as macrophages and Kupffer cells. Indirectly, chronic ethanol ingestion may augment oxidative stress by decreasing antioxidant defenses such as reducing glutathione peroxidase and glutathione homeostasis (Figure 8). Fig. 8. Oxidative stress and hepatocyte damage (Shimizu and Ito, 2007). A primary source of reactive oxygen species (ROS) production is mitochondrial NADPH/NADH oxidase. Hydrogen peroxide (H 2 O 2 ) is converted to a highly reactive ROS, the hydroxyl radical, in the presence of transition metals such as iron (+Fe) and copper. The hydroxyl radical induces DNA cleavage and lipid peroxidation in the structure of membrane phospholipids, leading to cell death and discharge of products of lipid peroxidation, malondialdehyde (MDA) and 4-hydroxynonenal (HNE) into the space of Disse. Cells have comprehensive antioxidant protective systems, including SOD, glutathione peroxidase and glutathione (GSH). Upon oxidation, GSH forms glutathione disulfide (GSSG). Gastric ADH in females After an equivalent dose of alcohol, females have higher blood ethanol levels than males. There are multiple explanations for this. First, females are generally smaller than males so the same dose of alcohol leads to higher blood alcohol levels www.intechopen.com for females than males. Second, female body water content is smaller than male per kilogram of body weight. Thus, a dose of ethanol is distributed in a smaller volume of water in females than in males, leading to somewhat higher concentrations of ethanol in female blood (). Third, the first pass metabolism of alcohol in the stomach may lead to higher blood alcohol levels in females than males. In the stomach, alcohol is metabolized with the enzyme gastric ADH. The stomach thus acts as a barrier against the penetration of alcohol into the body, by retaining and breaking down part of the alcohol. Gastric ADH activity is lower in females than in males; one study found that for a given alcohol dose, male ADH levels were two times higher than female levels, and in turn, female blood alcohol levels were higher than those of males (). This sex difference in metabolism of alcohol appears to hold for younger adults but not older adults. ADH activity decreases with age, particularly for males, leading to similar blood alcohol concentrations in older males and females, or even higher concentrations in older males than older females. Growth hormone secretion in females The profile of growth hormone secretion pattern shows clear sex dimorphism (Ameen & Oscarsson, 2003). In female rats, the growth hormone is continuously secreted, and the hormone levels are always detectable in the circulation, while, in male rats, it is secreted by episodic bursts every 3.5 to 4 hours with low or undetectable levels between peaks (). Integrated 24-hour growth hormone secretion () and fasting blood growth hormone levels ( Figure 9) are higher in women than in men. Growth hormone secretion is stimulated by estrogens (Ameen & Oscarsson, 2003). Oral and high-dose transdermal estrogen administration in menopausal women increases integrated 24-hour growth hormone secretion (). Fig. 9. Fasting mean blood levels of growth hormone in 15 premenopausal women (mean age 41.3 years) and 15 age-matched men (mean age 41.1 years) of healthy non-obese (body mass index ≥ 18.5 to 24.9 kg/m 2 ) individuals. The subjects had no history of alcohol abuse (defined as an alcohol intake >20 g/day). www.intechopen.com Interestingly, growth hormone increases ADH activity in the liver. The steady exposure of hepatocytes in cultures to growth hormone resulting in increased ADH activity resembles the female pattern of growth hormone secretion (). ADH activity is higher in female rats and mice than in their male counterparts. Thus, increased rates of the resulting production of toxic acetaldehyde in females compared with males may be responsible for the known increased susceptibility to alcohol-induced liver injury by females. Females are more likely to progress from alcoholic hepatitis to cirrhosis even if they abstain. Endotoxin after ethanol in females Endotoxin-stimulated monocytes in males produce more TNF-as compared to females (). Like Kupffer cells, monocytes stimulated by endotoxin induce proinflammatory cytokines and ROS. In studies using animals, however, the stimulation of Kupffer cells by estrogen increased sensitivity to endotoxin after ethanol (). It appears that monocytes-macrophages respond differently to endotoxins compared to Kupffer cells as far as the signaling pathways are concerned (). The estrogen addition to ethanol ingestion enhanced TNF-production in Kupffer cells via elevation of the blood endotoxin level and hepatic endotoxin receptor (CD14) expression, resulting in increased inflammatory activity in the liver (). The administration of ethanol in female rats induced the hepatic activity of CYP2E1, and the ethanol-induced CYP2E1 activity was reduced by the treatment with antiestrogen (). Because activity of cytochrome P-450 (CYP) isoenzymes is regulated by circulating growth hormone, sex differences in growth hormone secretion profiles account for a different expression pattern of hepatic CYP isoenzymes between females and males (Agrawal & Shapiro, 2001). Favorable role of female factors in chronic viral hepatitis Clinical observations and death statistics support the view that chronic hepatitis C and B appears to progress more rapidly in males than in females (;;;), and that cirrhosis is largely a disease of men and postmenopausal women with the exception of classically autoimmune liver diseases, such as primary biliary cirrhosis and chronic autoimmune hepatitis. HCV infections are more common than HBV infections in Japan and Western countries, and are recognized as a major causative factor of chronic hepatitis, cirrhosis, and HCC. According to a report of the International Agency for Research on Cancer (), the male:female ratio of the age-standardized incidence per 100,000 of liver cancer worldwide is 2.9:1, and in Asia (particularly in China, Japan, and Taiwan), the incidence of liver cancer is high and it accounts for half of all liver cancer cases in the world. The prevalence of HBsAg is reported to be higher in males than in females throughout the world (). In a prospective follow-up study of up to 19 years on HBsAg carriers in Okinawa in Japan, clearance of HBsAg was found more frequently in females (7.8%) than in males (5.8%) (). Seroconversion from HBeAg to its antibody (anti-HBe) occurs more frequently in females than in males (). In chronic HCV infection, the clearance rate of blood HCV RNA appears to be higher in females (). Demographic data from the United States (), Europe (France and Italy) (;), and Japan () show that most HCV carriers with persistently normal ALT (asymptomatic carriers) are females, and have a good prognosis with a low risk of progression to cirrhosis and HCC. The menopause is associated with accelerated progression of hepatic fibrosis, and the HCC risk is inversely related to the age at natural menopause (Shimizu, 2003;a). Chronic HCV-and HBV-infected patients of female sex and under 50 years old, namely premenopausal women are least vulnerable to HCC. Premenopausal women have lower hepatic iron stores and a decreased production of proinflammatory cytokines such as TNF- (;;b). Iron is essential for life, but is toxic in excess, because it produces ROS that react readily with lipids and DNA, leading to cell death and DNA mutagenesis. An experimental animal study showed that hepatic steatosis spontaneously becomes evident in an aromatase-deficient mouse, which lacks the intrinsic ability to produce estrogen and is impaired with respect to hepatocellular fatty acid -oxidation. Estrogen replacement reduces hepatic steatosis and restores the impairment in mitochondrial and peroxisomal fatty acid -oxidation to a wild-type level (). In addition, tamoxifen is a well known antiestrogen used in the hormone treatment of estrogen receptor-positive breast cancer, and it has been shown to be associated with an increased risk of developing fatty liver and NASH in such patients (;). Estrogens are potent endogenous antioxidant (;), suppresses hepatic fibrosis in animal models, and attenuates induction of redox sensitive transcription factors, hepatocyte apoptosis and HSC activation by inhibiting the generation of ROS and TGF-in primary cultures (;;;;). Variant estrogen receptors are expressed in HCC patients and, to a greater extent, in male patients with chronic liver disease than in female patients, even at an early stage of chronic liver disease (;). The occurrence of variant estrogen receptors leads to the loss of estrogen responsiveness. These lines of evidence suggest that the greater progression of hepatic fibrosis and HCC in men and postmenopausal women may be due, at least in part, to both a lower production of estrogen and a lower response to the action of estrogen. Heavy alcohol intake and HCC Chronic alcohol intake (mostly heavy alcohol use of more than 50 g/day) and alcoholic cirrhosis have long been recognized as a cause of HCC. In alcoholic cirrhosis, the risk of HCC is about 1% per a year. Most HCC cases are in males. There are no clinical or pathological differences compared with HCC complicating chronic HBV and HCV infection. However, it is not certain whether alcohol is a true carcinogen. Several epidemiologic studies among alcoholics show a high prevalence of HBV markers (16%-70%) and HCV markers (10%-20%) as compared with a background prevalence of close to 5% and less than 1%, respectively (). These prevalences are even higher in HCC cases who are also alcoholics (27% to 81% of HBV markers and 50% to 77% of HCV markers), suggesting a complex interaction between alcohol and viral infections in the etiology of HCC (Di ). Case-control studies have shown that, as a result of the synergy between alcohol intake and HCV infection, the risk of liver cancer is increased approximately 2-to 4-fold among cases drinking more 60-80 g/day of alcohol (). The presumed basis for this is that both alcohol and HCV infection independently promote the development of cirrhosis. In a longitudinal cohort study of cirrhotic patients with HCV infection, heavy alcohol intake (>65 g/day) was an independent factor for the development of HCC, increasing the risk approximately 3-fold (). A case-control study also shows a synergism between alcohol drinking and HBV infection on the risk of HCC, increasing the risk approximately 2-fold for HBsAg-positive subject of both sexes who drink more than 60 g/day of ethanol compared with HBsAg-positive non-drinkers (). In a longitudinal cohort study of patients with HBV-related cirrhosis, heavy alcohol intake was associated with a 3-fold increased risk for HCC (). Studies in northern Italy and Greece estimated that the attributable fraction of high levels of alcohol consumption, once adjusted for HBV and HCV status, were 45% in Italy () and 15% in Greece (). In low-risk populations, heavy alcohol intake may account for the majority of the HCC cases who are seronegative for HBV and HCV markers. Conclusion A large body of evidence has been accumulated suggesting that increased oxidative stress is an essential step in the development of hepatic fibrogenesis and carcinogenesis. Environmental and lifestyle risk factors such as HCV and HBV infection and heavy alcohol intake lead to increased oxidative stress, which in general occurs more frequently in males. Moreover, biological female sex factors such as estrogens, hepatic iron storage status, and growth hormone play antioxidative and cytoprotective roles in the functional and morphological modulation of the liver physiopathology. However, it should be noted that females consistently drink less than males and appear to suffer serious negative consequences of alcohol consumption earlier and to a greater degree than males. Specifically, chronic alcohol consumption induces more rapid and more severe liver injury in females than males. The "female paradox" observed in patients with alcoholic liver disease in comparison with chronic viral hepatitis is based on susceptibility by females to liver damage from smaller quantities of ethanol. Being female or male is an important basic human variable that affects health and liver disease throughout the life span. Sex is defined as female or male according to their biological functions, while gender is shaped by environment and experience. Better knowledge of the basic mechanisms underlying the sexassociated differences during hepatic fibrogenesis and carciogenesis may open up new avenues for the prevention and treatment of chronic liver disease. References Agrawal AK & Shapiro BH.. Intrinsic signals in the sexually dimorphic circulating growth hormone profiles of the rat. Mol Cell Endocrinol 173:167-181. Aizawa Y, Shibamoto Y, Takagi I, Zeniya M & Toda G.. Analysis of factors affecting the appearance of hepatocellular carcinoma in patients with chronic hepatitis C. A long term follow-up study after histologic diagnosis. Cancer 89:53-59. Alcoholic liver disease occurs after prolonged heavy drinking. Not everyone who drinks alcohol in excess develops serious forms of alcoholic liver disease. It is likely that genetic factors determine this individual susceptibility, and a family history of chronic liver disease may indicate a higher risk. Other factors include being overweight and iron overload. This book presents state-of-the-art information summarizing the current understanding of a range of alcoholic liver diseases. It is hoped that the target readers -hepatologists, clinicians, researchers and academicians -will be afforded new ideas and exposed to subjects well beyond their own scientific disciplines. Additionally, students and those who wish to increase their knowledge will find this book a valuable source of information.
<gh_stars>10-100 try: from gdsfactory.autoplacer.chip_array import ChipArray from gdsfactory.autoplacer.library import Library except ModuleNotFoundError: print( "klayout installation not found. You need to `pip install klayout` to use the klayout placer" ) def test_autplacer(): lib = Library() mask = ChipArray("chip_array", 25e6, 25e6, 3, 4, lib) mask.pack_grid(lib.pop("align")) mask.pack_grid(lib.pop(".*")) mask.write("chip_array.gds") if __name__ == "__main__": import gdsfactory as gf test_autplacer() gf.show("chip_array.gds")
<reponame>ucsd-progsys/csolve-bak #include <stdlib.h> #include <csolve.h> struct foo { int data; // struct foo *next; }; struct foo *__attribute__((array)) main(){ struct foo *a; struct foo *b; int i; int n; n = nondetpos(); a = (struct foo *) malloc(n * sizeof(struct foo)); i = n-1; while (i >= 0){ b = a + i; b->data = 99999; i--; } for (i=0; i < n; i++){ b = a + i; csolve_assert(b->data == 0); } return a; }
Intermittent Antibody-Based Combination Therapy Removes Alloantibodies and Achieves Indefinite Heart Transplant Survival in Presensitized Recipients Background. It is well established that primed/memory T cells play a critical role in heart transplant rejection. This contributes to the challenges faced in the transplant clinic because current treatments that are efficient in controlling nave T cell alloresponses have limited efficacy on primed T cell responders. Methods. Fully MHC-mismatched heart transplantation was performed from BALB/c to C57BL/6 mice presensitized with BALB/c splenocytes 14 days pretransplantation. A combination therapy comprising CD70-, CD154-, and CD8-specific antibodies (Abs) was administered at day 0 and 4 posttransplantation with rapamycin on days 0 to 4. Results. The Ab combination therapy extended heart transplant survival in presensitized recipients from median survival time 8 days (MST) to MST 78 days. A decrease in the number of splenic interferon-&ggr;secreting cells measured by ELISpot assay was seen in the treated group compared with the untreated controls. However, graft-infiltrating CD8+ and CD4+ T cells persisted despite treatment and the number of intragraft CD4+ T cells increased at day 30 posttransplantation. When an additional rescue therapy comprising the same Abs was readministered at days 30, 60, and 90 posttransplantation, T cell infiltration was reduced and indefinite graft survival was observed. Furthermore, rescue therapy resulted in gradual decrease in titer and, by day 90 posttransplantation, the complete loss of the preexisting, donor-specific Abs. Conclusion. We conclude that our Ab combination therapy extends allograft survival in presensitized recipients. When combined with intermittent Ab-mediated rescue therapy, this results in indefinite allograft survival and a loss of the preexisting, donor-specific Abs from the circulation.
Visible Light as the Key for the Formation of CarbonSulfur Bonds in Sulfones, Thioethers, and Sulfonamides: An Update This review summarizes the most relevant advancements made in the photocatalyzed synthesis of sulfones, thioethers and sulfonamides from 2017 to the beginning of 2021. Synthetic strategies towards the construction of sulfur-carbon bonds are discussed together with the proposed reaction mechanisms. Interestingly, sulfured-based functional groups, which are of fundamental importance for the pharmaceutical field, can be assembled by photocatalysis in an easy and straightforward way in milder reaction conditions employing less toxic and expensive sulfur sources in comparison with common strategies
/** * This is the item provider adapter for a {@link org.talend.core.model.properties.CronUITalendTrigger} object. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public class CronUITalendTriggerItemProvider extends TalendTriggerItemProvider implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { /** * This constructs an instance from a factory and a notifier. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public CronUITalendTriggerItemProvider(AdapterFactory adapterFactory) { super(adapterFactory); } /** * This returns the property descriptors for the adapted class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public List getPropertyDescriptors(Object object) { if (itemPropertyDescriptors == null) { super.getPropertyDescriptors(object); addListDaysOfWeekPropertyDescriptor(object); addListDaysOfMonthPropertyDescriptor(object); addListMonthsPropertyDescriptor(object); addListYearsPropertyDescriptor(object); addListHoursPropertyDescriptor(object); addListMinutesPropertyDescriptor(object); } return itemPropertyDescriptors; } /** * This adds a property descriptor for the List Days Of Week feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void addListDaysOfWeekPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_CronUITalendTrigger_listDaysOfWeek_feature"), getString("_UI_PropertyDescriptor_description", "_UI_CronUITalendTrigger_listDaysOfWeek_feature", "_UI_CronUITalendTrigger_type"), PropertiesPackage.Literals.CRON_UI_TALEND_TRIGGER__LIST_DAYS_OF_WEEK, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** * This adds a property descriptor for the List Days Of Month feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void addListDaysOfMonthPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_CronUITalendTrigger_listDaysOfMonth_feature"), getString("_UI_PropertyDescriptor_description", "_UI_CronUITalendTrigger_listDaysOfMonth_feature", "_UI_CronUITalendTrigger_type"), PropertiesPackage.Literals.CRON_UI_TALEND_TRIGGER__LIST_DAYS_OF_MONTH, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** * This adds a property descriptor for the List Months feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void addListMonthsPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_CronUITalendTrigger_listMonths_feature"), getString("_UI_PropertyDescriptor_description", "_UI_CronUITalendTrigger_listMonths_feature", "_UI_CronUITalendTrigger_type"), PropertiesPackage.Literals.CRON_UI_TALEND_TRIGGER__LIST_MONTHS, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** * This adds a property descriptor for the List Years feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void addListYearsPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_CronUITalendTrigger_listYears_feature"), getString("_UI_PropertyDescriptor_description", "_UI_CronUITalendTrigger_listYears_feature", "_UI_CronUITalendTrigger_type"), PropertiesPackage.Literals.CRON_UI_TALEND_TRIGGER__LIST_YEARS, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** * This adds a property descriptor for the List Hours feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void addListHoursPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_CronUITalendTrigger_listHours_feature"), getString("_UI_PropertyDescriptor_description", "_UI_CronUITalendTrigger_listHours_feature", "_UI_CronUITalendTrigger_type"), PropertiesPackage.Literals.CRON_UI_TALEND_TRIGGER__LIST_HOURS, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** * This adds a property descriptor for the List Minutes feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void addListMinutesPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_CronUITalendTrigger_listMinutes_feature"), getString("_UI_PropertyDescriptor_description", "_UI_CronUITalendTrigger_listMinutes_feature", "_UI_CronUITalendTrigger_type"), PropertiesPackage.Literals.CRON_UI_TALEND_TRIGGER__LIST_MINUTES, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } /** * This returns CronUITalendTrigger.gif. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/CronUITalendTrigger")); } /** * This returns the label text for the adapted class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getText(Object object) { CronUITalendTrigger cronUITalendTrigger = (CronUITalendTrigger)object; return getString("_UI_CronUITalendTrigger_type") + " " + cronUITalendTrigger.getId(); } /** * This handles model notifications by calling {@link #updateChildren} to update any cached * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void notifyChanged(Notification notification) { updateChildren(notification); switch (notification.getFeatureID(CronUITalendTrigger.class)) { case PropertiesPackage.CRON_UI_TALEND_TRIGGER__LIST_DAYS_OF_WEEK: case PropertiesPackage.CRON_UI_TALEND_TRIGGER__LIST_DAYS_OF_MONTH: case PropertiesPackage.CRON_UI_TALEND_TRIGGER__LIST_MONTHS: case PropertiesPackage.CRON_UI_TALEND_TRIGGER__LIST_YEARS: case PropertiesPackage.CRON_UI_TALEND_TRIGGER__LIST_HOURS: case PropertiesPackage.CRON_UI_TALEND_TRIGGER__LIST_MINUTES: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); return; } super.notifyChanged(notification); } /** * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children * that can be created under this object. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { super.collectNewChildDescriptors(newChildDescriptors, object); } }
<gh_stars>0 import type { NormalizedConfig } from '@modern-js/core'; import { getLessConfig, LessOptions } from '@modern-js/css-config'; import NpmImportPlugin from 'less-plugin-npm-import'; import { LessOption as ResolvedLessOption } from '@modern-js/style-compiler'; export const moduleLessConfig = ({ modernConfig, npmImportPrefix = '~', }: { modernConfig: NormalizedConfig; npmImportPrefix?: string; }): ResolvedLessOption => { const lessConfig = getLessConfig(modernConfig) as LessOptions; return { enableSourceMap: lessConfig.sourceMap || false, lessOption: { ...lessConfig.lessOptions, plugins: [ new NpmImportPlugin({ prefix: npmImportPrefix }), ...((lessConfig.lessOptions?.plugins as Less.Options['plugins']) || []), ], }, }; };
package com.game.passbookServer.jsonConf; import net.sf.json.JSONObject; /** * 连接配置 * * @author hjj2019 * @since 2015/6/25 * */ public final class ConnConf { /** 服务器 IP 地址 */ public String _bindIpAddr = "127.0.0.1"; /** 服务器端口号 */ public int _port = 8001; /** 空闲超时时间 */ public long _idleTimeout = 20000L; /** * 从 JSON 对象中创建连接配置 * * @param jsonObj * */ public void readJsonObj(JSONObject jsonObj) { if (jsonObj == null || jsonObj.isEmpty()) { return; } // 绑定 IP 地址和端口 this._bindIpAddr = jsonObj.optString("bindIpAddr", this._bindIpAddr); this._port = jsonObj.optInt("port", this._port); // 设置空闲超时时间 this._idleTimeout = jsonObj.optLong("idleTimeout", this._idleTimeout); } }
Doctor Who comes back in August 2014 for season 8. Between now and then, how can new Whovians be brought in to the fold? Doctor Who will finally kick off season 8 after a 15 month hiatus. Granted, the show celebrated its 50th anniversary back in November 2013, and had the obligatory Christmas episode in December 2013, so Whovians haven’t been totally devoid of their Doctor fix, but the new season has been a long time in the making! One of the best things about Doctor Who, is that there are certain logical points when new viewers can jump right in. Those times coincide with new companions and/or new Doctors coming on board. The scripts surrounding these introductory episodes almost always have to explain a certain amount of background and Whovian lore to catch everyone up on regenerations, past lives, puzzling references, etc. Peter Capaldi will be starting off as the new Doctor. Clara, other than as the impossible girl, has never really seen and totally lived through a regeneration. Likely, she will be a bit confused, so it’s a great time for new viewers to get up-to-speed right along with Clara. Even though it will be a great season to catch up, there are still going to be those times when new viewers get lost. In fact, old viewers get lost, too, since the show makes reference to things that happened over the course of 50 years. One way of catching up is the Tardis Wikipedia to look up specific alien references, old companions, and obscure factoids. On the other hand, sometimes you just want an overview. That’s where the new Doctor Who Interactive Timeline comes in. The Doctor Who Interactive Timeline covers each of the Doctors from both the classic and reboot era. There are Doctor bios, famous quotes, iconic moments, videos and more. Essentially, the timeline is an interactive infographic that responds to either voice commands, mouse clicks, or arrow keystrokes. The timeline was created by Doctor Who superfan Sarah Bends, who wrote in to tell us, “I am a huge fan of Doctor Who and check in all the time to see new articles or features on my all time favorite TV show. Great stuff! As you know, the new series is starting in the next couple months starring the 12th Doctor. In honor of the new Doctor, I just made a really cool infographic on my site featuring a timeline including all 12 doctors.” Article Continues Below Check out the infographic to give yourself a refresher course on the Doctors and their companions, and let us know what you think in the comments.
Evidence for Subcortical Plasticity after Paired Stimulation from a Wearable Device Existing non-invasive stimulation protocols can generate plasticity in the motor cortex and its corticospinal projections; techniques for inducing plasticity in subcortical circuits and alternative descending pathways such as the reticulospinal tract (RST) are less well developed. One possible approach developed by this laboratory pairs electrical muscle stimulation with auditory clicks, using a wearable device to deliver stimuli during normal daily activities. In this study, we applied a variety of electrophysiological assessments to male and female healthy human volunteers during a morning and evening laboratory visit. In the intervening time (∼6 h), subjects wore the stimulation device, receiving three different protocols, in which clicks and stimulation of the biceps muscle were paired at either low or high rate, or delivered at random. Paired stimulation: increased the extent of reaction time shortening by a loud sound (the StartReact effect); decreased the suppression of responses to transcranial magnetic brain stimulation (TMS) following a loud sound; enhanced muscle responses elicited by a TMS coil oriented to induce anterior-posterior (AP) current, but not posterior-anterior (PA) current, in the brain. These measurements have all been suggested to be sensitive to subcortical, possibly reticulospinal, activity. Changes were similar for either of the two paired stimulus rates tested, but absent after unpaired (control) stimulation. Taken together, these results suggest that pairing clicks and muscle stimulation for long periods does indeed induce plasticity in subcortical systems such as the RST. SIGNIFICANCE STATEMENT Subcortical systems such as the reticulospinal tract (RST) are important motor pathways, which can make a significant contribution to functional recovery after cortical damage such as stroke. Here, we measure changes produced after a novel non-invasive stimulation protocol, which uses a wearable device to stimulate for extended periods. We observed changes in electrophysiological measurements consistent with the induction of subcortical plasticity. This protocol may prove an important tool for enhancing motor rehabilitation, in situations where insufficient cortical tissue survives to be a plausible substrate for recovery of function.
package com.anyconsole.api; import com.anyconsole.core.parser.SQLKeyword; import com.sun.jersey.api.core.ResourceContext; import org.springframework.stereotype.Component; import javax.ws.rs.Consumes; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.Context; import javax.ws.rs.core.Response; import java.util.Arrays; import java.util.HashSet; /** * User: kbabushkin * Date: 8/6/13 */ @Path("/") @Consumes("application/json") @Produces("application/json") @Component("any-console-resource") public class AnyConsoleResource { @Context private ResourceContext resourceContext; @GET @Path("keywords") public Response getSQLKeywords() { return Response.ok(new HashSet<SQLKeyword>(Arrays.asList(SQLKeyword.values()))).build(); } @Path("mongo") public MongoResource getMongoResource() { return resourceContext.getResource(MongoResource.class); } }
package org.wx.sdk.poi.response; import org.wx.sdk.base.Response; /** * 创建门店返回对象 * @author Rocye * @version 2017.10.14 */ public class AddPoiRespone extends Response { /** 门店ID */ private Long poi_id; public Long getPoi_id() { return poi_id; } public void setPoi_id(Long poi_id) { this.poi_id = poi_id; } }
Multi-label Feature Selection via Dual Graph and Non-convex Sparse Regression Feature selection has been an important data preprocessing in multi-label learning and thus has been developed rapidly in recent years. Among these, the methods based on manifold regularization have received more attention. However, most existing methods only consider the geometric structure of the data manifold and ignore the local information in the feature space, which leads to the learned manifold information being incomplete. To tackle this problem, we propose a dual graph regularization for multi-label feature selection, which considers the geometric structure of the data manifold and feature manifold simultaneously. What is more, a new non-convex constraint consisting of the difference between $l_{2,1}$ -norm and Frobenius norm, denoted as $l_{2,1-2}$ -norm, is introduced to obtain more row-sparse solution in order to delete a more redundant features efficiently. An alternating minimization strategy is designed to optimize the proposed objective function. Comprehensive experiments are conducted on eight multi-label data sets, and the results demonstrate that our method is superior to the compared methods.
/** * Cria string hash criptografado de 256 bits a partir da string informada. * @param pPlainPassword * @return */ public static String createPassword256(String pPlainPassword) { if (pPlainPassword==null){return null;} byte[] xHash = pvGetHash256(pPlainPassword); return DBSString.toHex(xHash); }
<gh_stars>10-100 // In a class there are ‘n’ number of students. They have three different subjects: Data Structures, Algorithm Design & Analysis and Operating Systems. Marks for each subject of all the students are provided to you. You have to tell the position of each student in the class. Print the names of each student according to their position in class. Tie is broken on the basis of their roll numbers. Between two students having same marks, the one with less roll number will have higher rank. The input is provided in order of roll number. // Input Format: // First line will have a single integer ‘n’, denoting the number of students in the class. // Next ‘n’ lines each will have one string denoting the name of student and three space separated integers m1, m2, m3 denoting the marks in three subjects. // Output Format: // Print ‘n’ lines having two values: First, the position of student in the class and second his name. // Constraints: // 1 <= n <= 10^5 // 0 <= m1, m2, m3 <= 100 // Sample Input: // 3 // Mohit 94 85 97 // Shubham 93 91 94 // Rishabh 95 81 99 // Sample Output: // 1 Shubham // 2 Mohit // 3 Rishabh #include<bits/stdc++.h> using namespace std; bool compare(pair<int,int> p1,pair<int,int> p2){ //if sum is equal sort on basis of index if(p1.second==p2.second){ return p1.first<p2.first; } return p1.second>p2.second; } int main() { int n; cin>>n; vector<pair<int,int>> p; //index,marks map<int,string> v; //index,name for(int i=0;i<n;i++){ string s; cin>>s; int n1,n2,n3; cin>>n1>>n2>>n3; int sum=n1+n2+n3; if(n==1){ cout<<1<<" "<<s<<endl; return 0; } p.push_back(make_pair(i,sum)); v[i]=s; } sort(p.begin(),p.end(),compare); for(int i=0;i<n;i++){ cout<<i+1<<" "<<v[p[i].first]<<endl; } return 0; }
/* * Copyright 2014-present Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. You may obtain * a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations * under the License. */ package com.facebook.buck.android; import com.facebook.buck.model.UnflavoredBuildTarget; import com.facebook.buck.rules.coercer.BuildConfigFields; import com.google.common.collect.ImmutableList; /** Utilities for generating a {@code BuildConfig.java} file for Android. */ public class BuildConfigs { /** * Name of the boolean global variable provided by the standard Android tools to indicate whether * an app was built in debug mode or not. */ public static final String DEBUG_CONSTANT = "DEBUG"; /** * Name of a Buck-specific global variable that indicates whether an app was built using * exopackage. */ public static final String IS_EXO_CONSTANT = "IS_EXOPACKAGE"; /** Name of a global variable that includes the exopackage configuration as a bitmask. */ public static final String EXOPACKAGE_FLAGS = "EXOPACKAGE_FLAGS"; /** @see #getDefaultBuildConfigFields() */ private static final BuildConfigFields DEFAULT_BUILD_CONFIG_CONSTANTS = BuildConfigFields.fromFields( ImmutableList.of( // DEBUG is expected by the standard Android tools. BuildConfigFields.Field.of("boolean", DEBUG_CONSTANT, "true"), // IS_EXOPACKAGE is a value we use internally for checking whether exopackage is being // used. BuildConfigFields.Field.of("boolean", IS_EXO_CONSTANT, "false"), BuildConfigFields.Field.of("int", EXOPACKAGE_FLAGS, "0"))); /** Utility class: do not instantiate. */ private BuildConfigs() {} /** * Returns a list of fields (with values) that every {@code BuildConfig.java} should declare. The * default value of each constant may be overridden by the {@code userFields} passed to {@link * #generateBuildConfigDotJava(UnflavoredBuildTarget, String, boolean, BuildConfigFields)} when * generating a {@code BuildConfig.java}. */ public static BuildConfigFields getDefaultBuildConfigFields() { return DEFAULT_BUILD_CONFIG_CONSTANTS; } /** * Generates the source code for an Android {@code BuildConfig.java} file with the default set of * fields specified by {@link #getDefaultBuildConfigFields()}. */ public static String generateBuildConfigDotJava( UnflavoredBuildTarget source, String javaPackage) { return generateBuildConfigDotJava( source, javaPackage, /* useConstantExpressions */ false, BuildConfigFields.empty()); } /** * Generates the source code for an Android {@code BuildConfig.java} file with fields specified by * {@code userFields}. * * <p>The output will also contain a constant for every entry in the collection returned by {@link * #getDefaultBuildConfigFields()}. * * <p>If the name of a field in {@code userFields} matches one in the collection returned by * {@link #getDefaultBuildConfigFields()}, the value in the {@code userFields} map will be used. * * @param javaPackage The package for the Java class generated by this method. * @param useConstantExpressions If {@code true}, the value for each static final field in the * generated class will be declared as the literal value in {@code userFields}. The values of * such fields can be inlined by {@code javac}. * <p>If {@code false}, the value for each static final field in the generated class will be * declared as a non-constant expression that is guaranteed to evaluate to the same value in * {@code userFields}. This ensures that the generated {@code BuildConfig.java} can still be * used in Robolectric tests, but does not run the risk of its values being inlined by {@code * javac}. This is important if the generated {@code BuildConfig} class is going to be swapped * out by a different implementation by {@link AndroidBinary}. See {@link AndroidBuildConfig} * for details. * @param userFields represents the fields that should be declared in the generated {@code * BuildConfig} class. */ public static String generateBuildConfigDotJava( UnflavoredBuildTarget source, String javaPackage, boolean useConstantExpressions, BuildConfigFields userFields) { BuildConfigFields totalFields = getDefaultBuildConfigFields().putAll(userFields); return totalFields.generateBuildConfigDotJava(source, javaPackage, useConstantExpressions); } }
In communication systems, a network topology, such as a star, tree, or mesh topology, is used. Furthermore, in communication systems, the components of a network, such as computers or hubs, are called nodes. In a mesh network, in which nodes communicates equally with each other, nodes adjacent to each other communicate. Accordingly, in a mesh network, when compared with a star network or tree network, it is easy to acquire the received electric field indication (RSSI) of each transmission signal from each node. However, in a mesh network, it is difficult to estimate when a node will communicate. Accordingly, nodes need to be in the state such that they can always communicate and thus it is difficult to put the entire network to sleep, which makes it difficult to implement low electrical power consumption. In contrast, in a star or tree network, a higher level node manages a lower level node. Accordingly, it is easy to synchronize nodes in the network, which in turn makes it easy to implement low electrical power consumption network with a star or tree topology. However, in a star or tree network, each node only communicates with a node that corresponds to a master station located higher than the subject node when the subject node is used as a slave station or only communicates with a node that corresponds to a slave station located lower than the subject node when the subject node is used as a master station. For example, a slave station located at the end of the star or tree only communicates with a hub that corresponds to a node functioning as a master station. Specifically, communication is not directly performed between nodes that are both functioning as slave stations of a hub. Accordingly, for the slave stations of the hub, it is difficult to obtain RSSI values for slave stations other than the subject hub. Therefore, it is difficult to use, in a star or tree communication system, a positioning algorithm that is a technology used to estimate the distance between slave stations on the basis of the RSSI value between the slave stations and then estimate the location of each slave station by using the estimated distance. There is a proposed technology for use in conventional mesh network technologies for obtaining the distance between wireless communication terminals from the indications received from communications between wireless communication terminals, for comparing the distance with the result of the positioning performed using GPS, and for correcting the positioning results obtained by the wireless communication terminals (see, for example, Japanese Laid-open Patent Publication No. 2006-343161). Furthermore, there is a conventional technology for obtaining received electric field indications by receiving, at a base station, a response signal from each mobile station in response to a call from a central office and for estimating the location of the mobile stations from the obtained received electric field indications (see, for example, Japanese Laid-open Patent Publication No. 08-172663). However, as described above, it is difficult to implement low electrical power consumption in a mesh network. Accordingly, for example, if a transmitter used as a slave station is attached to a cow in a field, the battery in the transmitter soon runs down and thus information may not be obtained. Furthermore, in the conventional technology for obtaining received electric field indications by receiving, at a base station, a response signal from each mobile station in response to a call from a central office, because the distance between mobile stations is not obtained, the accuracy with which the location of the mobile stations are specified becomes low.
Whistleblowing, Ethics and Corporate Culture: Theory and Practice in Australia Recent instability in the global financial markets has highlighted the need for companies to remain vigilant in detecting fraud and other forms of misconduct. Encouraging whistleblowing by persons who have knowledge of corporate misconduct or fraud is important. Legislative provisions protecting whistleblowers and the integration of whistleblower programmes within a company's corporate governance framework are two strategies that may encourage whistleblowing. Legislative provisions protecting whistleblowers were introduced into the Australian Corporations Act 2001 (Cth) in 2004. In 2007 the revised Australian Stock Exchange Principles recommended that listed corporations establish a code of conduct, and suggested that the code imbed within it reference to the way in which whistleblower disclosures are handled. While there have been various studies investigating whistleblowing programmes in the public sector, prior to this study there was virtually no empirical research into corporate sector whistleblowing in Australia. This paper examines the findings of an empirical study into the use of the whistleblowing protection provisions contained in the Australian Corporations Act 2001 (Cth) and the adoption of whistleblowing programmes as recommended by the Australian Stock Exchange Principles by Australia's leading 200 listed companies.
// 0x0701F0E0 - 0x0701F0F8 static const Lights1 bbh_seg7_lights_0701F0E0 = gdSPDefLights1( 0x66, 0x66, 0x66, 0xff, 0xff, 0xff, 0x28, 0x28, 0x28 ); // 0x0701F0F8 - 0x0701F138 static const Vtx bbh_seg7_vertex_0701F0F8[] = { {{{ 154, 614, -101}, 0, { 3034, 2010}, {0x00, 0x7f, 0x00, 0xff}}}, {{{ -153, 614, -101}, 0, { -3096, 2010}, {0x00, 0x7f, 0x00, 0xff}}}, {{{ -153, 614, 102}, 0, { -3096, 6098}, {0x00, 0x7f, 0x00, 0xff}}}, {{{ 154, 614, 102}, 0, { 3034, 6098}, {0x00, 0x7f, 0x00, 0xff}}}, }; // 0x0701F138 - 0x0701F238 static const Vtx bbh_seg7_vertex_0701F138[] = { {{{ 154, 0, -101}, 0, { 990, 2012}, {0x00, 0x00, 0x81, 0xff}}}, {{{ -153, 0, -101}, 0, { 0, 2012}, {0x00, 0x00, 0x81, 0xff}}}, {{{ 154, 614, -101}, 0, { 990, 0}, {0x00, 0x00, 0x81, 0xff}}}, {{{ 154, 614, 102}, 0, { 990, 0}, {0x00, 0x00, 0x7f, 0xff}}}, {{{ -153, 0, 102}, 0, { 0, 2012}, {0x00, 0x00, 0x7f, 0xff}}}, {{{ 154, 0, 102}, 0, { 990, 2012}, {0x00, 0x00, 0x7f, 0xff}}}, {{{ -153, 614, 102}, 0, { 0, 0}, {0x00, 0x00, 0x7f, 0xff}}}, {{{ -153, 0, -101}, 0, { 308, 2012}, {0x81, 0x00, 0x00, 0xff}}}, {{{ -153, 614, 102}, 0, { 990, 0}, {0x81, 0x00, 0x00, 0xff}}}, {{{ -153, 614, -101}, 0, { 308, 0}, {0x81, 0x00, 0x00, 0xff}}}, {{{ -153, 0, 102}, 0, { 990, 2012}, {0x81, 0x00, 0x00, 0xff}}}, {{{ 154, 0, -101}, 0, { 308, 2012}, {0x7f, 0x00, 0x00, 0xff}}}, {{{ 154, 614, -101}, 0, { 308, 0}, {0x7f, 0x00, 0x00, 0xff}}}, {{{ 154, 614, 102}, 0, { 990, 0}, {0x7f, 0x00, 0x00, 0xff}}}, {{{ 154, 0, 102}, 0, { 990, 2012}, {0x7f, 0x00, 0x00, 0xff}}}, {{{ -153, 614, -101}, 0, { 0, 0}, {0x00, 0x00, 0x81, 0xff}}}, }; // 0x0701F238 - 0x0701F280 static const Gfx bbh_seg7_dl_0701F238[] = { gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, spooky_0900A000), gsDPLoadSync(), gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 32 * 32 - 1, CALC_DXT(32, G_IM_SIZ_16b_BYTES)), gsSPLight(&bbh_seg7_lights_0701F0E0.l, 1), gsSPLight(&bbh_seg7_lights_0701F0E0.a, 2), gsSPVertex(bbh_seg7_vertex_0701F0F8, 4, 0), gsSP2Triangles( 0, 1, 2, 0x0, 0, 2, 3, 0x0), gsSPEndDisplayList(), }; // 0x0701F280 - 0x0701F2E8 static const Gfx bbh_seg7_dl_0701F280[] = { gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, spooky_09005000), gsDPLoadSync(), gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 32 * 64 - 1, CALC_DXT(32, G_IM_SIZ_16b_BYTES)), gsSPVertex(bbh_seg7_vertex_0701F138, 16, 0), gsSP2Triangles( 0, 1, 2, 0x0, 3, 4, 5, 0x0), gsSP2Triangles( 3, 6, 4, 0x0, 7, 8, 9, 0x0), gsSP2Triangles( 7, 10, 8, 0x0, 11, 12, 13, 0x0), gsSP2Triangles(11, 13, 14, 0x0, 1, 15, 2, 0x0), gsSPEndDisplayList(), }; // 0x0701F2E8 - 0x0701F378 const Gfx bbh_seg7_dl_0701F2E8[] = { gsDPPipeSync(), gsDPSetCombineMode(G_CC_MODULATERGB, G_CC_MODULATERGB), gsSPClearGeometryMode(G_SHADING_SMOOTH), gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, G_TX_LOADTILE, 0, G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOLOD, G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOLOD), gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON), gsDPTileSync(), gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0, G_TX_RENDERTILE, 0, G_TX_WRAP | G_TX_NOMIRROR, 5, G_TX_NOLOD, G_TX_WRAP | G_TX_NOMIRROR, 5, G_TX_NOLOD), gsDPSetTileSize(0, 0, 0, (32 - 1) << G_TEXTURE_IMAGE_FRAC, (32 - 1) << G_TEXTURE_IMAGE_FRAC), gsSPDisplayList(bbh_seg7_dl_0701F238), gsDPTileSync(), gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0, G_TX_RENDERTILE, 0, G_TX_CLAMP, 6, G_TX_NOLOD, G_TX_WRAP | G_TX_NOMIRROR, 5, G_TX_NOLOD), gsDPSetTileSize(0, 0, 0, (32 - 1) << G_TEXTURE_IMAGE_FRAC, (64 - 1) << G_TEXTURE_IMAGE_FRAC), gsSPDisplayList(bbh_seg7_dl_0701F280), gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF), gsDPPipeSync(), gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE), gsSPSetGeometryMode(G_SHADING_SMOOTH), gsSPEndDisplayList(), };
Utilizing Shell Galaxies Stellar shells are low surface brightness features in the form of open, concentric arcs, formed in close-to-radial collisions of galaxies. They occur in at least 10% of early-type galaxies and a small portion of spirals and their unique kinematics carry valuable information about the host galaxies. We discuss a method using measurements of the number and distribution of shells to estimate the mass distribution of the galaxies and the time since the merger. The method is applied on the shells of NGC 4993 - a galaxy hosting the electromagnetic counterpart of the gravitational wave event GW170817, to estimate the probable time since the galactic merger. We used analytical calculations and particle simulations to show that, in special cases, when kinematic data are available, further constraints on mass distribution and merger time can be derived. Applying the methods to the rapidly growing sample of known shell galaxies will constrain the dark-matter content in the galaxies and reveal detailed information on the recent merger history of the Universe.
MOSCOW (Reuters) - Department store group Debenhams DEB.L expects to generate a fifth of its overseas sales by 2015 in Russia, which is set to become Europe’s biggest retail market. Debenhams, which has been increasing sales at home despite a recession there, returned to Russia in September, six years after pulling out of the country because it was losing money. Russia is Europe’s second-biggest retail market with sales of $621 billion (383 billion pounds) last year, according to data consultancy Euromonitor, and is on track to become the biggest by 2013/14. “Russia should be a massive success story for anyone who comes here,” Francis McAuley, the company’s international director told Reuters on Thursday, five weeks after opening a Debenhams store outside Moscow. International retailers have long been trying to establish themselves in Russia, though many have struggled. France’s Carrefour (CARR.PA) pulled out after only four months in 2009. Debenhams, Britain’s No. 2 department store group by sales behind John Lewis, has about 170 domestic stores and franchises in 27 countries including India and China. McAuley said Russia could generate 20 percent of Debenhams’ international turnover, which includes all sales outside the UK. Foreign markets account for a fifth of its total 3 billion pounds of ($4.85 billion) yearly sales. McAuley said he expected sales levels from a store in central Moscow to be similar to one in central London. The company, which has franchises in Russia, has no plans to launch its own operation in the country. It expects to have seven more stores in Moscow in the next five years and is in final negotiations on two of them, McAuley said. He said centrally located stores would be four times as profitable as the one just opened in Belaya Dacha, just outside the capital.
<reponame>MarkG/java-oss-lib<filename>src/main/java/com/trendrr/oss/networking/strest/StrestMessageReader.java /** * */ package com.trendrr.oss.networking.strest; import java.util.concurrent.atomic.AtomicReference; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import com.trendrr.oss.exceptions.TrendrrException; import com.trendrr.oss.networking.ByteReadCallback; import com.trendrr.oss.networking.SocketChannelWrapper; import com.trendrr.oss.networking.StringReadCallback; /** * @author <NAME> * @created Mar 14, 2011 * * @deprecated use com.trendrr.oss.strest */ @Deprecated public class StrestMessageReader implements StringReadCallback, ByteReadCallback { protected static Log log = LogFactory.getLog(StrestMessageReader.class); StrestResponse current = null; AtomicReference<SocketChannelWrapper> socket = new AtomicReference<SocketChannelWrapper>(); AtomicReference<StrestClient> client = new AtomicReference<StrestClient>(); public void start(StrestClient client, SocketChannelWrapper socket) { this.client.set(client); this.socket.set(socket); this.readNextMessage(); } public void stop() { this.socket.set(null); this.client.set(null); } protected void readNextMessage() { SocketChannelWrapper sock = this.socket.get(); if (sock == null) { log.info("No socketchannelwrapper, returning"); } this.current = null; sock.readUntil(StrestUtil.CRLF + StrestUtil.CRLF, StrestUtil.DEFAULT_CHARSET, true, this); } /* (non-Javadoc) * @see com.trendrr.oss.networking.ChannelCallback#onError(com.trendrr.oss.exceptions.TrendrrException) */ @Override public void onError(TrendrrException ex) { StrestClient client = this.client.get(); if (client == null) return; client.error(ex); } /* (non-Javadoc) * @see com.trendrr.oss.networking.ByteReadCallback#byteResult(byte[]) */ @Override public void byteResult(byte[] result) { this.current.setContent(result); // System.out.println("GOT REQUESTED BYTES: " + result); StrestClient client = this.client.get(); if (client == null) return; //call the client. client.incoming(this.current); //now read the next message. this.readNextMessage(); } /* (non-Javadoc) * @see com.trendrr.oss.networking.StringReadCallback#stringResult(java.lang.String) */ @Override public void stringResult(String result) { current = new StrestResponse(); current.parseHeaders(result); String contentLength = current.getHeader(StrestHeaders.Names.CONTENT_LENGTH); if (contentLength == null) { log.warn("No content length set by server. "); this.readNextMessage(); return; } int length = Integer.parseInt(contentLength); SocketChannelWrapper sock = this.socket.get(); if (sock == null) { log.info("No socketchannelwrapper, returning"); } sock.readBytes(length, this); } }
Bringing Fairness in LoRaWAN through SF Allocation Optimization We propose an optimization model for single-cell LoRaWAN planning which computes the limit range of each spreading factor (SF) in order to maximize the minimum packet delivery ratio (PDR) of every node in the network. It allows to balance the opposite effects of attenuation and collision of the transmissions and guarantee fairness among the nodes. We show that our optimization framework improves the worst PDR of the nodes by more than 13 percentage points compared to usual SF boundaries based on SNR threshold. A study of the tradeoff between precision and resolution time of the model shows its effectiveness even with a small number of possible distance limits, and its scalability when the node density increases.
<reponame>hamidrm/drivers_collection<filename>ublox/inc/ublox.h /* * ublox.h * * Created on: Feb 25, 2019 * Author: mehrabian */ #ifndef UBLOX_INC_UBLOX_H_ #define UBLOX_INC_UBLOX_H_ #include <stdlib.h> #include <string.h> #include <stdint.h> #ifdef __cplusplus extern "C" { #endif /***********************************************************************/ /* MACRO DEFINITIONS. */ /***********************************************************************/ #define UBLOX_MSG_AID_ALPSRV_MAX_DATA_SIZE 32 #define UBLOX_MSG_AID_ALPSRV_MAX_SIZE 16 #define UBLOX_MSG_AID_ALP_MAX_SIZE 16 #define UBLOX_MSG_CFG_GNSS_BLOCKS_MAX_SIZE 16 #define UBLOX_MSG_CFG_INFO_BLOCKS_MAX_SIZE 16 #define UBLOX_MSG_CFG_RINV_MAX_SIZE 16 #define UBLOX_MSG_NAV_DGPS_DATA_MAX_SIZE 32 #define UBLOX_MSG_NAV_SBAS_DATA_MAX_SIZE 32 #define UBLOX_MSG_NAV_SVINFO_DATA_MAX_SIZE 32 #define MAX_CFG_MSG_TYPES 256 #define MAX_CFG_MSG_ACK_TIMEOUT_SEC 5 #define UBLOX_MAX_RX_BUFFER_SIZE 64 /* UBX messages format */ #define UBLOX_UBX_SYNC_CHAR_A 0xB5 #define UBLOX_UBX_SYNC_CHAR_B 0x62 #define UBLOX_UBX_CHKSUM_LEN 2 #define UBLOX_UBX_LEN_LEN 2 #define UBLOX_UBX_CLASS_ID_LEN 1 #define UBLOX_UBX_MSG_ID_LEN 1 #define UBLOX_UBX_HEADER_LEN 2 /* UBX messages offset */ #define UBLOX_UBX_SYNC_CHAR_A_OFFSET 0 #define UBLOX_UBX_SYNC_CHAR_B_OFFSET 1 #define UBLOX_UBX_CLASS_ID_OFFSET 2 #define UBLOX_UBX_MSG_ID_OFFSET 3 #define UBLOX_UBX_LEN_OFFSET 4 #define UBLOX_UBX_PAYLOAD_OFFSET 6 /* UBLOX AID flags */ #define UBLOX_UBX_AID_INI_FLAGS_POS (1<<0) #define UBLOX_UBX_AID_INI_FLAGS_TIME (1<<1) #define UBLOX_UBX_AID_INI_FLAGS_CLOCK_D (1<<2) #define UBLOX_UBX_AID_INI_FLAGS_TP (1<<3) #define UBLOX_UBX_AID_INI_FLAGS_CLOCK_F (1<<4) #define UBLOX_UBX_AID_INI_FLAGS_LLA (1<<5) #define UBLOX_UBX_AID_INI_FLAGS_ALT_INV (1<<6) #define UBLOX_UBX_AID_INI_FLAGS_PREV_TM (1<<7) #define UBLOX_UBX_AID_INI_FLAGS_UTC (1<<10) #define UBLOX_UBX_AID_INI_TM_CFG_F_EDGE (1<<1) #define UBLOX_UBX_AID_INI_TM_CFG_TM_1 (1<<4) #define UBLOX_UBX_AID_INI_TM_CFG_F_1 (1<<6) #define UBLOX_UBX_AID_HUI_FLAGS_HEALTH_VALID (1<<0) #define UBLOX_UBX_AID_HUI_FLAGS_UTC_VALID (1<<1) #define UBLOX_UBX_AID_HUI_FLAGS_KLOB_VALID (1<<2) /* UBLOX CFG flags */ #define UBLOX_UBX_CFG_USB_FLAGS_REF_ENUM (1<<0) #define UBLOX_UBX_CFG_USB_FLAGS_POWER_MODE (1<<1) #define UBLOX_UBX_CFG_TP5_FLAGS_ACTIVE (1<<0) #define UBLOX_UBX_CFG_TP5_FLAGS_LOCK_GPS_FREQ (1<<1) #define UBLOX_UBX_CFG_TP5_FLAGS_LOCKED_OTHER_SET (1<<2) #define UBLOX_UBX_CFG_TP5_FLAGS_IS_FREQ (1<<3) #define UBLOX_UBX_CFG_TP5_FLAGS_IS_LENGTH (1<<4) #define UBLOX_UBX_CFG_TP5_FLAGS_ALIGN_TO_TOW (1<<5) #define UBLOX_UBX_CFG_TP5_FLAGS_POLARITY (1<<6) #define UBLOX_UBX_CFG_TP5_FLAGS_GRID_UTC_GPS (1<<7) #define UBLOX_UBX_CFG_SBAS_SCAN_MODE1(X) (1<<X) #define UBLOX_UBX_CFG_SBAS_SCAN_MODE2(X) (1<<(X & 0x7F)) #define UBLOX_UBX_CFG_SBAS_USAGE_RANGE (1<<0) #define UBLOX_UBX_CFG_SBAS_USAGE_DIFF_CORR (1<<1) #define UBLOX_UBX_CFG_SBAS_USAGE_INTEGRITY (1<<2) #define UBLOX_UBX_CFG_SBAS_MODE_ENABLED (1<<0) #define UBLOX_UBX_CFG_SBAS_MODE_TEST (1<<1) #define UBLOX_UBX_CFG_RST_HOT_START 0x0000 #define UBLOX_UBX_CFG_RST_WARM_START 0x0001 #define UBLOX_UBX_CFG_RST_COLD_START 0xFFFF #define UBLOX_UBX_CFG_RST_NAV_BBR_MASK_EPH (1<<0) #define UBLOX_UBX_CFG_RST_NAV_BBR_MASK_ALM (1<<1) #define UBLOX_UBX_CFG_RST_NAV_BBR_MASK_HEALTH (1<<2) #define UBLOX_UBX_CFG_RST_NAV_BBR_MASK_KLOB (1<<3) #define UBLOX_UBX_CFG_RST_NAV_BBR_MASK_POS (1<<4) #define UBLOX_UBX_CFG_RST_NAV_BBR_MASK_CLKD (1<<5) #define UBLOX_UBX_CFG_RST_NAV_BBR_MASK_OSC (1<<6) #define UBLOX_UBX_CFG_RST_NAV_BBR_MASK_UTC (1<<7) #define UBLOX_UBX_CFG_RST_NAV_BBR_MASK_RTC (1<<8) #define UBLOX_UBX_CFG_RST_NAV_BBR_MASK_SFDR (1<<11) #define UBLOX_UBX_CFG_RST_NAV_BBR_MASK_VMON (1<<12) #define UBLOX_UBX_CFG_RST_NAV_BBR_MASK_TCT (1<<13) #define UBLOX_UBX_CFG_RST_NAV_BBR_MASK_AOP (1<<15) #define UBLOX_UBX_CFG_RINV_FLAGS_DUMP (1<<0) #define UBLOX_UBX_CFG_RINV_FLAGS_BINARY (1<<1) #define UBLOX_UBX_CFG_PRT_IN_MASK_UBX (1<<0) #define UBLOX_UBX_CFG_PRT_IN_MASK_NMEA (1<<1) #define UBLOX_UBX_CFG_PRT_IN_MASK_RTCM (1<<2) #define UBLOX_UBX_CFG_PRT_OUT_MASK_UBX (1<<0) #define UBLOX_UBX_CFG_PRT_OUT_MASK_NMEA (1<<1) #define UBLOX_UBX_CFG_PRT_DDC_FLAGS_EXT_TX_TIMEOUT (1<<1) #define UBLOX_UBX_CFG_PRT_DDC_OUT_PROTO_MASK_UBX (1<<0) #define UBLOX_UBX_CFG_PRT_DDC_OUT_PROTO_MASK_NMEA (1<<1) #define UBLOX_UBX_CFG_PRT_DDC_IN_PROTO_MASK_UBX (1<<0) #define UBLOX_UBX_CFG_PRT_DDC_IN_PROTO_MASK_NMEA (1<<1) #define UBLOX_UBX_CFG_PRT_DDC_IN_PROTO_MASK_RTCM (1<<1) #define UBLOX_UBX_CFG_PRT_DDC_MODE_SLAVE_ADDR ((X & 0x7F)<<1) #define UBLOX_UBX_CFG_PRT_DDC_TXREADY_EN (1<<0) #define UBLOX_UBX_CFG_PRT_DDC_TXREADY_POL (1<<1) #define UBLOX_UBX_CFG_PRT_DDC_TXREADY_PIN(X) ((X & 0x1F)<<2) #define UBLOX_UBX_CFG_PRT_DDC_TXREADY_THRESH(X) ((X & 0x1FF)<<7) #define UBLOX_UBX_CFG_PRT_SPI_FLAGS_EXT_TX_TIMEOUT (1<<1) #define UBLOX_UBX_CFG_PRT_SPI_OUT_PROTO_MASK_UBX (1<<0) #define UBLOX_UBX_CFG_PRT_SPI_OUT_PROTO_MASK_NMEA (1<<1) #define UBLOX_UBX_CFG_PRT_SPI_IN_PROTO_MASK_UBX (1<<0) #define UBLOX_UBX_CFG_PRT_SPI_IN_PROTO_MASK_NMEA (1<<1) #define UBLOX_UBX_CFG_PRT_SPI_IN_PROTO_MASK_RTCM (1<<1) #define UBLOX_UBX_CFG_PRT_SPI_MODE_SPI_MODE(X) ((X & 0x03)<<1) #define UBLOX_UBX_CFG_PRT_SPI_MODE_FLOW_CONTROL (1<<6) #define UBLOX_UBX_CFG_PRT_SPI_MODE_FFCNT(X) ((X & 0xFF)<<8) #define UBLOX_UBX_CFG_PRT_SPI_TXREADY_EN (1<<0) #define UBLOX_UBX_CFG_PRT_SPI_TXREADY_POL (1<<1) #define UBLOX_UBX_CFG_PRT_SPI_TXREADY_PIN(X) ((X & 0x1F)<<2) #define UBLOX_UBX_CFG_PRT_SPI_TXREADY_THRESH(X) ((X & 0x1FF)<<7) #define UBLOX_UBX_CFG_PRT_USB_OUT_PROTO_MASK_UBX (1<<0) #define UBLOX_UBX_CFG_PRT_USB_OUT_PROTO_MASK_NMEA (1<<1) #define UBLOX_UBX_CFG_PRT_USB_IN_PROTO_MASK_UBX (1<<0) #define UBLOX_UBX_CFG_PRT_USB_IN_PROTO_MASK_NMEA (1<<1) #define UBLOX_UBX_CFG_PRT_USB_IN_PROTO_MASK_RTCM (1<<1) #define UBLOX_UBX_CFG_PRT_USB_TXREADY_EN (1<<0) #define UBLOX_UBX_CFG_PRT_USB_TXREADY_POL (1<<1) #define UBLOX_UBX_CFG_PRT_USB_TXREADY_PIN(X) ((X & 0x1F)<<2) #define UBLOX_UBX_CFG_PRT_USB_TXREADY_THRESH(X) ((X & 0x1FF)<<7) #define UBLOX_UBX_CFG_PRT_UART_FLAGS_EXT_TX_TIMEOUT (1<<1) #define UBLOX_UBX_CFG_PRT_UART_OUT_PROTO_MASK_UBX (1<<0) #define UBLOX_UBX_CFG_PRT_UART_OUT_PROTO_MASK_NMEA (1<<1) #define UBLOX_UBX_CFG_PRT_UART_IN_PROTO_MASK_UBX (1<<0) #define UBLOX_UBX_CFG_PRT_UART_IN_PROTO_MASK_NMEA (1<<1) #define UBLOX_UBX_CFG_PRT_UART_IN_PROTO_MASK_RTCM (1<<1) #define UBLOX_UBX_CFG_PRT_UART_MODE_CHAR_LEN(X) ((X & 0x03)<<6) #define UBLOX_UBX_CFG_PRT_UART_MODE_EVEN_PARITY(X) ((X & 0x07)<<9) #define UBLOX_UBX_CFG_PRT_UART_MODE_N_STOP_BITS(X) ((X & 0x03)<<12) #define UBLOX_UBX_CFG_PRT_UART_TXREADY_EN (1<<0) #define UBLOX_UBX_CFG_PRT_UART_TXREADY_POL (1<<1) #define UBLOX_UBX_CFG_PRT_UART_TXREADY_PIN(X) ((X & 0x1F)<<2) #define UBLOX_UBX_CFG_PRT_UART_TXREADY_THRESH(X) ((X & 0x1FF)<<7) #define UBLOX_UBX_CFG_PM2_FLAGS_EXT_INT1_SELECT (1<<4) #define UBLOX_UBX_CFG_PM2_FLAGS_EXT_INT_WAKE (1<<5) #define UBLOX_UBX_CFG_PM2_FLAGS_EXT_INT_BACKUP (1<<6) #define UBLOX_UBX_CFG_PM2_FLAGS_LIMIT_PEAK_CURR(X) ((X & 0x03)<<8) #define UBLOX_UBX_CFG_PM2_FLAGS_WAIT_TIME_FIX (1<<10) #define UBLOX_UBX_CFG_PM2_FLAGS_UPDATE_RTC (1<<11) #define UBLOX_UBX_CFG_PM2_FLAGS_UPDATE_EPH (1<<12) #define UBLOX_UBX_CFG_PM2_FLAGS_DO_NOT_ENTER_OFF (1<<16) #define UBLOX_UBX_CFG_PM2_FLAGS_MODE(X) ((X & 0x03)<<17) #define UBLOX_UBX_CFG_NMEA_GNSS_FILTER_GPS (1<<0) #define UBLOX_UBX_CFG_NMEA_GNSS_FILTER_SBAS (1<<1) #define UBLOX_UBX_CFG_NMEA_GNSS_FILTER_QZSS (1<<4) #define UBLOX_UBX_CFG_NMEA_GNSS_FILTER_GLONASS (1<<5) #define UBLOX_UBX_CFG_NMEA_FLAGS_COMPAT (1<<0) #define UBLOX_UBX_CFG_NMEA_FLAGS_CONSIDER (1<<1) #define UBLOX_UBX_CFG_NMEA_FILTER_POS (1<<0) #define UBLOX_UBX_CFG_NMEA_FILTER_MSK_POS (1<<1) #define UBLOX_UBX_CFG_NMEA_FILTER_TIME (1<<2) #define UBLOX_UBX_CFG_NMEA_FILTER_DATE (1<<3) #define UBLOX_UBX_CFG_NMEA_FILTER_GPS_ONLY (1<<4) #define UBLOX_UBX_CFG_NMEA_FILTER_TRACK (1<<5) #define UBLOX_UBX_CFG_NAVX_AOP_CFG_USE_AOP (1<<0) #define UBLOX_UBX_CFG_NAVX_MASK1_MIN_MAX (1<<2) #define UBLOX_UBX_CFG_NAVX_MASK1_MIN_CNO (1<<3) #define UBLOX_UBX_CFG_NAVX_MASK1_INITIAL_3D_FIX (1<<6) #define UBLOX_UBX_CFG_NAVX_MASK1_WKN_ROLL (1<<9) #define UBLOX_UBX_CFG_NAVX_MASK1_PPP (1<<13) #define UBLOX_UBX_CFG_NAVX_MASK1_AOP (1<<14) #define UBLOX_UBX_CFG_NAV5_MASK_DYN (1<<0) #define UBLOX_UBX_CFG_NAV5_MASK_MIN_EL (1<<1) #define UBLOX_UBX_CFG_NAV5_MASK_POS_FIX_MODE (1<<2) #define UBLOX_UBX_CFG_NAV5_MASK_DR_LIM (1<<3) #define UBLOX_UBX_CFG_NAV5_MASK_POS_MASK (1<<4) #define UBLOX_UBX_CFG_NAV5_MASK_TIME_MASK (1<<5) #define UBLOX_UBX_CFG_NAV5_MASK_STATIC_HOLD_MASK (1<<6) #define UBLOX_UBX_CFG_NAV5_MASK_DGPS_MASK (1<<7) #define UBLOX_UBX_CFG_LOGFILTER_FLAGS_RECORD_ENABLED (1<<0) #define UBLOX_UBX_CFG_LOGFILTER_FLAGS_PSM_ONE_PER_WAKUP_ENABLED (1<<1) #define UBLOX_UBX_CFG_LOGFILTER_FLAGS_APLLY_ALL_FILTERS (1<<2) #define UBLOX_UBX_CFG_ITFM_CONFIG2_ANT_SETTING(X) ((X & 0x03)<<12) #define UBLOX_UBX_CFG_ITFM_CONFIG_BB_THRESHOLD (1<<3) #define UBLOX_UBX_CFG_ITFM_CONFIG_CW_THRESHOLD (1<<8) #define UBLOX_UBX_CFG_ITFM_CONFIG_ENABLE (1<<31) #define UBLOX_UBX_CFG_INF_MSG_MASK_ERROR (1<<0) #define UBLOX_UBX_CFG_INF_MSG_MASK_WARNING (1<<1) #define UBLOX_UBX_CFG_INF_MSG_MASK_NOTIFIC (1<<2) #define UBLOX_UBX_CFG_INF_MSG_MASK_DEBUG (1<<3) #define UBLOX_UBX_CFG_INF_MSG_MASK_TEST (1<<4) #define UBLOX_UBX_CFG_GNSS_FLAGS_ENABLE (1<<0) #define UBLOX_UBX_CFG_CFG_DEVICE_MASK_BBR (1<<0) #define UBLOX_UBX_CFG_CFG_DEVICE_MASK_FLASH (1<<1) #define UBLOX_UBX_CFG_CFG_DEVICE_MASK_EEPROM (1<<2) #define UBLOX_UBX_CFG_CFG_DEVICE_MASK_SPI_FLASH (1<<3) #define UBLOX_UBX_CFG_CFG_CLEAR_MASK_IO_PORT (1<<0) #define UBLOX_UBX_CFG_CFG_CLEAR_MASK_MSG_CONF (1<<1) #define UBLOX_UBX_CFG_CFG_CLEAR_MASK_INF_MSG (1<<2) #define UBLOX_UBX_CFG_CFG_CLEAR_MASK_NAV_CONF (1<<3) #define UBLOX_UBX_CFG_CFG_CLEAR_MASK_RXM_CONF (1<<4) #define UBLOX_UBX_CFG_CFG_CLEAR_MASK_RINV_CONF (1<<9) #define UBLOX_UBX_CFG_CFG_CLEAR_MASK_ANT_CONF (1<<10) #define UBLOX_UBX_CFG_ANT_PINS_PIN_SWITCH(X) ((X & 0x1F)<<0) #define UBLOX_UBX_CFG_ANT_PINS_PIN_SCD(X) ((X & 0x1F)<<5) #define UBLOX_UBX_CFG_ANT_PINS_PIN_OCD(X) ((X & 0x1F)<<10) #define UBLOX_UBX_CFG_ANT_PINS_RECONFIG (1<<15) #define UBLOX_UBX_CFG_ANT_FLAGS_SVCS (1<<0) #define UBLOX_UBX_CFG_ANT_FLAGS_SCD (1<<1) #define UBLOX_UBX_CFG_ANT_FLAGS_OCD (1<<2) #define UBLOX_UBX_CFG_ANT_FLAGS_PDWN_ON_SCD (1<<3) #define UBLOX_UBX_CFG_ANT_FLAGS_RECOVERY (1<<4) /* UBLOX NAV flags */ #define UBLOX_UBX_NAV_TIMEUTC_VALID_TOW (1<<0) #define UBLOX_UBX_NAV_TIMEUTC_VALID_WKN (1<<1) #define UBLOX_UBX_NAV_TIMEUTC_VALID_UTC (1<<2) #define UBLOX_UBX_NAV_TIMEGPS_VALID_TOW (1<<0) #define UBLOX_UBX_NAV_TIMEUTC_VALID_WEEK (1<<1) #define UBLOX_UBX_NAV_TIMEUTC_VALID_LEAP (1<<2) #define UBLOX_UBX_NAV_SVINFO_QUALITY_IDLE 0 #define UBLOX_UBX_NAV_SVINFO_QUALITY_SEARCHING 1 #define UBLOX_UBX_NAV_SVINFO_QUALITY_SIGNAL_AQUIRED 2 #define UBLOX_UBX_NAV_SVINFO_QUALITY_SIGNAL_UNSTABLE 3 #define UBLOX_UBX_NAV_SVINFO_QUALITY_CODE_LOCK_ON_SIGNAL 4 #define UBLOX_UBX_NAV_SVINFO_FLAGS_SV_USED (1<<0) #define UBLOX_UBX_NAV_SVINFO_FLAGS_DIFF_CORR (1<<1) #define UBLOX_UBX_NAV_SVINFO_FLAGS_ORBIT_AVAIL (1<<2) #define UBLOX_UBX_NAV_SVINFO_FLAGS_ORBIT_EPH (1<<3) #define UBLOX_UBX_NAV_SVINFO_FLAGS_UNHEALTHLY (1<<4) #define UBLOX_UBX_NAV_SVINFO_FLAGS_ORBIT_ALM (1<<5) #define UBLOX_UBX_NAV_SVINFO_FLAGS_ORBIT_AOP (1<<6) #define UBLOX_UBX_NAV_SVINFO_FLAGS_SMOOTHED (1<<7) #define UBLOX_UBX_NAV_SVINFO_GLOBALFLAG_CHIPGEN_ANTARIS (1<<0) #define UBLOX_UBX_NAV_SVINFO_GLOBALFLAG_CHIPGEN_UBLOX5 (1<<1) #define UBLOX_UBX_NAV_SVINFO_GLOBALFLAG_CHIPGEN_UBLOX6 (1<<2) #define UBLOX_UBX_NAV_STATUS_FLAG2_ACQUISITION 0 #define UBLOX_UBX_NAV_STATUS_FLAG2_TRACKING 1 #define UBLOX_UBX_NAV_STATUS_FLAG2_POWER_OPTIMIZED_TRACKING 2 #define UBLOX_UBX_NAV_STATUS_FLAG2_INACTIVE 3 #define UBLOX_UBX_NAV_STATUS_FIXSTAT_DGPS_ISTAT (1<<0) #define UBLOX_UBX_NAV_STATUS_FIXSTAT_MAP_MATCHING_NONE (0<<6) #define UBLOX_UBX_NAV_STATUS_FIXSTAT_MAP_MATCHING_VALID (1<<6) #define UBLOX_UBX_NAV_STATUS_FIXSTAT_MAP_MATCHING_USED (2<<6) #define UBLOX_UBX_NAV_STATUS_FIXSTAT_MAP_MATCHING_DR (3<<6) #define UBLOX_UBX_NAV_STATUS_FLAGS_FIX_OK (1<<0) #define UBLOX_UBX_NAV_STATUS_FLAGS_DIFF_SOLN (1<<1) #define UBLOX_UBX_NAV_STATUS_FLAGS_WKN_SET (1<<2) #define UBLOX_UBX_NAV_STATUS_FLAGS_TOW_SET (1<<3) #define UBLOX_UBX_NAV_SOL_FLAGS_FIX_OK (1<<0) #define UBLOX_UBX_NAV_SOL_FLAGS_DIFF_SOLN (1<<1) #define UBLOX_UBX_NAV_SOL_FLAGS_WKN_SET (1<<2) #define UBLOX_UBX_NAV_SOL_FLAGS_TOW_SET (1<<3) #define UBLOX_UBX_NAV_SBAS_SERVICE_RANGING (1<<0) #define UBLOX_UBX_NAV_SBAS_SERVICE_CORRECTIONS (1<<1) #define UBLOX_UBX_NAV_SBAS_SERVICE_INTEGRITY (1<<2) #define UBLOX_UBX_NAV_SBAS_SERVICE_TEST_MODE (1<<3) #define UBLOX_UBX_NAV_PVT_FLAGS_GNSS_FIX_OK (1<<0) #define UBLOX_UBX_NAV_PVT_FLAGS_GNSS_DIFF_SOLIN (1<<1) #define UBLOX_UBX_NAV_PVT_FLAGS_GNSS_PSM_STATE(X) ((X & 0x07)<<2) #define UBLOX_UBX_NAV_PVT_FLAGS_GNSS_PSM_STATE_ENABLED UBLOX_UBX_NAV_PVT_FLAGS_GNSS_PSM_STATE(1) #define UBLOX_UBX_NAV_PVT_FLAGS_GNSS_PSM_STATE_ACQUISITION UBLOX_UBX_NAV_PVT_FLAGS_GNSS_PSM_STATE(2) #define UBLOX_UBX_NAV_PVT_FLAGS_GNSS_PSM_STATE_TRACKING UBLOX_UBX_NAV_PVT_FLAGS_GNSS_PSM_STATE(3) #define UBLOX_UBX_NAV_PVT_FLAGS_GNSS_PSM_STATE_POWER_OPTIMIZED_TRACKING UBLOX_UBX_NAV_PVT_FLAGS_GNSS_PSM_STATE(4) #define UBLOX_UBX_NAV_PVT_FLAGS_GNSS_PSM_STATE_INACTIVE UBLOX_UBX_NAV_PVT_FLAGS_GNSS_PSM_STATE(5) #define UBLOX_UBX_NAV_PVT_VALID_DATE (1<<0) #define UBLOX_UBX_NAV_PVT_VALID_TIME (1<<1) #define UBLOX_UBX_NAV_PVT_FULLY_RESOLVED (1<<2) #define UBLOX_UBX_NAV_DGPS_FLAGS_DGPS_USED (1<<4) #define UBLOX_UBX_NAV_DGPS_FLAGS_CHANNEL(X) ((X & 0x0F)<<0) #define UBLOX_UBX_NAV_AOP_CFG_USE_AOP (1<<0) /***********************************************************************/ /* TYPEDEF DEFINITIONS. */ /***********************************************************************/ /* Data types */ typedef uint8_t ublox_msg_id_t; typedef uint8_t* ublox_ubx_packet_t; typedef uint8_t u1_t; typedef uint16_t u2_t; typedef uint32_t u4_t; typedef int8_t i1_t; typedef int16_t i2_t; typedef int32_t i4_t; typedef uint8_t x1_t; typedef uint16_t x2_t; typedef uint32_t x4_t; typedef float r4_t; typedef double r8_t; typedef char ch_t; typedef void* ublox_instance; /* Function Pointers */ typedef void(*ublox_msg_received_cb)(ublox_ubx_class_id_t, ublox_msg_id_t, ublox_ubx_msg_t*); typedef void(*ublox_uart_send_cb_t)(const uint8_t *, size_t); typedef void(*ublox_uart_update_params_cb_t)(ublox_uart_baudrate_t,ublox_uart_char_len_t, ublox_uart_parity_t,ublox_uart_n_stop_bits_t); typedef void*(*ublox_malloc_cb_t)(size_t); typedef void(*ublox_free_cb_t)(void *); /***********************************************************************/ /* ENUMERATOR DEFINITIONS. */ /***********************************************************************/ typedef enum { UBLOX_PERIODIC_MSG_STATUS_DISABLE, UBLOX_PERIODIC_MSG_STATUS_ENABLE, }ublox_periodic_msg_status_t; typedef enum { UBLOX_TIME_PULSE, UBLOX_TIME_PULSE2, }ublox_time_pulse_id_t; typedef enum { UBLOX_RESET_MODE_HARDWARE_RESET_IMMEDIATELY, UBLOX_RESET_MODE_SOFTWARE_RESET, UBLOX_RESET_MODE_SOFTWARE_RESET_GNSS_ONLY, UBLOX_RESET_MODE_HARDWARE_RESET_AFTER_SHUTDOWN, UBLOX_RESET_MODE_GNSS_STOP, UBLOX_RESET_MODE_GNSS_START, }ublox_reset_mode_t; typedef enum { UBLOX_PERIODIC_RATE_REF_UTC_TIME, UBLOX_PERIODIC_RATE_REF_GPS_TIME, }ublox_periodic_rate_time_ref_t; typedef enum { UBLOX_PORT_DDC, UBLOX_PORT_UART1, UBLOX_PORT_USB, UBLOX_PORT_SPI, }ublox_ports_id_t; typedef enum { UBLOX_UART_BAUDRATE_4800 = 4800, UBLOX_UART_BAUDRATE_9600 = 9600, UBLOX_UART_BAUDRATE_19200 = 19200, UBLOX_UART_BAUDRATE_38400 = 38400, UBLOX_UART_BAUDRATE_57600 = 57600, UBLOX_UART_BAUDRATE_115200 = 115200, }ublox_uart_baudrate_t; typedef enum { UBLOX_UART_CHAR_LEN_5_BIT, UBLOX_UART_CHAR_LEN_6_BIT, UBLOX_UART_CHAR_LEN_7_BIT, UBLOX_UART_CHAR_LEN_8_BIT, }ublox_uart_char_len_t; typedef enum { UBLOX_UART_PARITY_EVEN_PARITY, UBLOX_UART_PARITY_ODD_PARITY, UBLOX_UART_PARITY_NO_PARITY = 4, }ublox_uart_parity_t; typedef enum { UBLOX_UART_N_STOP_BITS_1_0, UBLOX_UART_N_STOP_BITS_1_5, UBLOX_UART_N_STOP_BITS_2_0, UBLOX_UART_N_STOP_BITS_0_5, }ublox_uart_n_stop_bits_t; typedef enum { UBLOX_SPI_MODE_0, UBLOX_SPI_MODE_1, UBLOX_SPI_MODE_2, UBLOX_SPI_MODE_3, }ublox_spi_mode_t; typedef enum { UBLOX_SPI_FLOW_CONTROL_DISABLED, UBLOX_SPI_FLOW_CONTROL_ENABLED, }ublox_spi_flow_control_t; typedef enum { UBLOX_CFG_REQ_STATUS_IDLE, UBLOX_CFG_REQ_STATUS_WAITING, UBLOX_CFG_REQ_STATUS_TIMEOUT, }ublox_cfg_req_status_t; typedef enum { UBLOX_UBX_CLASS_ID_NAV = 0x01, UBLOX_UBX_CLASS_ID_RXM = 0x02, UBLOX_UBX_CLASS_ID_INF = 0x04, UBLOX_UBX_CLASS_ID_ACK = 0x05, UBLOX_UBX_CLASS_ID_CFG = 0x06, UBLOX_UBX_CLASS_ID_MON = 0x0A, UBLOX_UBX_CLASS_ID_AID = 0x0B, UBLOX_UBX_CLASS_ID_TIM = 0x0D, UBLOX_UBX_CLASS_ID_LOG = 0x21, UBLOX_UBX_CLASS_ID_NMEA_STD = 0xF0, UBLOX_UBX_CLASS_ID_NMEA_PUBX = 0xF1, /*--------------------------------- * Manager messages * --------------------------------*/ UBLOX_UBX_CLASS_ID_CFG_TIMEOUT = 0xFF, UBLOX_UBX_CLASS_ID_CFG_NACK = 0xFE, UBLOX_UBX_CLASS_ID_CFG_ACK = 0xFD, UBLOX_UBX_CLASS_ID_DISCONNECTED = 0xFC, }ublox_ubx_class_id_t; typedef enum { UBLOX_UBX_MSG_ID_ACK_ACK = 0x01, UBLOX_UBX_MSG_ID_ACK_NAK = 0x00, }ublox_ubx_msg_ack_t; typedef enum { UBLOX_UBX_MSG_ID_AID_ALM = 0x30, UBLOX_UBX_MSG_ID_AID_ALPSRV = 0x32, UBLOX_UBX_MSG_ID_AID_ALP = 0x50, UBLOX_UBX_MSG_ID_AID_AOP = 0x33, UBLOX_UBX_MSG_ID_AID_DATA = 0x10, UBLOX_UBX_MSG_ID_AID_EPH = 0x31, UBLOX_UBX_MSG_ID_AID_HUI = 0x02, UBLOX_UBX_MSG_ID_AID_INI = 0x01, UBLOX_UBX_MSG_ID_AID_REQ = 0x00, }ublox_ubx_msg_aiding_t; typedef enum { UBLOX_UBX_MSG_ID_CFG_ANT = 0x13, UBLOX_UBX_MSG_ID_CFG_CFG = 0x09, UBLOX_UBX_MSG_ID_CFG_DAT = 0x06, UBLOX_UBX_MSG_ID_CFG_GNSS = 0x3E, UBLOX_UBX_MSG_ID_CFG_INF = 0x02, UBLOX_UBX_MSG_ID_CFG_ITFM = 0x39, UBLOX_UBX_MSG_ID_CFG_LOGFILTER = 0x47, UBLOX_UBX_MSG_ID_CFG_MSG = 0x01, UBLOX_UBX_MSG_ID_CFG_NAV5 = 0x24, UBLOX_UBX_MSG_ID_CFG_NAVX5 = 0x23, UBLOX_UBX_MSG_ID_CFG_NMEA = 0x17, UBLOX_UBX_MSG_ID_CFG_PM2 = 0x3B, UBLOX_UBX_MSG_ID_CFG_PRT = 0x00, UBLOX_UBX_MSG_ID_CFG_RATE = 0x08, UBLOX_UBX_MSG_ID_CFG_RINV = 0x34, UBLOX_UBX_MSG_ID_CFG_RST = 0x04, UBLOX_UBX_MSG_ID_CFG_RXM = 0x11, UBLOX_UBX_MSG_ID_CFG_SBAS = 0x16, UBLOX_UBX_MSG_ID_CFG_TP5 = 0x31, UBLOX_UBX_MSG_ID_CFG_USB = 0x1B, }ublox_ubx_msg_cfg_t; typedef enum { UBLOX_UBX_MSG_ID_INF_DEBUG = 0x04, UBLOX_UBX_MSG_ID_INF_ERROR = 0x00, UBLOX_UBX_MSG_ID_INF_NOTICE = 0x02, UBLOX_UBX_MSG_ID_INF_TEST = 0x03, UBLOX_UBX_MSG_ID_INF_WARNING = 0x01, }ublox_ubx_msg_inf_t; typedef enum { UBLOX_UBX_MSG_ID_LOG_CREATE = 0x07, UBLOX_UBX_MSG_ID_LOG_ERASE = 0x03, UBLOX_UBX_MSG_ID_LOG_FINDTIME = 0x0E, UBLOX_UBX_MSG_ID_LOG_INFO = 0x08, UBLOX_UBX_MSG_ID_LOG_RETRIEVEPOS = 0x0b, UBLOX_UBX_MSG_ID_LOG_RETRIEVESTRING = 0x0d, UBLOX_UBX_MSG_ID_LOG_RETRIEVE = 0x09, UBLOX_UBX_MSG_ID_LOG_STRING = 0x04, }ublox_ubx_msg_log_t; typedef enum { UBLOX_UBX_MSG_ID_MON_HW2 = 0x0B, UBLOX_UBX_MSG_ID_MON_HW = 0x09, UBLOX_UBX_MSG_ID_MON_IO = 0x02, UBLOX_UBX_MSG_ID_MON_MSGPP = 0x06, UBLOX_UBX_MSG_ID_MON_RXBUF = 0x07, UBLOX_UBX_MSG_ID_MON_RXR = 0x21, UBLOX_UBX_MSG_ID_MON_TXBUF = 0x08, UBLOX_UBX_MSG_ID_MON_VER = 0x04, }ublox_ubx_msg_mon_t; typedef enum { UBLOX_UBX_MSG_ID_NAV_AOPSTATUS = 0x60, UBLOX_UBX_MSG_ID_NAV_CLOCK = 0x22, UBLOX_UBX_MSG_ID_NAV_DGPS = 0x31, UBLOX_UBX_MSG_ID_NAV_DOP = 0x04, UBLOX_UBX_MSG_ID_NAV_POSECEF = 0x01, UBLOX_UBX_MSG_ID_NAV_POSLLH = 0x02, UBLOX_UBX_MSG_ID_NAV_PVT = 0x07, UBLOX_UBX_MSG_ID_NAV_SBAS = 0x32, UBLOX_UBX_MSG_ID_NAV_SOL = 0x06, UBLOX_UBX_MSG_ID_NAV_STATUS = 0x03, UBLOX_UBX_MSG_ID_NAV_SVINFO = 0x30, UBLOX_UBX_MSG_ID_NAV_TIMEGPS = 0x20, UBLOX_UBX_MSG_ID_NAV_TIMEUTC = 0x21, UBLOX_UBX_MSG_ID_NAV_VELECEF = 0x11, UBLOX_UBX_MSG_ID_NAV_VELNED = 0x12, }ublox_ubx_msg_nav_t; typedef enum { UBLOX_UBX_MSG_ID_RXM_ALM = 0x30, UBLOX_UBX_MSG_ID_RXM_EPH = 0x31, UBLOX_UBX_MSG_ID_RXM_PMREQ = 0x41, UBLOX_UBX_MSG_ID_RXM_RAW = 0x10, UBLOX_UBX_MSG_ID_RXM_SFRB = 0x11, UBLOX_UBX_MSG_ID_RXM_SVSI = 0x20, }ublox_ubx_msg_rxm_t; typedef enum { UBLOX_UBX_MSG_ID_TIM_TM2 = 0x03, UBLOX_UBX_MSG_ID_TIM_TP = 0x01, UBLOX_UBX_MSG_ID_TIM_VRFY = 0x06, }ublox_ubx_msg_tim_t; typedef enum { UBLOX_UBX_MSG_ID_NMEA_STD_DTM = 0x0A, UBLOX_UBX_MSG_ID_NMEA_STD_GBS = 0x09, UBLOX_UBX_MSG_ID_NMEA_STD_GGA = 0x00, UBLOX_UBX_MSG_ID_NMEA_STD_GLL = 0x01, UBLOX_UBX_MSG_ID_NMEA_STD_GLQ = 0x43, UBLOX_UBX_MSG_ID_NMEA_STD_GNQ = 0x42, UBLOX_UBX_MSG_ID_NMEA_STD_GNS = 0x0D, UBLOX_UBX_MSG_ID_NMEA_STD_GPQ = 0x40, UBLOX_UBX_MSG_ID_NMEA_STD_GRS = 0x06, UBLOX_UBX_MSG_ID_NMEA_STD_GSA = 0x02, UBLOX_UBX_MSG_ID_NMEA_STD_GST = 0x07, UBLOX_UBX_MSG_ID_NMEA_STD_GSV = 0x03, UBLOX_UBX_MSG_ID_NMEA_STD_RMC = 0x04, UBLOX_UBX_MSG_ID_NMEA_STD_TXT = 0x41, UBLOX_UBX_MSG_ID_NMEA_STD_VTG = 0x05, UBLOX_UBX_MSG_ID_NMEA_STD_ZDA = 0x08, }ublox_ubx_msg_nmea_std_t; typedef enum { UBLOX_UBX_MSG_ID_NMEA_PUBX_CONFIG = 0x41, UBLOX_UBX_MSG_ID_NMEA_PUBX_POSITION = 0x00, UBLOX_UBX_MSG_ID_NMEA_PUBX_RATE = 0x40, UBLOX_UBX_MSG_ID_NMEA_PUBX_SVSTATUS = 0x03, UBLOX_UBX_MSG_ID_NMEA_PUBX_TIME = 0x04, }ublox_ubx_msg_nmea_pubx_t; typedef enum { UBLOX_PACKET_FSM_SYNC_CHAR_A, UBLOX_PACKET_FSM_SYNC_CHAR_B, UBLOX_PACKET_FSM_CLASS_ID, UBLOX_PACKET_FSM_MSG_ID, UBLOX_PACKET_FSM_LEN_L, UBLOX_PACKET_FSM_LEN_H, UBLOX_PACKET_FSM_PAYLOAD, UBLOX_PACKET_FSM_CK_A, UBLOX_PACKET_FSM_CK_B, } ublox_packet_fsm_states_t; /***********************************************************************/ /* DATA STRUCTURE DEFINITIONS. */ /***********************************************************************/ typedef struct { u1_t class_id; u1_t msg_id; u2_t len; u1_t * msg_payload; u1_t ck_a; u1_t ck_b; } ublox_packet_t; typedef struct { u1_t gnss_id; u1_t res_trk_ch; u1_t max_trk_ch; u1_t reserved_1; x4_t flags; } cfg_gnss_config_block_t; typedef struct { u1_t protocol_id; u1_t reserved0; u1_t reserved1; x1_t inf_msg_mask[6]; } cfg_inf_information_t; typedef struct { u1_t sv_id; x1_t flags; u2_t age_c; r4_t prc; r4_t prrc; } nav_dgps_data_t; typedef struct { u1_t sv_id; u1_t flags; u1_t udre; u1_t sv_sys; u1_t sv_service; u1_t reserved1; i2_t prc; u2_t reserved2; i2_t ic; } nav_sbas_data_t; typedef struct { u1_t chn; u1_t svid; x1_t flags; x1_t quality; u1_t cno; i1_t elev; i2_t azim; i4_t pr_res; } nav_sv_info_data_t; typedef struct { union{ union { struct{ ublox_ubx_class_id_t class_id : 8; ublox_msg_id_t msg_id : 8; } ack; struct { ublox_ubx_class_id_t class_id : 8; ublox_msg_id_t msg_id : 8; } nack; }ublox_ubx_msg_ack; union { union { struct { /* Empty */ } poll; struct { uint8_t sv_id; } poll_sv; struct { uint32_t sv_id; uint32_t week; struct { uint32_t dwrd[8]; } optional; } in_out; } alm; union { struct { uint8_t id_size; uint8_t type; uint16_t ofs; uint16_t size; uint16_t field_id; uint16_t data_size; uint8_t id1; uint8_t id2; uint32_t id3; } client_req; struct { uint8_t id_size; uint8_t type; uint16_t ofs; uint16_t size; uint16_t field_id; uint16_t data_size; uint8_t id1; uint8_t id2; uint32_t id3; uint8_t data[UBLOX_MSG_AID_ALPSRV_MAX_DATA_SIZE]; } send_to_client; struct { uint8_t id_size; uint8_t type; uint16_t ofs; uint16_t size; uint16_t field_id; uint16_t data[UBLOX_MSG_AID_ALPSRV_MAX_SIZE]; } send_to_server; } alpsrv; union { struct { uint16_t alp_data[UBLOX_MSG_AID_ALP_MAX_SIZE]; } file_data_transfer; struct { uint8_t dummy; } end_of_data; struct { uint8_t ack_nack; } acknowledge; struct { uint32_t pred_tow; uint32_t pred_dur; int32_t age; uint16_t pred_wno; uint16_t alm_wno; uint32_t rederved1; uint8_t svs; uint8_t rederved2; uint16_t rederved3; } poll_status; }alp; union { struct { /* Empty */ }poll; struct { uint8_t sv_id; } poll_for_one_satelite; struct { uint8_t sv_id; uint8_t data[59]; struct { uint8_t optional0[48]; uint8_t optional1[48]; uint8_t optional2[48]; } optional; }data; }aop; union { struct { /* Empty */ } poll; }data; union { struct { /* Empty */ }poll; struct { uint8_t sv_id; } poll_sv; struct { uint32_t sv_id; uint32_t how; struct { uint32_t sf1d[8]; uint32_t sf2d[8]; uint32_t sf3d[8]; } optional; }in_out; }eph; union { struct { uint32_t health; double utc_a0; double utc_a1; int32_t utc_tow; int16_t utc_wnt; int16_t utc_ls; int16_t utc_wnf; int16_t utc_dn; int16_t utc_lsf; int16_t utc_spare; float klob_a0; float klob_a1; float klob_a2; float klob_a3; float klob_b0; float klob_b1; float klob_b2; float klob_b3; uint32_t flags; } poll; }hui; union { struct { /* Empty */ }poll; struct { int32_t ecef_x_or_lat; int32_t ecef_y_or_lon; int32_t ecef_z_or_alt; uint32_t pos_acc; uint16_t tm_cfg; uint16_t wno_or_date; uint32_t tow_or_time; int32_t tow_ns; uint32_t t_acc_ms; uint32_t t_acc_ns; int32_t clk_d_or_freq; uint32_t clk_d_acc_or_freq_acc; uint32_t flags; } pos_time_freq_clock_drift; }ini; union { struct { /* Empty */ }poll; }req; }ublox_ubx_msg_aid; union { union { struct { /* Empty */ } poll; struct { x2_t flags; x2_t pins; } in_out; } ant; union { struct { x4_t clear_mask; x4_t save_mask; x4_t load_mask; struct { x1_t device_mask; } optional; } clear_save_load; } cfg; union { struct { /* Empty */ } poll; struct { r8_t maj_a; r8_t flat; r4_t dx; r4_t dy; r4_t dz; r4_t rot_x; r4_t rot_y; r4_t rot_z; r4_t scale; } set_datum; struct { u2_t datum_num; ch_t datum_name[6]; r8_t maj_a; r8_t flat; r4_t dx; r4_t dy; r4_t dz; r4_t rot_x; r4_t rot_y; r4_t rot_z; r4_t scale; } currently_datum; } dat; union { struct { /* Empty */ } poll; struct { u1_t msg_ver; u1_t num_trk_ch_hw; u1_t num_trk_ch_use; u1_t num_config_blocks; cfg_gnss_config_block_t cfg_blocks[UBLOX_MSG_CFG_GNSS_BLOCKS_MAX_SIZE]; } sys_config; } gnss; union { struct { u1_t protocol_id; } poll_for_one_protocol; struct { cfg_inf_information_t info[UBLOX_MSG_CFG_INFO_BLOCKS_MAX_SIZE]; } info; } inf; union { struct { /* Empty */ } poll; struct { x4_t config; x4_t config2; } jamming_interfernce_cfg; } itfm; union { struct { /* Empty */ } poll; struct { u1_t version; x1_t flags; u2_t min_interval; u2_t time_threshold; u2_t speed_threshold; u2_t position_threshold; } config; } log_filter; union { struct { u1_t msg_class; u1_t msg_id; } poll; struct { u1_t msg_class; u1_t msg_id; u1_t rates[6]; } set_rates; struct { u1_t msg_class; u1_t msg_id; u1_t rate; } set_rate; } msg; union { struct { /* Empty */ } poll; struct { x2_t mask; u1_t dyn_model; u1_t fix_mode; i4_t fixed_alt; u4_t fixed_alt_var; i1_t min_elev; u1_t dr_limit; u2_t p_dop; u2_t t_dop; u2_t p_acc; u2_t t_acc; u1_t static_hold_thresh; u1_t dgps_timeout; u1_t cno_thresh_num_svs; u1_t cno_thresh; u2_t reserved2; u4_t reserved3; u4_t reserved4; } engine_settings; } nav5; union { struct { /* Empty */ } poll; struct { u2_t version; x2_t mask1; u4_t reserved0; u1_t reserved1; u1_t reserved2; u1_t min_svs; u1_t max_svs; u1_t min_cno; u1_t reserved5; u1_t ini_fix_3d; u1_t reserved6; u1_t reserved7; u1_t reserved8; u2_t wkn_rollover; u4_t reserved9; u1_t reserved10; u1_t reserved11; u1_t use_ppp; u1_t aop_cfg; u1_t reserved12; u1_t reserved13; u2_t aop_orb_max_err; u1_t reserved14; u1_t reserved15; u2_t reserved3; u4_t reserved4; } engine_exp_settings; } navx5; union { struct { /* Empty */ } poll; struct { x1_t filter; u1_t nmea_version; u1_t num_sv; x1_t flags; x4_t gnss_to_filter; u1_t sv_numbering; u1_t main_talker_id; u1_t gsv_talker_id; u1_t reserved; } config; } nmea; union { struct { /* Empty */ } poll; struct { u1_t version; u1_t reserved1; u1_t reserved2; u1_t reserved3; x4_t flags; u4_t update_period; u4_t search_period; u4_t grid_offset; u2_t on_time; u2_t min_acq_time; u2_t reserved4; u2_t reserved5; u4_t reserved6; u4_t reserved7; u1_t reserved8; u1_t reserved9; u2_t reserved10; u4_t reserved11; } ext_pow_management_cfg; } pm2; union { struct { /* Empty */ } poll; struct { u1_t port_id; } poll_for_one_port; struct { u1_t port_id; u1_t reserved0; x2_t tx_ready; x4_t mode; u4_t baud_rate; x2_t in_proto_mask; x2_t out_proto_mask; x2_t flags; u2_t reserved5; } config_uart; struct { u1_t port_id; u1_t reserved0; x2_t tx_ready; u4_t reserved2; u4_t reserved3; x2_t in_proto_mask; x2_t out_proto_mask; u2_t reserved4; u2_t reserved5; } config_usb; struct { u1_t port_id; u1_t reserved0; x2_t tx_ready; x4_t mode; u4_t reserved3; x2_t in_proto_mask; x2_t out_proto_mask; x2_t flags; u2_t reserved5; } config_spi; struct { u1_t port_id; u1_t reserved0; x2_t tx_ready; x4_t mode; u4_t reserved3; x2_t in_proto_mask; x2_t out_proto_mask; x2_t flags; u2_t reserved5; } config_ddc; } prt; union { struct { /* Empty */ } poll; struct { u2_t meas_rate; u2_t nav_rate; u2_t time_ref; } setting; } rate; union { struct { /* Empty */ } poll; struct { x1_t flags; u1_t data[UBLOX_MSG_CFG_RINV_MAX_SIZE]; } contents; } rinv; union { struct { x2_t nav_bbr_mask; u1_t reset_mode; u1_t reserved1; } reset; } rst; union { struct { /* Empty */ } poll; struct { u1_t reserved1; u1_t lp_mode; } setting; } rxm; union { struct { /* Empty */ } poll; struct { x1_t mode; x1_t usage; u1_t max_sbas; x1_t scan_mode2; x4_t scan_mode1; } config; } sbas; union { struct { /* Empty */ } poll; struct { u1_t tp_idx; } poll_by_idx; struct { u1_t tp_idx; u1_t reserved0; u2_t reserved1; i2_t ant_cable_delay; i2_t rf_group_delay; u4_t freq_period; u4_t freq_period_lock; u4_t pulse_len_rato; u4_t pulse_len_rato_lock; i4_t user_config_delay; x4_t flags; } time_pulse_parameters; } tp5; union { struct { /* Empty */ } poll; struct { u2_t vendor_id; u2_t product_id; u2_t reserved1; u2_t reserved2; u2_t power_consumption; x2_t flags; ch_t vendor_string[32]; ch_t product_string[32]; ch_t serial_string[32]; } config; } usb; }ublox_ubx_msg_cfg; union { union { struct { u4_t i_tow; u1_t aop_cfg; u1_t status; u1_t reserved0; u1_t reserved1; u4_t avail_gps; u4_t reserved2; u4_t reserved3; } status; } aop_status; union { struct { u4_t i_tow; i4_t clk_b; i4_t clk_d; u4_t t_acc; u4_t f_acc; } clock; } clock; union { struct { u4_t i_tow; i4_t age; i2_t base_id; i2_t base_health; u1_t num_ch; u1_t status; u2_t reserved1; nav_dgps_data_t data[UBLOX_MSG_NAV_DGPS_DATA_MAX_SIZE]; } dgps_data; } dgps; union { struct { u4_t i_tow; u2_t g_dop; u2_t p_dop; u2_t t_dop; u2_t v_dop; u2_t h_dop; u2_t n_dop; u2_t e_dop; } dilution_of_precision; } dop; union { struct { u4_t i_tow; i4_t ecefe_x; i4_t ecefe_y; i4_t ecefe_z; u4_t p_acc; } position_ecefe; } pos_ecefe; union { struct { u4_t i_tow; i4_t lon; i4_t lat; i4_t height; i4_t h_msl; u4_t h_acc; u4_t v_acc; } position_llh; } pos_llh; union { struct { u4_t i_tow; u2_t year; u1_t month; u1_t day; u1_t hour; u1_t min; u1_t sec; x1_t valid; u4_t t_acc; i4_t nano; u1_t fix_type; x1_t flags; u1_t reserved1; u1_t num_sv; i4_t lon; i4_t lat; i4_t height; i4_t h_msl; u4_t h_acc; u4_t v_acc; i4_t vel_n; i4_t vel_e; i4_t vel_d; i4_t g_speed; i4_t heading; u4_t s_acc; u4_t heading_acc; u2_t p_dop; x2_t reserved2; u4_t reserved3; } position_velocity_time; } pos_pvt; union { struct { u4_t i_tow; u1_t geo; u1_t mode; i1_t sys; x1_t service; u1_t cnt; u1_t reserved0[3]; nav_sbas_data_t data[UBLOX_MSG_NAV_SBAS_DATA_MAX_SIZE]; } sbas_status; } sbas; union { struct { u4_t i_tow; i4_t f_tow; i2_t week; u1_t gps_fix; x1_t flags; i4_t ecefe_x; i4_t ecefe_y; i4_t ecefe_z; u4_t p_acc; i4_t ecefe_v_x; i4_t ecefe_v_y; i4_t ecefe_v_z; u4_t s_acc; u2_t p_dop; u1_t reserved1; u1_t num_sv; u4_t reserved2; } sol_info; } sol; union { struct { u4_t i_tow; u1_t gps_fix; x1_t flags; x1_t fix_stat; x1_t flags2; u4_t ttff; u4_t msss; } status; } status; union { struct { u4_t i_tow; u1_t num_ch; x1_t global_flags; u2_t reserved2; nav_sv_info_data_t data[UBLOX_MSG_NAV_SVINFO_DATA_MAX_SIZE]; } sv_info; } sv_info; union { struct { u4_t i_tow; i4_t f_tow; i2_t week; i1_t leap_s; x1_t valid; u4_t t_acc; } gps_time; } time_gps; union { struct { u4_t i_tow; u4_t t_acc; i4_t nano; u2_t year; u1_t month; u1_t day; u1_t hour; u1_t min; u1_t sec; x1_t valid; } gps_time; } time_utc; union { struct { u4_t i_tow; i4_t ecefe_vx; i4_t ecefe_vy; i4_t ecefe_vz; u4_t s_acc; } vel_ecefe; } vel_ecefe; union { struct { u4_t i_tow; i4_t vel_n; i4_t vel_e; i4_t vel_d; u4_t speed; u4_t g_speed; i4_t heading; u4_t s_acc; u4_t c_acc; } vel_ned; } vel_ned; }ublox_ubx_msg_nav; union { union { struct { i1_t ofs_i; u1_t mag_i; i1_t ofs_q; u1_t mag_q; u1_t cfg_source; u1_t reserved0[3]; u4_t low_lev_cfg; u4_t reserved1[2]; u4_t post_status; u4_t reserved2; } hw2; } hw2; union { struct { x4_t pin_sel; x4_t pin_bank; x4_t pin_dir; x4_t pin_val; u2_t noise_per_ms; u2_t agc_cnt; u1_t a_status; u1_t a_power; x1_t flags; u1_t reserved1; x4_t used_mask; u1_t vp[17]; u1_t jam_ind; u2_t reserved3; x4_t pin_irq; x4_t pull_h; x4_t pull_l; } hw; } hw; union { struct { u4_t rx_bytes; u4_t tx_bytes; u2_t parity_errs; u2_t framing_errs; u2_t overrun_errs; u2_t break_cond; u1_t rx_busy; u1_t tx_busy; u2_t reserved1; } io; } io; union { struct { u2_t msg1[8]; u2_t msg2[8]; u2_t msg3[8]; u2_t msg4[8]; u2_t msg5[8]; u2_t msg6[8]; u4_t skipped[6]; } msgpp; } msgpp; union { struct { u2_t pending[6]; u1_t usage[6]; u1_t peak_usage[6]; } rxbuff; } rxbuff; union { struct { x1_t flags; } rxr; } rxr; union { struct { u2_t pending[6]; u1_t usage[6]; u1_t peak_usage[6]; u1_t t_usage; u1_t t_peak_usage; x1_t errors; u1_t reserved1; } txbuff; } txbuff; union { struct{ /* Empty */ }poll; struct { ch_t sw_version[30]; ch_t hw_version[10]; ch_t extention[30 * 4]; } receive; } version; }ublox_ubx_msg_mon; }ublox_ubx_msgs; }ublox_ubx_msg_t; typedef struct { ublox_uart_send_cb_t ublox_uart_send; ublox_uart_update_params_cb_t ublox_uart_update_params; ublox_malloc_cb_t ublox_malloc; ublox_free_cb_t ublox_free; ublox_msg_received_cb ublox_msg_received; }ublox_platform_fns_t; typedef struct { ublox_packet_t * ublox_rx_packet; ublox_packet_fsm_states_t ublox_current_state; u2_t ublox_rx_packet_payload_cnt; u2_t ublox_remained_bytes_number; ublox_platform_fns_t ublox_platform_fns; }ublox_ins_t; /***********************************************************************/ /* FUNCTION PROTOTYPES . */ /***********************************************************************/ void ublox_set_periodic_message_status(ublox_instance ublox, ublox_ubx_class_id_t class_id,ublox_msg_id_t msg_id,ublox_periodic_msg_status_t status); void ublox_send(ublox_instance ublox, ublox_ubx_class_id_t class_id,ublox_msg_id_t msg_id,ublox_ubx_msg_t* msg,u2_t msg_len); void ublox_destroy(ublox_instance ublox); ublox_instance ublox_create(ublox_platform_fns_t *ublox_platform_fns); void ublox_set_spi_params(ublox_instance ublox, ublox_spi_mode_t spi_mode,ublox_spi_flow_control_t flow_control,u1_t ff_cnt); void ublox_set_uart_params(ublox_instance ublox, ublox_uart_baudrate_t baudrate,ublox_uart_char_len_t char_len,ublox_uart_parity_t parity,ublox_uart_n_stop_bits_t n_stop_bits); void ublox_set_periodic_interval(ublox_instance ublox, u2_t measurement_rate_ms,ublox_periodic_rate_time_ref_t time_ref); void ublox_poll_req(ublox_instance ublox, ublox_ubx_class_id_t class_id,ublox_msg_id_t msg_id); void ublox_data_on_recv(ublox_instance ublox, const uint8_t * data, size_t length); #ifdef __cplusplus } #endif #endif /* UBLOX_INC_UBLOX_H_ */
Reuse of Modernist Buildings In his keynote lecture When the oppressive new and the vulnerable old meet, at the 13th docomomo Conference in Seoul 2014, Hubert-Jan Henket made a passionate plea for Sustainable Modernity. In docomomo Journal 52, an invitation to join this plea was published. Hubert-Jan Henket also spoke of a wish to change the curricula at all schools of architecture and include the history of modernity as well as the conservation and adaptive reuse of what is there already as a standard part of the education. Since then, and even before 2014, a lot has happened in exploring the further potential of reusing Modern Movement Architecture. In 2016 the project RMB Reuse of Modernist Buildings started. For the RMB project docomomo International and the University of Antwerp, Belgium; the University of Coimbra and the Instituto Superior Tcnico University of Lisboa, both from Portugal; Istanbul Technical University, from Turkey and TH-OWL, Detmold School of Architecture and Interior Architecture from Detmold, Germany, came together to prepare a master course, addressing the subjects as formulated in 2014 by Hubert Jan Henket and docomomo.
Updated, 4:58 p.m. | OAKLAND, Calif. — A class-action lawsuit against Apple that has been nearly a decade in the making could hinge on a single iPod purchased by a New Jersey woman in 2008. In a surprising turn on Friday, the lawyers suing Apple in the $350 million case withdrew one of the named plaintiffs after they concluded that she did not purchase an iPod between September 2006 and March 2009, the period in which Apple is accused of preventing music from competing services from playing on its iPods. That leaves one named plaintiff. And Apple said in a letter filed with the court late Wednesday night that it checked the serial number of an iPod Touch bought by that woman, Marianna Rosen, and found that it was bought in July 2009, months after the period in question. The company on Friday filed a motion asking that the case be dismissed altogether on the grounds that the iPods purchased by the two plaintiffs were not bought during that time period. “Ms. Rosen’s trial testimony with regard to her alleged purchase of the two iPods in 2007 and 2008 was not credible,” Apple said in its filing. Apple also attached a receipt showing that the iPod Touch was purchased by Ms. Rosen’s husband’s law firm, not the plaintiff herself. Outsiders may be providing a solution. on Friday afternoon, a Michigan man named Jeffrey Kowalski contacted the judge. He said he bought an iPod Touch around May 2008. Bonny Sweeney, the plaintiffs’ lead attorney, told Yvonne Gonzalez Rogers, the federal judge overseeing the case, that there was another iPod Touch that Ms. Rosen bought in 2008. She said she would fully respond to Apple’s letter on Saturday. The judge has not yet ruled on Apple’s motion. The trial proceeded Friday morning with testimony by Jeff Robbin, the head of Apple’s iTunes software. A videotaped deposition of Steve Jobs, who died in 2011, was expected to be shown later on Friday. An earlier version of this post misstated the home state of a man potentially involved in the iPod case. He lives in Michigan, not Minnesota. Also, the post misstated how the man could be involved. He contacted the judge overseeing the case; he has not yet been included in the lawsuit. A version of this article appears in print on 12/06/2014, on page B3 of the NewYork edition with the headline: Dead Apple Chief Testifies on Videotape in Antitrust Case.
import {NativePath, PortablePath, Filename, toFilename, npath, ppath, xfs} from '@yarnpkg/fslib'; import {PnpApi, PackageLocator, PackageInformation} from '@yarnpkg/pnp'; import {hoist, ReadonlyHoisterPackageTree, HoisterPackageId, HoisterPackageInfo, ReadonlyHoisterDependencies} from './hoist'; import {HoistedTree, HoisterPackageTree} from './hoist'; // Babel doesn't support const enums, thats why we use non-const enum for LinkType in @yarnpkg/pnp // But because of this TypeScript requires @yarnpkg/pnp during runtime // To prevent this we redeclare LinkType enum here, to not depend on @yarnpkg/pnp during runtime export enum LinkType {HARD = 'HARD', SOFT = 'SOFT'}; /** * Node modules tree - a map of every folder within the node_modules, along with their * directory listing and whether they are a symlink and their location. * * Sample contents: * /home/user/project/node_modules -> {dirList: ['foo', 'bar']} * /home/user/project/node_modules/foo -> {target: '/home/user/project/.yarn/.cache/foo.zip/node_modules/foo', linkType: 'HARD'} * /home/user/project/node_modules/bar -> {target: '/home/user/project/packages/bar', linkType: 'SOFT'} */ export type NodeModulesTree = Map<PortablePath, {dirList: Set<Filename>} | {dirList?: undefined, target: PortablePath, linkType: LinkType}>; export interface NodeModulesTreeOptions { optimizeSizeOnDisk?: boolean; pnpifyFs?: boolean; } /** node_modules path segment */ const NODE_MODULES = toFilename(`node_modules`); /** Package locator key for usage inside maps */ type LocatorKey = string; /** * Returns path to archive, if package location is inside the archive. * * @param packagePath package location * * @returns path to archive is location is insde the archive or null otherwise */ const getArchivePath = (packagePath: PortablePath): PortablePath | null => packagePath.indexOf(`.zip/${NODE_MODULES}/`) >= 0 ? npath.toPortablePath(packagePath.split(`/${NODE_MODULES}/`)[0]) : null; /** * Determines package's weight relative to other packages for hoisting purposes. * If optimizeSizeOnDisk is `true`, we use archive size in bytes as a weight, * otherwise weight 1 is assigned to each package. * * @param packagePath package path * @param optimizeSizeOnDisk whether size on disk should be optimized during hoisting */ const getPackageWeight = (packagePath: PortablePath, {optimizeSizeOnDisk}: NodeModulesTreeOptions) => { if (!optimizeSizeOnDisk) return 1; const archivePath = getArchivePath(packagePath); if (archivePath === null) return 1; return xfs.statSync(archivePath).size; }; /** * Retrieve full package list and build hoisted `node_modules` directories * representation in-memory. * * @param pnp PnP API * * @returns hoisted `node_modules` directories representation in-memory */ export const buildNodeModulesTree = (pnp: PnpApi, options: NodeModulesTreeOptions): NodeModulesTree => { const {packageTree, packages, locators} = buildPackageTree(pnp, options); const hoistedTree = hoist(packageTree, packages); return populateNodeModulesTree(pnp, hoistedTree, locators, options); }; /** * Traverses PnP tree and produces input for the `RawHoister` * * @param pnp PnP API * * @returns package tree, packages info and locators */ const buildPackageTree = (pnp: PnpApi, options: NodeModulesTreeOptions): { packageTree: ReadonlyHoisterPackageTree, packages: HoisterPackageInfo[], locators: PackageLocator[] } => { const packageTree: HoisterPackageTree = []; const packages: HoisterPackageInfo[] = []; const locators: PackageLocator[] = []; const locatorToPackageMap = new Map<LocatorKey, HoisterPackageId>(); const packageInfos: PackageInformation<NativePath>[] = []; const pnpRoots = pnp.getDependencyTreeRoots(); let lastPkgId = 0; const getLocatorKey = (locator: PackageLocator): LocatorKey => `${locator.name}:${locator.reference}`; const assignPackageId = (locator: PackageLocator, pkg: PackageInformation<NativePath>) => { const locatorKey = getLocatorKey(locator); const pkgId = locatorToPackageMap.get(locatorKey); if (typeof pkgId !== 'undefined') return pkgId; const newPkgId = lastPkgId++; const packagePath = npath.toPortablePath(pkg.packageLocation); const weight = getPackageWeight(packagePath, options); locatorToPackageMap.set(locatorKey, newPkgId); locators.push(locator); packages.push({name: locator.name!, weight}); packageInfos.push(pkg); return newPkgId; }; const addedIds = new Set<HoisterPackageId>(); const addPackageToTree = (pkg: PackageInformation<NativePath>, pkgId: HoisterPackageId, parentDepIds: Set<HoisterPackageId>) => { if (addedIds.has(pkgId)) return; addedIds.add(pkgId); const deps = new Set<HoisterPackageId>(); const peerDeps = new Set<HoisterPackageId>(); packageTree[pkgId] = {deps, peerDeps}; for (const [name, referencish] of pkg.packageDependencies) { if (referencish !== null) { const locator = pnp.getLocator(name, referencish); const depPkg = pnp.getPackageInformation(locator)!; const depPkgId = assignPackageId(locator, depPkg); if (pkg.packagePeers.has(name)) { peerDeps.add(depPkgId); } else { deps.add(depPkgId); } } } const allDepIds = new Set([...deps, ...peerDeps]); for (const depId of allDepIds) { const depPkg = packageInfos[depId]; addPackageToTree(depPkg, depId, allDepIds); } }; const pkg = pnp.getPackageInformation(pnp.topLevel)!; const topLocator = pnp.findPackageLocator(pkg.packageLocation)!; const topLocatorKey = getLocatorKey(topLocator); for (const locator of pnpRoots) { if (getLocatorKey(locator) !== topLocatorKey) { pkg.packageDependencies.set(locator.name!, locator.reference); } } const pkgId = assignPackageId(topLocator, pkg); addPackageToTree(pkg, pkgId, new Set<number>()); return {packageTree, packages, locators}; }; /** * Converts hoisted tree to node modules map * * @param pnp PnP API * @param hoistedTree hoisted package tree from `RawHoister` * @param locators locators * * @returns node modules map */ const populateNodeModulesTree = (pnp: PnpApi, hoistedTree: HoistedTree, locators: PackageLocator[], options: NodeModulesTreeOptions): NodeModulesTree => { const tree: NodeModulesTree = new Map(); const makeLeafNode = (locator: PackageLocator): {target: PortablePath, linkType: LinkType} => { const info = pnp.getPackageInformation(locator)!; if (options.pnpifyFs) { return {target: npath.toPortablePath(info.packageLocation), linkType: LinkType.SOFT}; } else { const truePath = pnp.resolveVirtual && locator.reference && locator.reference.startsWith('virtual:') ? pnp.resolveVirtual(info.packageLocation) : info.packageLocation; return {target: npath.toPortablePath(truePath || info.packageLocation), linkType: info.linkType}; } }; const getPackageName = (locator: PackageLocator): { name: Filename, scope: Filename | null } => { const [nameOrScope, name] = locator.name!.split('/'); return name ? {scope: toFilename(nameOrScope), name: toFilename(name)} : {scope: null, name: toFilename(nameOrScope)}; }; const seenPkgIds = new Set(); const buildTree = (nodeId: HoisterPackageId, locationPrefix: PortablePath) => { if (seenPkgIds.has(nodeId)) return; seenPkgIds.add(nodeId); for (const depId of hoistedTree[nodeId]) { const locator = locators[depId]; const {name, scope} = getPackageName(locator); const packageNameParts = scope ? [scope, name] : [name]; const nodeModulesDirPath = ppath.join(locationPrefix, NODE_MODULES); const nodeModulesLocation = ppath.join(nodeModulesDirPath, ...packageNameParts); const leafNode = makeLeafNode(locator); tree.set(nodeModulesLocation, leafNode); const segments = nodeModulesLocation.split('/'); const nodeModulesIdx = segments.indexOf(NODE_MODULES); let segCount = segments.length - 1; while (nodeModulesIdx >= 0 && segCount > nodeModulesIdx) { const dirPath = npath.toPortablePath(segments.slice(0, segCount).join(ppath.sep)); const targetDir = toFilename(segments[segCount]); const subdirs = tree.get(dirPath); if (!subdirs) { tree.set(dirPath, {dirList: new Set([targetDir])}); } else if (subdirs.dirList) { if (subdirs.dirList.has(targetDir)) { break; } else { subdirs.dirList.add(targetDir); } } segCount--; } // In case of pnpifyFs we represent modules as symlinks to archives in NodeModulesFS // `/home/user/project/foo` is a symlink to `/home/user/project/.yarn/.cache/foo.zip/node_modules/foo` // To make this fs layout work with legacy tools we make // `/home/user/project/.yarn/.cache/foo.zip/node_modules/foo/node_modules` (which normally does not exist inside archive) a symlink to: // `/home/user/project/node_modules/foo/node_modules`, so that the tools were able to access it buildTree(depId, options.pnpifyFs ? leafNode.target: nodeModulesLocation); } }; const rootNode = makeLeafNode(locators[0]); const rootPath = rootNode.target && rootNode.target; buildTree(0, rootPath); return tree; }; /** * Benchmarks raw hoisting performance. * * The function is used for troubleshooting purposes only. * * @param packageTree package tree * @param packages package info * * @returns average raw hoisting time */ // eslint-disable-next-line @typescript-eslint/no-unused-vars const benchmarkRawHoisting = (packageTree: ReadonlyHoisterPackageTree, packages: HoisterPackageInfo[]) => { const iterCount = 100; const startTime = Date.now(); for (let iter = 0; iter < iterCount; iter++) hoist(packageTree, packages); const endTime = Date.now(); return (endTime - startTime) / iterCount; }; /** * Benchmarks node_modules tree building. * * The function is used for troubleshooting purposes only. * * @param packageTree package tree * @param packages package info * * @returns average raw hoisting time */ // eslint-disable-next-line @typescript-eslint/no-unused-vars const benchmarkBuildTree = (pnp: PnpApi, options: NodeModulesTreeOptions): number => { const iterCount = 100; const startTime = Date.now(); for (let iter = 0; iter < iterCount; iter++) { const {packageTree, packages, locators} = buildPackageTree(pnp, options); const hoistedTree = hoist(packageTree, packages); populateNodeModulesTree(pnp, hoistedTree, locators, options); } const endTime = Date.now(); return (endTime - startTime) / iterCount; }; /** * Pretty-prints node_modules tree. * * The function is used for troubleshooting purposes only. * * @param tree node_modules tree * @param rootPath top-level project root folder * * @returns sorted node_modules tree */ // eslint-disable-next-line @typescript-eslint/no-unused-vars const dumpNodeModulesTree = (tree: NodeModulesTree, rootPath: PortablePath): string => { const sortedTree: NodeModulesTree = new Map(); const keys = Array.from(tree.keys()).sort(); for (const key of keys) { const val = tree.get(key)!; sortedTree.set(key, val.dirList ? {dirList: new Set(Array.from(val.dirList).sort())} : val); } const seenPaths = new Set(); const dumpTree = (nodePath: PortablePath, prefix: string = '', dirPrefix = ''): string => { const node = sortedTree.get(nodePath); if (!node) return ''; seenPaths.add(nodePath); let str = ''; if (node.dirList) { const dirs = Array.from(node.dirList); for (let idx = 0; idx < dirs.length; idx++) { const dir = dirs[idx]; str += `${prefix}${idx < dirs.length - 1 ? '├─' : '└─'}${dirPrefix}${dir}\n`; str += dumpTree(ppath.join(nodePath, dir), `${prefix}${idx < dirs.length - 1 ?'│ ' : ' '}`); } } else { const {target, linkType} = node; str += dumpTree(ppath.join(nodePath, NODE_MODULES), `${prefix}│ `, `${NODE_MODULES}/`); str += `${prefix}└─${linkType === LinkType.SOFT ? 's>' : '>'}${target}\n`; } return str; }; let str = dumpTree(ppath.join(rootPath, NODE_MODULES)); for (const key of sortedTree.keys()) { if (!seenPaths.has(key)) { str += `${key.replace(rootPath, '')}\n${dumpTree(key)}`; } } return str; }; /** * Pretty-prints dependency tree in the `yarn why`-like format * * The function is used for troubleshooting purposes only. * * @param tree node_modules tree * * @returns sorted node_modules tree */ // eslint-disable-next-line @typescript-eslint/no-unused-vars const dumpDepTree = (tree: ReadonlyHoisterPackageTree | HoistedTree, locators: PackageLocator[], nodeId: number = 0, prefix = '', seenIds = new Set()) => { if (seenIds.has(nodeId)) return ''; seenIds.add(nodeId); const dumpLocator = (locator: PackageLocator): string => { if (locator.reference === 'workspace:.') { return '.'; } else if (!locator.reference) { return `${locator.name!}@${locator.reference}`; } else { const version = (locator.reference.indexOf('#') > 0 ? locator.reference.split('#')[1] : locator.reference).replace('npm:', ''); if (locator.reference.startsWith('virtual')) { return `v:${locator.name!}@${version}`; } else { return `${locator.name!}@${version}`; } } }; const deps: number[] = Array.from(((tree[nodeId] as ReadonlyHoisterDependencies).deps || tree[nodeId])); const traverseIds = new Set(); for (const depId of deps) { if (!seenIds.has(depId)) { traverseIds.add(depId); seenIds.add(depId); } } let str = ''; for (let idx = 0; idx < deps.length; idx++) { const depId = deps[idx]; str += `${prefix}${idx < deps.length - 1 ? '├─' : '└─'}${(traverseIds.has(depId) ? '>' : '') + dumpLocator(locators[depId])}\n`; if (traverseIds.has(depId)) { seenIds.delete(depId); str += dumpDepTree(tree, locators, depId, `${prefix}${idx < deps.length - 1 ?'│ ' : ' '}`, seenIds); seenIds.add(depId); } } for (const depId of traverseIds) seenIds.delete(depId); return str; };
<reponame>JaneliaSciComp/osgpyplusplus // This file has been generated by Py++. #ifndef FirstPersonManipulator_hpp__pyplusplus_wrapper #define FirstPersonManipulator_hpp__pyplusplus_wrapper void register_FirstPersonManipulator_class(); #endif//FirstPersonManipulator_hpp__pyplusplus_wrapper
<reponame>WenmuZhou/DABNet_Paddle<filename>utils/loss.py import paddle import paddle.nn as nn import paddle.nn.functional as F class CrossEntropyLoss2d(nn.Layer): ''' This file defines a cross entropy loss for 2D images ''' def __init__(self, weight=None, ignore_label=255): ''' :param weight: 1D weight vector to deal with the class-imbalance Obtaining log-probabilities in a neural network is easily achieved by adding a LogSoftmax layer in the last layer of your network. You may use CrossEntropyLoss instead, if you prefer not to add an extra layer. ''' super().__init__() # self.loss = nn.NLLLoss2d(weight, ignore_index=255) self.loss = nn.NLLLoss(weight, ignore_index=ignore_label) def forward(self, outputs, targets): return self.loss(F.log_softmax(outputs, 1).transpose([0, 2, 3, 1]), targets.astype('int')) class FocalLoss2d(nn.Layer): def __init__(self, alpha=0.5, gamma=2, weight=None, ignore_index=255): super().__init__() self.alpha = alpha self.gamma = gamma self.weight = weight self.ignore_index = ignore_index self.ce_fn = nn.CrossEntropyLoss(weight=self.weight, ignore_index=self.ignore_index) def forward(self, preds, labels): logpt = -self.ce_fn(preds.transpose([0, 2, 3, 1]), labels.astype('int')) pt = paddle.exp(logpt) loss = -((1 - pt) ** self.gamma) * self.alpha * logpt return loss class ProbOhemCrossEntropy2d(nn.Layer): def __init__(self, ignore_label, reduction='mean', thresh=0.6, min_kept=256, down_ratio=1, use_weight=False): super(ProbOhemCrossEntropy2d, self).__init__() self.ignore_label = ignore_label self.thresh = float(thresh) self.min_kept = int(min_kept) self.down_ratio = down_ratio if use_weight: weight = paddle.to_tensor( [0.8373, 0.918, 0.866, 1.0345, 1.0166, 0.9969, 0.9754, 1.0489, 0.8786, 1.0023, 0.9539, 0.9843, 1.1116, 0.9037, 1.0865, 1.0955, 1.0865, 1.1529, 1.0507], dtype='float32') self.criterion = nn.CrossEntropyLoss(reduction=reduction, weight=weight, ignore_index=ignore_label) else: self.criterion = nn.CrossEntropyLoss(reduction=reduction, ignore_index=ignore_label) def forward(self, pred, target): b, c, h, w = pred.shape target = target.reshape([-1]) valid_mask = target != self.ignore_label target = target * valid_mask num_valid = valid_mask.astype('int').sum() prob = F.softmax(pred, axis=1) prob.stop_gradient = True prob = (prob.transpose([1, 0, 2, 3])).reshape([c, -1]) if num_valid < self.min_kept: pass elif num_valid > 0: prob[:, valid_mask == 0] = 1 mask_prob = prob[ target.astype('int'), paddle.arange(len(target), dtype='int')] threshold = self.thresh if self.min_kept > 0: index = mask_prob.argsort() threshold_index = index[min(len(index), self.min_kept) - 1] if mask_prob[threshold_index] > self.thresh: threshold = mask_prob[threshold_index] kept_mask = mask_prob <= threshold target = target * kept_mask valid_mask = valid_mask * kept_mask target[valid_mask == 0] = self.ignore_label target = target.reshape([b, h, w]) return self.criterion(pred.transpose([0, 2, 3, 1]), target.astype('int'))
""" The DockerStatsCollector collects stats from the docker daemon about currently running containers. """ import diamond.collector import psutil import os from diamond.utils.signals import SIGALRMException # Allows us to mount the host /proc in the container at PROCFS_PATH and # get information from the host psutil.PROCFS_PATH = os.getenv("PROCFS_PATH", psutil.PROCFS_PATH) try: import docker except ImportError: docker = None def env_list_to_dict(env_list): env_dict = {} for pair in env_list: tokens = pair.split("=",1) env_dict[tokens[0]] = tokens[1] return env_dict def sanitize_delim(name, delim): return ".".join(name.strip(delim).split(delim)) def getChildrenPIDs(pid): parent = psutil.Process(pid) return parent.children(recursive=True) class DockerStatsCollector(diamond.collector.Collector): def get_default_config_help(self): config_help = super(DockerStatsCollector, self).get_default_config_help() config_help.update({ 'client_url': 'The url to connect to the docker daemon', 'name_from_env': 'If specified, use the named environment variable to populate container name', 'sanitize_slashes': 'Replace slashes in container name with \".\"\'s, defaults to True', 'ecs_mode': 'Enables pulling container name and env from \'tag\' docker label, and using task ARN instead of container id, defaults to False', }) return config_help def get_default_config(self): """ Returns the default collector settings """ config = super(DockerStatsCollector, self).get_default_config() config.update({ 'client_url': 'unix://var/run/docker.sock', 'name_from_env': None, 'path': 'docker', 'sanitize_slashes': True, 'ecs_mode': False, }) return config def collect(self): """ Collect docker stats """ # Require docker client lib to get stats if docker is None: self.log.error('Unable to import docker') return None try: client = docker.Client(base_url=self.config['client_url'], version='auto') container_ids = [container['Id'] for container in client.containers()] for container_id in container_ids: container = client.inspect_container(container_id) name = container['Name'] idlabel = container_id[:12] if self.config['name_from_env']: # Grab name from environment variable if configured env_dict = env_list_to_dict(container['Config']['Env']) name = env_dict.get(self.config['name_from_env'], name) if self.config['sanitize_slashes']: name = sanitize_delim(name, "/") if self.config['ecs_mode']: labels = container['Config']['Labels'] tag = labels.get('tag', '') arn = labels.get('com.amazonaws.ecs.task-arn', '') if arn and tag: # only grab the first part of the task UUID parts = arn.split("/") idlabel = parts[1][:8] name = sanitize_delim(tag, "--") metrics_prefix = '.'.join([name, idlabel, "docker"]) stats = client.stats(container_id, True, stream=False) # CPU Stats for ix, cpu_time in enumerate(stats['cpu_stats']['cpu_usage']['percpu_usage']): metric_name = '.'.join([metrics_prefix, 'cpu' + str(ix), 'user']) self.publish(metric_name, int(self.derivative(metric_name, cpu_time / 10000000.0, diamond.collector.MAX_COUNTER))) # Total CPU metric_name = '.'.join([metrics_prefix, 'cpu_total', 'user']) self.publish(metric_name, int(self.derivative(metric_name, stats['cpu_stats']['cpu_usage']['total_usage'] / 10000000.0, diamond.collector.MAX_COUNTER))) # Memory Stats metric_name = '.'.join([metrics_prefix, 'mem', 'rss']) self.publish(metric_name, stats['memory_stats']['stats']['total_rss']) metric_name = '.'.join([metrics_prefix, 'mem', 'limit']) self.publish(metric_name, stats['memory_stats']['limit']) # Network Stats networks = stats.get('networks', {}) if not networks: single_network = stats.get('network', {}) if single_network: networks = {'eth0': stats['network']} for network_name, network in networks.iteritems(): for stat in [u'rx_bytes', u'tx_bytes']: self.publish('.'.join([metrics_prefix, 'net', network_name, stat]), network[stat]) # Open sockets cPIDs = getChildrenPIDs(container["State"]["Pid"]) s = 0 for pid in cPIDs: fd_dir = "{}/{}/fd".format(psutil.PROCFS_PATH, pid.pid) for fd in os.listdir(fd_dir): # fd can be closed between listdir and readlink try: if "socket" in os.readlink("{}/{}".format(fd_dir, fd)): s += 1 except OSError as e: continue self.publish('.'.join([metrics_prefix, 'open_sockets']), s) return True except SIGALRMException as e: # sigalrm is raised if the collector takes too long raise e except Exception as e: self.log.error("Couldn't collect from docker: %s", e) return None
Pat Bradley (golfer) Early life and family Born in Westford, Massachusetts, Bradley was the only daughter among six children of Richard and Kay Bradley. Her father was an avid golfer, and her brothers include Mark, a PGA club professional in Jackson Hole, Wyoming, whose son Keegan Bradley won the PGA Championship in 2011. The Bradleys were named "Golf Family of the Year" in 1989 by the National Golf Foundation. Amateur career Bradley won the New Hampshire Amateur in 1967 and 1969 and the New England Amateur from 1972-73. As a member of the Florida International University golf team, she was named an All-American in 1970. Bradley tied for 12th as an amateur at the 1973 Burdine's Invitational on the LPGA Tour. Professional career Bradley joined the LPGA Tour in 1974 and got her first win at the Girl Talk Classic in 1976 (she also finished second six times that year). Her breakout year was 1978, when she won three times. Bradley's most fertile years came in the early to mid-1980s. She led the LPGA in wins in 1983 (4) and 1986 (5). Her first major came at the 1980 Peter Jackson Classic, then she added the 1981 U.S. Women's Open and the du Maurier Classic in 1985. In 1986, she won three of the four LPGA majors - the du Maurier Classic, Nabisco Dinah Shore, and LPGA Championship. She finished fifth in the U.S. Women's Open, three strokes back, to narrowly miss the grand slam. Bradley won the money title and Vare Trophy that year, as well. In 1988, she was diagnosed with Graves' disease, and she played 17 tournaments, but made the cut in only eight. But she returned to form in 1989, winning once. Three more wins followed in 1990. Bradley won four times in 1991 and captured her second money and scoring titles, and also was named LPGA Tour Player of the Year for a second time. She was also inducted into the World Golf Hall of Fame. A New York Times survey of other LPGA Tour players published July 22, 1992 ranked Bradley as the tour's best long putter and best course manager as well as the best player on tour. The last of her LPGA victories came in 1995. Sports psychologist Bob Rotella wrote in his 1996 book, Golf Is a Game of Confidence, that Bradley was the most mentally tough athlete he knew. She won a total of 31 tournaments on the LPGA Tour. She was the third woman, behind Mickey Wright and Louise Suggs, to have completed the LPGA "Career Grand Slam". Bradley played on three U.S. Solheim Cup teams (1990, 1992, 1996) and captained the team in 2000. Bradley was inducted into the New Hampshire Golf Hall of Fame in 2018.
package sysinfo // import "github.com/docker/docker/pkg/sysinfo" import ( "unsafe" "golang.org/x/sys/windows" ) var ( kernel32 = windows.NewLazySystemDLL("kernel32.dll") getCurrentProcess = kernel32.NewProc("GetCurrentProcess") getProcessAffinityMask = kernel32.NewProc("GetProcessAffinityMask") ) // Returns bit count of 1, used by NumCPU func popcnt(x uint64) (n byte) { x -= (x >> 1) & 0x5555555555555555 x = (x>>2)&0x3333333333333333 + x&0x3333333333333333 x += x >> 4 x &= 0x0f0f0f0f0f0f0f0f x *= 0x0101010101010101 return byte(x >> 56) } func numCPU() int { // Gets the affinity mask for a process var mask, sysmask uintptr currentProcess, _, _ := getCurrentProcess.Call() ret, _, _ := getProcessAffinityMask.Call(currentProcess, uintptr(unsafe.Pointer(&mask)), uintptr(unsafe.Pointer(&sysmask))) if ret == 0 { return 0 } // For every available thread a bit is set in the mask. ncpu := int(popcnt(uint64(mask))) return ncpu }
Facebook relationship statuses completely revolutionized the art of "figuring out whether that person you want to bang is single." It made it as easy as a search. But some sneaky people leave that drop-down menu empty, or protect that info from non-friends. Fortunately, Facebook is testing a button that lets you harass them about it. The button takes the form of a little box that says "Ask" right next to another user's Relationship Status bar in the About box on their homepage, so long as their Relationship Status is unset, or has privacy settings that keep you from seeing it. It seems like it's only in testing for now, but we've found that it's pretty widely available.
World Cup villain and notorious biter Luis Suarez will not go dental gentle into that good night after receiving a four-month ban from FIFA. Uruguay is appealing Suarez's suspension on the grounds that he totally didn't mean to bite Italian defender Giorgio Chiellini. "In no way it happened how you have described, as a bite or intent to bite. After the impact ... I lost my balance, making my body unstable and falling on top of my opponent. At that moment I hit my face against the player leaving a small bruise on my cheek and a strong pain in my teeth." The FIFA committee didn't initially bite on Suarez's first defense and banned him for nine games, four months, and fined him about $100,000. It was the longest ban in 20 years. Uruguay's national federation notified FIFA late Friday that they will appeal the ban. The team will face Colombia later today in the first set of the World Cup's knockout round matches.
// Construct from iterator. impl<K, V, const N: usize> FromIterator<(K, V)> for SgTree<K, V, N> where K: Ord + Default, V: Default, { fn from_iter<I: IntoIterator<Item = (K, V)>>(iter: I) -> Self { let mut sgt = SgTree::new(); for (k, v) in iter { sgt.try_insert(k, v) .expect("Stack-storage capacity exceeded!"); } sgt } }
COLUMBIA, S.C. (AP) — Authorities say four children in a preschool have been taken to the hospital after a car crashed into the building in a Columbia suburb, ending up entirely inside a childcare room. Columbia police said on Twitter that none of the four children appeared to be seriously injured in the Friday afternoon crash at Cadence Academy Preschool in Irmo. Police posted photos of a Lexus past a shattered brick wall beside a row of baby cribs. Authorities say other children were in the preschool and were moved to a safe place until they could be taken home. Police say the woman driving the car is being interviewed by officers. No charges have been filed.
<gh_stars>1-10 // // SWPhotoTableCell.h // LocalView // // Created by <NAME> on 8/7/15. // Copyright (c) 2015 sparkwing. All rights reserved. // #import <UIKit/UIKit.h> @interface SWPhotoTableCell : UITableViewCell @property (nonatomic, weak) IBOutlet UIImageView *photoPreview; @property (nonatomic, weak) IBOutlet UILabel *photoTitleLabel; @end
<reponame>skoulouzis/lobcder package com.ettrema.http.caldav; import com.bradmcevoy.http.DateUtils; import com.bradmcevoy.http.DateUtils.DateParseException; import com.bradmcevoy.http.HttpManager; import com.bradmcevoy.http.Resource; import com.bradmcevoy.http.Utils; import com.bradmcevoy.http.exceptions.BadRequestException; import com.bradmcevoy.http.exceptions.NotAuthorizedException; import com.bradmcevoy.http.webdav.PropFindPropertyBuilder; import com.bradmcevoy.http.webdav.PropFindResponse; import com.bradmcevoy.http.webdav.PropFindXmlGenerator; import com.bradmcevoy.http.webdav.PropertiesRequest; import com.bradmcevoy.http.webdav.WebDavProtocol; import com.ettrema.http.CalendarResource; import com.ettrema.http.ICalResource; import com.ettrema.http.report.Report; import java.util.ArrayList; import java.util.Date; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Set; import javax.xml.namespace.QName; import org.jdom.Document; import org.jdom.Element; import org.jdom.Namespace; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * * @author brad */ public class CalendarQueryReport implements Report { private static final Logger log = LoggerFactory.getLogger(CalendarQueryReport.class); private final PropFindPropertyBuilder propertyBuilder; private final PropFindXmlGenerator xmlGenerator; private final Namespace NS_DAV = Namespace.getNamespace(WebDavProtocol.NS_DAV.getPrefix(), WebDavProtocol.NS_DAV.getName()); private final Namespace NS_CAL = Namespace.getNamespace("C", CalDavProtocol.CALDAV_NS); private final ICalFormatter formatter = new ICalFormatter(); public CalendarQueryReport(PropFindPropertyBuilder propertyBuilder, PropFindXmlGenerator xmlGenerator) { this.propertyBuilder = propertyBuilder; this.xmlGenerator = xmlGenerator; } @Override public String getName() { return "calendar-query"; } @Override public String process(String host, String path, Resource resource, Document doc) throws BadRequestException, NotAuthorizedException { log.debug("process"); // The requested properties Set<QName> props = getProps(doc); PropertiesRequest parseResult = PropertiesRequest.toProperties(props); // Generate the response List<PropFindResponse> respProps = new ArrayList<PropFindResponse>(); if (resource instanceof CalendarResource) { CalendarResource calendar = (CalendarResource) resource; List<ICalResource> foundResources = findCalendarResources(calendar, doc); log.trace("foundResources: " + foundResources.size()); String parentHref = HttpManager.request().getAbsolutePath(); parentHref = Utils.suffixSlash(parentHref); for (ICalResource cr : foundResources) { String href = parentHref + cr.getName(); //List<PropFindResponse> resps = propertyBuilder.buildProperties(calendar, 0, parseResult, href); List<PropFindResponse> resps = new ArrayList<PropFindResponse>(); propertyBuilder.processResource(resps, cr, parseResult, href, 0, 0, href); respProps.addAll(resps); } } else { throw new BadRequestException(resource, "Resource is not a " + CalendarResource.class.getCanonicalName() + " is a: " + resource.getClass()); } String xml = xmlGenerator.generate(respProps); return xml; } private Set<QName> getProps(Document doc) { Element elProp = doc.getRootElement().getChild("prop", NS_DAV); if (elProp == null) { throw new RuntimeException("No prop element"); } Set<QName> set = new HashSet<QName>(); for (Object o : elProp.getChildren()) { if (o instanceof Element) { Element el = (Element) o; String local = el.getName(); String ns = el.getNamespaceURI(); set.add(new QName(ns, local, el.getNamespacePrefix())); } } return set; } private List<ICalResource> findCalendarResources(CalendarResource calendar, Document doc) throws NotAuthorizedException, BadRequestException { // build a list of all calendar resources List<ICalResource> list = new ArrayList<ICalResource>(); for (Resource r : calendar.getChildren()) { if (r instanceof ICalResource) { ICalResource cr = (ICalResource) r; list.add(cr); } } // filter out those that don't match Element elFilterRoot = doc.getRootElement().getChild("filter", NS_CAL); if (elFilterRoot == null) { // no filter so return all return list; } Element elSecondFilter = elFilterRoot.getChild("comp-filter", NS_CAL); if (elSecondFilter == null) { // no second filter so return all return list; } Element elTimeRange = elSecondFilter.getChild("time-range", NS_CAL); if (elTimeRange == null) { // no time range filter so return all return list; } String sStart = elTimeRange.getAttributeValue("start"); String sFinish = elTimeRange.getAttributeValue("end"); Date start = null; Date end = null; if (sStart != null && sStart.length() > 0) { try { start = DateUtils.parseDate(sStart); } catch (DateParseException ex) { log.error("Couldnt parse start date in calendar-query: " + sStart); } } if (sFinish != null && sFinish.length() > 0) { try { end = DateUtils.parseDate(sFinish); } catch (DateParseException ex) { log.error("Couldnt parse end date in calendar-query: " + sFinish); } } // So now we have (or might have) start and end dates, so filter list Iterator<ICalResource> it = list.iterator(); while (it.hasNext()) { ICalResource r = it.next(); if (outsideDates(r, start, end)) { it.remove(); } } return list; } private boolean outsideDates(ICalResource r, Date start, Date end) { EventResource data; if (r instanceof EventResource) { data = (EventResource) r; } else { data = new EventResourceImpl(); formatter.parseEvent(data, r.getICalData()); } if (start != null) { if (data.getStart().before(start)) { return true; } } if (end != null) { if (data.getEnd().after(end)) { return true; } } return false; } }
/** * Created by wilsonsu on 3/15/16. */ public class WindowChartView extends ChartView { @Bind(R.id.tvSymbol) TextView tvSymbol; @Bind(R.id.tvPrice) TextView tvPrice; @Bind(R.id.tvChanges) TextView tvChanges; public WindowChartView(View itemView, FragmentActivity fragmentActivity) { super(itemView, fragmentActivity); } @Override protected void onRefreshPeriod(String period) { super.onRefreshPeriod(period); tvSymbol.setText(stock.symbol); Stock stockData = DataCenter.getInstance().stockMap.get(stock.symbol); if( stockData == null) { return; } tvPrice.setText(Utils.moneyConverter(stockData.current_price)); tvChanges.setText(" ( " + stockData.current_change_percentage + "% )"); Float changePercentage = -100.0f; try { changePercentage = Float.parseFloat(stockData.current_change_percentage); } catch (Exception e) { } int color = fragmentActivity.getResources().getColor(R.color.green); if(changePercentage < 0) { color = fragmentActivity.getResources().getColor(R.color.red); } tvPrice.setTextColor(color); tvChanges.setTextColor(color); } @Override public void setStock(String symbol) { super.setStock(symbol); itemView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(fragmentActivity.getApplicationContext(), DetailActivity.class); intent.putExtra("symbol", stock.symbol); ActivityOptionsCompat options = ActivityOptionsCompat.makeSceneTransitionAnimation(fragmentActivity, itemView, "windowCharts"); fragmentActivity.startActivity(intent, options.toBundle()); } }); } }
<reponame>TahaEntezari/ramstk # pylint: skip-file # type: ignore # -*- coding: utf-8 -*- # # tests.analyses.statistics.exponential_unit_test.py is part of The RAMSTK Project # # All rights reserved. # Copyright since 2007 Doyle "weibullguy" Rowland doyle.rowland <AT> reliaqual <DOT> com """Test class for the Exponential distribution module.""" # Standard Library Imports import math # Third Party Imports import numpy as np import pytest import scipy # RAMSTK Package Imports from ramstk.analyses.statistics import exponential @pytest.fixture(scope="function") def test_data(): """Data set of 100 exponentially distributed points with a mean of 100.""" yield np.array( [ 1.585, 1.978, 2.81, 3.679, 4.248, 5.137, 5.566, 6.328, 7.876, 10.79, 12.398, 13.095, 13.64, 14.003, 14.259, 14.558, 14.808, 14.848, 16.452, 17.743, 18.793, 18.917, 19.664, 20.564, 28.693, 34.931, 35.461, 36.169, 37.765, 38.951, 39.576, 40.36, 41.559, 42.486, 46.984, 48.146, 48.398, 49.315, 49.364, 49.76, 49.855, 52.315, 52.885, 53.127, 53.18, 54.07, 58.595, 61.993, 65.542, 66.69, 66.864, 67.342, 69.776, 71.048, 74.057, 75.549, 77.095, 78.747, 80.172, 82.16, 82.223, 86.769, 87.229, 88.862, 89.103, 94.072, 96.415, 101.977, 111.147, 115.532, 120.144, 121.963, 134.763, 137.072, 141.988, 143.687, 143.918, 148.07, 158.98, 159.732, 163.827, 169.175, 171.813, 172.663, 177.992, 184.263, 185.254, 194.039, 212.279, 222.93, 226.918, 241.044, 263.548, 275.491, 294.418, 297.467, 317.922, 323.763, 350.577, 351.347, ] ) @pytest.mark.unit def test_get_hazard_rate_defaults(): """should calculate the (EXP) hazard rate when using default confidence level.""" assert exponential.get_hazard_rate(1000.0) == 0.001 @pytest.mark.unit def test_get_hazard_rate_specified_location(): """should calculate the (EXP) hazard rate when specifying the location.""" assert exponential.get_hazard_rate(1000.0, location=100.0) == pytest.approx( 0.0009090909 ) @pytest.mark.unit def test_get_hazard_rate_zero_scale(): """should return nan when passed a scale=0.0.""" assert math.isnan(exponential.get_hazard_rate(0.0)) @pytest.mark.unit def test_get_mtbf_defaults(): """should calculate the EXP MTBF when using default confidence level.""" assert exponential.get_mtbf(0.000362) == pytest.approx(2762.4309392) @pytest.mark.unit def test_get_mtbf_specified_location(): """should calculate the EXP MTBF when specifying the location.""" assert exponential.get_mtbf(0.0001, location=0.005) == pytest.approx(10000.005) @pytest.mark.unit def test_get_mtbf_zero_rate(): """should return 0.0 when passed a rate=0.0.""" assert exponential.get_mtbf(0.0) == 0.0 @pytest.mark.unit def test_get_survival_defaults(): """should calculate the value of the survival function at time T.""" assert exponential.get_survival(10000.0, 4.0) == pytest.approx(0.9996001) @pytest.mark.unit def test_get_survival_specified_location(): """should calculate the value of the survival when specifying the location.""" assert exponential.get_survival(10000.0, 4.0, location=1.0) == pytest.approx( 0.9997000 ) @pytest.mark.unit def test_get_survival_zero_scale(): """should return nan when passed a scale=0.0.""" assert math.isnan(exponential.get_survival(0.0, 4.0)) @pytest.mark.unit def test_fit_defaults(test_data): """should estimate the scale parameter for the data using default input values.""" _location, _scale = exponential.do_fit(test_data) assert _location == 1.585 assert _scale == pytest.approx(92.54595) @pytest.mark.unit def test_fit_no_floc(test_data): """should estimate the scale and location parameter for the data.""" _location, _scale = exponential.do_fit(test_data, floc=0.0) assert _location == 0.0 assert _scale == pytest.approx(94.13095) @pytest.mark.unit @pytest.mark.skipif(scipy.__version__ < "1.7.1", reason="requires scipy>=1.7.1") def test_fit_mm_method(test_data): """should estimate the scale parameter using the MM method.""" _location, _scale = exponential.do_fit(test_data, method="MM") assert _location == pytest.approx(7.1563288) assert _scale == pytest.approx(86.9746313) @pytest.mark.unit @pytest.mark.skipif(scipy.__version__ < "1.7.1", reason="requires scipy>=1.7.1") def test_fit_mm_method_no_floc(test_data): """should estimate the scale parameter using the MM method.""" _location, _scale = exponential.do_fit(test_data, method="MM", floc=0.0) assert _location == 0.0 assert _scale == pytest.approx(94.1309375)
Uniting Church And Family In The Great Commission The family and the Church are two institutions founded by God himself. As an institution consisting of family and church believers complement each other in carrying out the Great Commission. But in its journey the burden of carrying out the mission is often left to the church, many families do not carry out the Great Commission. This article discusses problems between the church and the family in carrying out the Great Commission mission, with the aim of the family being able to understand and embarrass the mission of the Great Commission in the family and outside the family.
/** * Created by xieshibin on 2017/1/11. */ public class EaseNname2EpUser { public static String EaseNname2EpUser(String easeuser){ return easeuser.substring(1); } }
Metallothionein Isoform 3 Gene Is Differentially Expressed in Corticotropin-Producing Pituitary Adenomas In order to search for candidate genes related to pituitary adenoma aggressiveness, the present investigation was intended to compare the mRNA expression profile from a pool of four nonfunctional pituitary adenomas (NFPA) with a spinal cord metastasis of a nonfunctional pituitary carcinoma (MNFPC). The metallothionein isoform 3 (MT3) gene was differentially expressed in nonfunctional adenomas in comparison to the metastasis of nonfunctional carcinoma. A microarray dataset comprising 19,881 probes was employed for comparing expression profiles of a spinal cord metastasis of a nonfunctional pituitary carcinoma with a pool of four nonfunctional pituitary adenomas. RT-qPCR confirmed the microarray findings and was used to investigate MT3 mRNA gene expression in tumor samples of a series of 52 different pituitary adenoma subtypes comprising 10 corticotropin (ACTH)-producing, 18 growth hormone (GH)-producing, 8 prolactin (PRL)-producing, and 16 nonfunctional adenomas. Microarray data analysis by GeneSifter program unveiled Gene Ontology terms related to zinc ion-binding activity closely related to MT3 function. MT3 mRNA expression was statistically significantly higher in ACTH-producing pituitary adenomas and in nonfunctional pituitary adenomas in comparison to the other pituitary adenoma subtypes. The more abundant expression of this gene in ACTH-producing pituitary adenomas suggests that MT3 could be related to distinct pituitary cell lineage regulating the activity of some transcription factor of importance in hormone production and/or secretion.
Emmanuel Macron’s resounding victory in the French Presidential election has caught the attention of Paris’ 2024 Olympic and Paralympic Games bid that Sunday sent congratulations and welcomed the support of France’s new leader. “On behalf of the entire Paris 2024 Bid Committee we would like to congratulate Emmanuel Macron on becoming the newly elected President of France,” bid committee co-Chairs Tony Estanguet and Bernard Lapasset said in a statement. Thirty-nine year old Macron defeated Marine Le Pen, the extreme-right populist candidate who had been considered potentially toxic to Paris’ bid had she won the Presidency. In February La Pen criticized the Paris 2024 campaign when it unveiled the #MadeForSharing slogan in English, projected on the Eiffel Tower. Though bid officials urged that the English was necessary for the international media campaign, Le Pen and her supporters insisted it be communicated only in French. There was also concern that her isolationist policies could deter International Olympic Committee (IOC) voters from backing the French bid. With 85 per cent of the polls reporting late Sunday, Macron was leading with 64.3 per cent of the votes against 35.7 per cent for Le Pen. “[Macron] understands the power of sport and how the Games can be a force for real change and help build inspiration and inclusion,” the statement said. Macron’s victory ceremony was held at the Esplanade du Louvre in Paris Sunday night after the City of Paris told the candidate last week that he could hold the celebration at his first choice of venue, the Champ-de-Mars adjacent to the Eiffel Tower. With the IOC Evaluation Commission scheduled to start a three-day inspection of the French Capital next Sunday, officials feared that crowds at the Eiffel Tower location may damage the grass, causing an eyesore for the 14-member team led by Commission chair Patrick Baumann. The IOC Evaluation Commission permits a state dinner to be held during the visit but there is no confirmation that Macron will be scheduled to meet Baumann’s team next week. The same team is set to visit Paris’ bid rival Los Angeles starting Wednesday. The IOC will elect the winner at an all-members session in Lima, Peru on September 13 and its possible that Macron will attend the meeting to support Paris’ bid. In 2005, then French President Jacques Chirac attended the election of the 2012 Olympic host city in Singapore when Paris fell to London on the final ballot.
#include<stdio.h> int main() { int a=0,b=1,c=0; printf("%d %d",a,b); for(a=1;a<=20;a++); { c=a+b; a=b; b=c; printf("%d",c); } return 0; }
The emerging era of cell engineering: Harnessing the modularity of cells to program complex biological function A new era of biological engineering is emerging in which living cells are used as building blocks to address therapeutic challenges. These efforts are distinct from traditional molecular engineeringtheir focus is not on optimizing individual genes and proteins as therapeutics, but rather on using molecular components as modules to reprogram how cells make decisions and communicate to achieve higher-order physiological functions in vivo. This cell-centric approach is enabled by a growing tool kit of components that can synthetically control core cell-level functional outputs, such as where in the body a cell should go, what other cells it should interact with, and what messages it should transmit or receive. The power of cell engineering has been clinically validated by the development of immune cells designed to kill cancer. This same tool kit for rewiring cell connectivity is beginning to be used to engineer cell therapies for a host of other diseases and to program the self-organization of tissues and organs. By forcing the conceptual distillation of complex biological functions into a finite set of instructions that operate at the cell level, these efforts also shed light on the fundamental hierarchical logic that links molecular components to higher-order physiological function. Description
Benguet coffee Benguet coffee, also known as Benguet arabica, is a single-origin coffee varietal grown in the Cordillera highlands of the northern Philippines since the 19th century. It belongs to the species Coffea arabica, of the Typica variety. It is one of the main crops of farmers in the province of Benguet, which has a climate highly suitable for arabica cultivation. Benguet coffee is listed in the Ark of Taste international catalogue of endangered heritage foods by the Slow Food movement. History Arabica coffee is believed to have been introduced to the Cordillera highlands in the mid-19th century. According to William F. Pack, an American governor of Benguet (1909-1912) during the American colonial period, arabica coffee was first introduced to the Cordilleras in 1875 by a Spanish military governor of Benguet, Manuel Scheidnegal y Sera. He initially planted them in government gardens in the lowlands of the province to evaluate their potential as a regional crop. However, frequent rains and the low altitude were not ideal conditions for the plants. The next governor, Enrique Oraa, had greater success when he transplanted them at higher altitudes in 1877 and distributed seedlings among the native Igorot people. In 1881 however, the then governor, a certain Villena, attempted to coerce the natives into growing coffee by ordering them to do so. In protest, native communities destroyed arabica plantations at the advice of village elders. However, a native chief named Camising from Kabayan purportedly saw the benefits of the crop and introduced arabica coffee to his own people. His successes convinced neighboring communities to take up coffee cultivation on their own. Benguet coffee was part of the booming coffee industry of the Philippines during the 1880s and 1890s, which reached annual coffee exports of up to 16 million pounds. However, coffee rust devastated the plantations in 1899 and coffee production plummeted. By 1917, annual total export of coffee from the Philippines only amounted to around 3,000 pounds. Pack praised Benguet coffee even then for its flavor and spear-headed a plan to rehabilite the industry while he was governor. However, his efforts and that of the American colonial government failed. Cultivation Benguet coffee cultivation is centered in the province of Benguet, mostly in backyard or small-scale farms. The coffee they produced were both for local consumption and sold as luxury exports to Spain, where they fetched high prices. The coffee industry flourished in the mid-20th century as demand increased. But it faltered in the 1990s due to rapidly rising inflation and government neglect, resulting in farmers shifting to other crops like corn. In recent years, provincial governments are attempting to bring back coffee production for both local and international markets. Production has steadily increased since 2010. In 2016, the Department of Trade and Industry in Cordillera launched a shared service facility and laboratory for processing and cupping arabica in the Benguet State University, the first in the country. Benguet is regarded as the top producer of quality arabica coffee in the Philippines and is in high demand. Benguet coffee is characterized as having an acidity comparable to Hawaiian Kona coffee and Jamaican Blue Mountain coffee. Benguet coffee is listed in the Ark of Taste international catalogue of endangered heritage foods by the Slow Food movement.
<gh_stars>1-10 package rest.koios.client.backend.api.asset; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; import rest.koios.client.backend.api.asset.model.*; import rest.koios.client.backend.api.base.Result; import rest.koios.client.backend.api.base.exception.ApiException; import rest.koios.client.backend.factory.BackendFactory; import rest.koios.client.backend.factory.options.Limit; import rest.koios.client.backend.factory.options.Options; import java.math.BigInteger; import java.util.List; import static org.junit.jupiter.api.Assertions.*; @Slf4j @TestInstance(TestInstance.Lifecycle.PER_CLASS) class AssetServiceTestnetIntegrationTest { private AssetService assetService; @BeforeAll public void setup() { assetService = BackendFactory.getKoiosTestnetService().getAssetService(); } @Test void getAssetListLimitTest() throws ApiException { Options options = Options.builder().option(Limit.of(10)).build(); Result<List<Asset>> assetsResult = assetService.getAssetList(options); Assertions.assertTrue(assetsResult.isSuccessful()); Assertions.assertNotNull(assetsResult.getValue()); log.info(assetsResult.getValue().toString()); assertEquals(10, assetsResult.getValue().size()); } @Test void getAssetsAddressListTest() throws ApiException { String assetPolicy = "654ebfc69ea9b582d09755a0760fdac7b3e16718ef47acd958708035"; String assetName = "MusicBong359"; String assetNameHex = String.format("%x", new BigInteger(1, assetName.getBytes())); Result<List<AssetAddress>> assetAddressesResult = assetService.getAssetsAddressList(assetPolicy, assetNameHex, null); Assertions.assertTrue(assetAddressesResult.isSuccessful()); Assertions.assertNotNull(assetAddressesResult.getValue()); log.info(assetAddressesResult.getValue().toString()); } @Test void getAssetsAddressListBadRequestTest() { String assetPolicy = "654ebfc69ea9b582d09755a0760fdac7b3e16718ef47acd958708035"; String assetNameHex = "53706f6f6b79426f782331asdsadsa"; ApiException exception = assertThrows(ApiException.class, () -> assetService.getAssetsAddressList(assetPolicy, assetNameHex, null)); assertInstanceOf(ApiException.class, exception); } @Test void getAssetInformationTest() throws ApiException { String assetPolicy = "654ebfc69ea9b582d09755a0760fdac7b3e16718ef47acd958708035"; String assetName = "MusicBong359"; String assetNameHex = String.format("%x", new BigInteger(1, assetName.getBytes())); Result<AssetInformation> assetInformationResult = assetService.getAssetInformation(assetPolicy, assetNameHex); Assertions.assertTrue(assetInformationResult.isSuccessful()); Assertions.assertNotNull(assetInformationResult.getValue()); Assertions.assertNotNull(assetInformationResult.getValue().getMintingTxMetadata()); log.info(assetInformationResult.getValue().toString()); } @Test void getAssetInformationTokenTest() throws ApiException { String assetPolicy = "34250edd1e9836f5378702fbf9416b709bc140e04f668cc355208518"; String assetName = "ATADAcoin"; String assetNameHex = String.format("%x", new BigInteger(1, assetName.getBytes())); Result<AssetInformation> assetInformationResult = assetService.getAssetInformation(assetPolicy, assetNameHex); Assertions.assertTrue(assetInformationResult.isSuccessful()); Assertions.assertNotNull(assetInformationResult.getValue()); Assertions.assertNotNull(assetInformationResult.getValue().getTokenRegistryMetadata()); log.info(assetInformationResult.getValue().toString()); } @Test void getAssetInformationBadRequestTest() { String assetPolicy = "654ebfc69ea9b582d09755a0760fdac7b3e16718ef47acd958708035"; String assetNameHex = "53706f6f6b79426f782331asdsadsa"; ApiException exception = assertThrows(ApiException.class, () -> assetService.getAssetInformation(assetPolicy, assetNameHex)); assertInstanceOf(ApiException.class, exception); } @Test void getAssetHistoryTest() throws ApiException { String assetPolicy = "654ebfc69ea9b582d09755a0760fdac7b3e16718ef47acd958708035"; String assetName = "MusicBong359"; String assetNameHex = String.format("%x", new BigInteger(1, assetName.getBytes())); Result<List<AssetHistory>> assetHistoriesResult = assetService.getAssetHistory(assetPolicy, assetNameHex, null); Assertions.assertTrue(assetHistoriesResult.isSuccessful()); Assertions.assertNotNull(assetHistoriesResult.getValue()); log.info(assetHistoriesResult.getValue().toString()); } @Test void getAssetHistoryBadRequestTest() { String assetPolicy = "654ebfc69ea9b582d09755a0760fdac7b3e16718ef47acd958708035"; String assetNameHex = "53706f6f6b79426f782331asdsadsa"; ApiException exception = assertThrows(ApiException.class, () -> assetService.getAssetHistory(assetPolicy, assetNameHex, null)); assertInstanceOf(ApiException.class, exception); } @Test void getAssetPolicyInformationTest() throws ApiException { String assetPolicy = "34250edd1e9836f5378702fbf9416b709bc140e04f668cc355208518"; Result<List<PolicyAsset>> assetPolicyInfoResult = assetService.getAssetPolicyInformation(assetPolicy); Assertions.assertTrue(assetPolicyInfoResult.isSuccessful()); Assertions.assertNotNull(assetPolicyInfoResult.getValue()); log.info(assetPolicyInfoResult.getValue().toString()); } @Test void getAssetPolicyInformationBadRequestTest() { String assetPolicy = "test"; ApiException exception = assertThrows(ApiException.class, () -> assetService.getAssetPolicyInformation(assetPolicy)); assertInstanceOf(ApiException.class, exception); } @Test void getAssetSummaryTest() throws ApiException { String assetPolicy = "654ebfc69ea9b582d09755a0760fdac7b3e16718ef47acd958708035"; String assetName = "MusicBong359"; String assetNameHex = String.format("%x", new BigInteger(1, assetName.getBytes())); Result<AssetSummary> assetSummaryResult = assetService.getAssetSummary(assetPolicy, assetNameHex); Assertions.assertTrue(assetSummaryResult.isSuccessful()); Assertions.assertNotNull(assetSummaryResult.getValue()); log.info(assetSummaryResult.getValue().toString()); } @Test void getAssetSummaryBadRequestTest() { String assetPolicy = "654ebfc69ea9b582d09755a0760fdac7b3e16718ef47acd958708035"; String assetNameHex = "53706f6f6b79426f782331asdsadsa"; ApiException exception = assertThrows(ApiException.class, () -> assetService.getAssetSummary(assetPolicy, assetNameHex)); assertInstanceOf(ApiException.class, exception); } @Test void getAssetTxsTest() throws ApiException { String assetPolicy = "654ebfc69ea9b582d09755a0760fdac7b3e16718ef47acd958708035"; String assetName = "MusicBong359"; String assetNameHex = String.format("%x", new BigInteger(1, assetName.getBytes())); Result<List<AssetTx>> assetTxsResult = assetService.getAssetTransactionHistory(assetPolicy, assetNameHex, null); Assertions.assertTrue(assetTxsResult.isSuccessful()); Assertions.assertNotNull(assetTxsResult.getValue()); log.info(assetTxsResult.getValue().toString()); } @Test void getAssetTxsBadRequestTest() { String assetPolicy = "654ebfc69ea9b582d09755a0760fdac7b3e16718ef47acd958708035"; String assetNameHex = "53706f6f6b79426f782331asdsadsa"; ApiException exception = assertThrows(ApiException.class, () -> assetService.getAssetTransactionHistory(assetPolicy, assetNameHex, null)); assertInstanceOf(ApiException.class, exception); } }
<gh_stars>1-10 #pragma once // system headers #include <memory> // library headers #include <QString> #include <QtWidgets/QApplication> // local headers #include "Command.h" #include "AbstractFactory.h" #include "AbstractInspector.h" #include "AbstractInstaller.h" /** * Creates Commands. */ namespace appimagelauncher { namespace commands { class GuiCommandsFactory : public AbstractFactory { public: std::shared_ptr<Command> getCommandByName(const QString&) override; void setLauncher(std::shared_ptr<AbstractLauncher> newLauncher) override; void setInstaller(std::shared_ptr<AbstractInstaller> newInstaller) override; void setInspector(std::shared_ptr<AbstractInspector> newInspector) override; private: std::shared_ptr<AbstractLauncher> launcher; std::shared_ptr<AbstractInspector> inspector; std::shared_ptr<AbstractInstaller> installer; }; } }
<reponame>OmegaJak/improved-initiative<gh_stars>0 import { CurrentSettings } from "../Settings/Settings"; import { Combatant } from "./Combatant"; import { Tag } from "./Tag"; export interface StaticCombatantViewModel { Name: string; HPDisplay: string; HPColor: string; Initiative: number; Id: string; Tags: Tag[]; IsPlayerCharacter: boolean; } export function ToStaticViewModel(combatant: Combatant): StaticCombatantViewModel { return { Name: combatant.DisplayName(), Id: combatant.Id, HPDisplay: GetHPDisplay(combatant), HPColor: GetHPColor(combatant), Initiative: combatant.Initiative(), IsPlayerCharacter: combatant.IsPlayerCharacter, Tags: combatant.Tags().filter(t => t.Visible()), }; } function GetHPDisplay(combatant: Combatant): string { let monsterHpVerbosity = CurrentSettings().PlayerView.MonsterHPVerbosity; if (combatant.IsPlayerCharacter || monsterHpVerbosity == "Actual HP") { if (combatant.TemporaryHP()) { return `${combatant.CurrentHP()}+${combatant.TemporaryHP()}/${combatant.MaxHP}`; } else { return `${combatant.CurrentHP()}/${combatant.MaxHP}`; } } if (monsterHpVerbosity == "Hide All") { return ""; } if (monsterHpVerbosity == "Damage Taken") { return (combatant.CurrentHP() - combatant.MaxHP).toString(); } if (combatant.CurrentHP() <= 0) { return "<span class='defeatedHP'>Defeated</span>"; } else if (combatant.CurrentHP() < combatant.MaxHP / 2) { return "<span class='bloodiedHP'>Bloodied</span>"; } else if (combatant.CurrentHP() < combatant.MaxHP) { return "<span class='hurtHP'>Hurt</span>"; } return "<span class='healthyHP'>Healthy</span>"; } function GetHPColor(combatant: Combatant) { let monsterHpVerbosity = CurrentSettings().PlayerView.MonsterHPVerbosity; if (!combatant.IsPlayerCharacter && (monsterHpVerbosity == "Monochrome Label" || monsterHpVerbosity == "Hide All" || monsterHpVerbosity == "Damage Taken")) { return "auto"; } let green = Math.floor((combatant.CurrentHP() / combatant.MaxHP) * 170); let red = Math.floor((combatant.MaxHP - combatant.CurrentHP()) / combatant.MaxHP * 170); return "rgb(" + red + "," + green + ",0)"; }
def search_names(name_data, target): names = [] target = target.lower() for ele in name_data: ele_lower = ele.lower() if target in ele_lower: names.append(ele) return names
/** * @author <a href="mailto:[email protected]">George Gastaldi</a> */ @Provider public class IllegalStateExceptionMapper implements ExceptionMapper<IllegalStateException> { @Override public Response toResponse(IllegalStateException exception) { return Response.status(Response.Status.INTERNAL_SERVER_ERROR) .header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON) .entity(createArrayBuilder() .add(createObjectBuilder() .add("message", exception.getMessage())) .build()) .build(); } }
<gh_stars>0 #include "stdafx.h" #include "window.h" Window::Window() { } bool Window::Initialize(OpenGLWrapper *glWrapper, HINSTANCE hInstance, WNDPROC wndProc, std::wstring title) { WNDCLASSEX windowClass{}; windowClass.cbSize = sizeof(WNDCLASSEX); windowClass.style = CS_OWNDC; windowClass.lpfnWndProc = wndProc; windowClass.cbClsExtra = 0; windowClass.cbWndExtra = 0; windowClass.hInstance = hInstance; windowClass.hIcon = LoadIcon(NULL, IDI_APPLICATION); windowClass.hCursor = LoadCursor(NULL, IDC_ARROW); windowClass.hbrBackground = NULL; windowClass.lpszMenuName = NULL; windowClass.lpszClassName = title.c_str(); windowClass.hIconSm = LoadIcon(NULL, IDI_APPLICATION); if (!RegisterClassEx(&windowClass)) { return false; } hWnd_ = CreateWindow(title.c_str(), title.c_str(), WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 640, 480, NULL, NULL, hInstance, NULL); if (!hWnd_) { return false; } if (!glWrapper->Initialize(hWnd_)) { return false; } ShowWindow(hWnd_, SW_SHOW); UpdateWindow(hWnd_); return true; } HWND Window::GetHandler() { return hWnd_; } void Window::SetTitle(std::wstring title) { SetWindowText(hWnd_, title.c_str()); } Window::~Window() { if (hWnd_) { DestroyWindow(hWnd_); } }