text stringlengths 8 5.77M |
|---|
Berkeley Rose Garden
Nestled in the Berkeley Hills, the Berkeley Rose Garden features 3,000 rose bushes and 250 varieties of roses, as well as tennis courts and a lovely view of San Francisco Bay. It's also a popular spot for weddings. |
© Family handout The parents of Harry Dunn have criticised the Crown Prosecution Service (Family handout/PA)
The family of teenage motorcyclist Harry Dunn have said they are disgusted and “not sleeping well” after the Crown Prosecution Service “refused” to meet with them.
The CPS were handed the completed file of evidence in the 19-year-old’s case on November 1.
The PA news agency understands the family have requested two meetings with Chief Crown Prosecutor Janine Smith – and have been told a meeting will “not be possible”.
The chief prosecutor has said she will meet with the family once a charging decision has been made.
© Provided by PA Media Teenage motorcyclist Harry Dunn (Family handout/PA)
Harry’s stepfather Bruce Charles has said the “delay” in a charging decision is “eating away inside us”.
He told PA that the family wants a “100% cast iron promise” of no external interference in the case in a face-to-face meeting with a CPS representative.
The family’s spokesman has said they will now seek an “urgent” meeting with the Director of Public Prosecutions.
Harry was killed when his motorbike was involved in a head-on collision with a car outside RAF Croughton in Northamptonshire on August 27.
© Provided by PA Media Charlotte Charles (left), the mother of Harry Dunn, and her partner Bruce Charles (Andy Matthews/PA)
The suspect in the case, 42-year-old Anne Sacoolas, claimed diplomatic immunity after the crash and was able to return to the US.
Speaking of the family’s frustration over the CPS’s decision not to meet with them, Mr Charles told PA: “Our family have enormous respect for the CPS and the valuable work they do on the public’s behalf.
“We know prosecutors work incredibly hard each and every day, and we have no wish to undermine the reputation of the institution.
“However, as the whole nation now knows, we have felt totally unsupported by the authorities since Harry died and the delay in charging in this most simple of cases is just eating away inside us.”
In pictures: Trump’s trouble with directions and other top photos of the week [Photos]
Mr Charles continued: “None of us are sleeping well and we are convinced something is up and the governments are interfering.
“We simply want to meet with the prosecutor to look her in the eye and to get a 100% cast-iron promise that there is no external interference and to understand what on earth is causing the delay.
“We watch the news every day and see that people are charged quickly in other high-profile, far more complex crimes. Why isn’t that happening in our simple case?”
He added: “We have a right to know and are being fobbed off yet again. We are disgusted at the prosecutor’s latest refusal to meet us and her persistent statements that she cannot tell us when the charge will be authorised.
“We are sick and tired of her telling us how sorry she is for our loss, offering condolences and understanding our frustration. They are just empty words.”
Please see attached update issued on behalf of the Parents of #HarryDunn. @Justice4Harry https://t.co/bAoanbqWjO — Radd Seiger (@RaddSeiger) December 6, 2019
Commenting on the CPS involvement in the case, the family’s spokesman Radd Seiger said: “We know Northamptonshire Police let the family down and, to their credit, have acknowledged that, and wish to work with the family to learn the lessons.
“It may be that the CPS are doing a sterling job, but the important point is that the family feel that that is not the case for perfectly understandable and valid reasons as supported by thousands of like-minded messages the family have received.
“Anybody in their shoes in would feel exactly the same way, even the prosecutor and the politicians.
“The CPS appear not to be taking any account of the mental torture the family are going through and their persistent refusal to agree to the early meeting the family are entitled to is unconscionable and incomprehensible.
© Provided by PA Media The family of Harry Dunn, (left to right) Tim Dunn (Harry’s father), Charlotte Charles (Harry’s mother), Tracey Dunn and Bruce Charles (Kirsty O’Connor/PA)
“The parents have therefore asked me to seek an urgent meeting with the Director of Public Prosecutions to take the issue up on their behalf and I will be making that call this morning.”
A CPS spokeswoman said: “We appreciate how difficult this time must be for Harry’s loved ones and understand that his family are seeking answers.
“However, whilst the case is under active consideration, we are unable to meet with Harry’s family to discuss its progress.
“The CPS is carefully considering all the available information, including the impact on Harry’s family, in order to make an independent and objective charging decision.
“Our Chief Crown Prosecutor will meet with Harry’s parents as soon as is it possible to provide them with an update.” |
Influence of dietary selenium on the mutagenic activity of perfusate and bile from rat liver, perfused with 1,1-dimethylhydrazine.
The mutagenic effect of 1,1-dimethylhydrazine (UDMH) was studied in the liver perfusion/cell culture system. Male Wistar rats, fed a selenium-deficient diet with or without selenium supplementation in the drinking water, were used as liver donors. UDMH caused an increased mutation frequency in Chinese hamster V79 cells exposed in the perfusate. The effect was statistically significant with both selenium-deficient and selenium-supplemented livers. With selenium-deficient livers, a significant mutagenic effect was also obtained when V79 cells were treated with bile collected after the administration of UDMH. Bile flow and bile acid excretion were not affected by UDMH treatment of selenium-deficient or selenium-supplemented livers. There was a tendency towards reduced C-oxygenation of N,N-dimethylaniline in microsomes from selenium-deficient livers perfused with UDMH. The lactate/pyruvate ratio in the perfusate was increased by UDMH, the effect being more pronounced with selenium-deficient than selenium-supplemented livers. |
Early antibiotic selection and efficient rooting and acclimatization improve the production of transgenic plum plants (Prunus domestica L.).
We describe here an improved system for routinely developing transgenic plum plants (Prunus domestica L.) through the use of Agrobacterium tumefaciens. The production of non-transformed "escapes" has been virtually eliminated, and rates of plant establishment in the greenhouse have been dramatically improved. The system is based on the regeneration of shoots from hypocotyls extracted from mature seed. The shoot regeneration medium is Murashige and Skoog (MS) salts and vitamins supplemented with 7.5 microM thidiazuron and 0.25 microM indole-butyric acid. Transferring the explants after co-cultivation to shoot regeneration medium containing 80 mg l(-1) of kanamycin and 300 mg l(-1) of Timentin reduced the total number of regenerated shoots without affecting the transformation rate. Transformation rates using the described system averaged 1.2% of the hypocotyl slices producing transgenic plants, with a range of 0-4.2%. The transgenic shoots rooted at a rate of 90% on half-strength MS salts and vitamins supplemented with 5 microM alpha-naphthaleneacetic acid and 0.01 microM kinetin. Plantlets were transferred to a greenhouse directly from culture tubes with a 90% average survival. |
Super Science Friends: The Video Game – Prototype Download
Super Science Friends: The Video Game is a funny and beautifully animated side scrolling beat ‘em up in which Einstein, Darwin, Marie Curie, Tesla, Sigmund Freud and Taputti take on Hitler’s time travelling army of super villains!
Based on the popular YouTube animated series of the same name, Super Science Friends: The Video Game sees your band of super powered scientists taking on Hitler and his evil henchmen after a time paradox brought him back to life. What follows promises to be 12 levels of old school side scrolling beat ‘em up action that will see Einstein and the other characters he rescues battling lots of familiar faces from the Super Science Friends series.
The current build of Super Science Friends: The Video Game features one level of side scrolling arcade combat and one playable character (Einstein). The combat is pretty basic at the moment, but the quality of the pixel artwork is superb and it’s a very funny game, especially thanks to all the silly enemy animations and the quirky details in the scenery.
The combat could do with being a little more intricate (a few more attacks and a dodge button would be nice), but other than that Super Science Friends: The Video Game is off to a great start. It’s a fun romp that’s packed full of great humor and high quality pixel art animation that makes taking on Hitler’s time travelling forces a joy. A super silly side scrolling scientific smackdown well worth checking out. |
Morocco at the 2020 Summer Olympics
Morocco is scheduled to compete at the 2020 Summer Olympics in Tokyo from 24 July to 9 August 2020. It will be the nation's fifteenth appearance at the Summer Olympics.
Athletics
Moroccan athletes achieved the entry standards, either by qualifying time or by world ranking, in the following track and field events (up to a maximum of 3 athletes in each event):
Key
Note–Ranks given for track events are within the athlete's heat only
Q = Qualified for the next round
q = Qualified for the next round as a fastest loser or, in field events, by position without achieving the qualifying target
NR = National record
N/A = Round not applicable for the event
Bye = Athlete not required to compete in round
Track & road events
Men
Women
Boxing
Morocco entered six boxers (three per gender) into the Olympic tournament. Rio 2016 Olympian Khadija El-Mardi, along with five rookies (Baala, Nadir, Assaghir, Cheddar, and Bel Ahbib), secured their spots by advancing to the final match of their respective weight divisions at the 2020 African Qualification Tournament in Diamniadio, Senegal.
Cycling
Road
Morocco entered one rider to compete in the men's Olympic road race, by virtue of his top 50 national finish (for men) in the UCI World Ranking.
Equestrian
Morocco entered one dressage rider into the Olympic equestrian competition, by finishing in the top two, outside the group selection, of the individual FEI Olympic Rankings for Group F (Africa and Middle East). Meanwhile, a squad of three jumping riders was added to the Moroccan roster by accepting a forfeited spot from Qatar, as the next highest-ranked team, not yet qualified, at the International Equestrian Federation (FEI)-designated Olympic qualifier for Group F in Rabat.
Dressage
Qualification Legend: Q = Qualifed for the final; q = Qualifed for the final as a lucky loser
Jumping
Rowing
Morocco qualified one boat in the women's single sculls for the Games by finishing fourth in the A-final and securing the second of five berths available at the 2019 FISA African Olympic Qualification Regatta in Tunis, Tunisia, marking the country's debut in the sport.
Qualification Legend: FA=Final A (medal); FB=Final B (non-medal); FC=Final C (non-medal); FD=Final D (non-medal); FE=Final E (non-medal); FF=Final F (non-medal); SA/B=Semifinals A/B; SC/D=Semifinals C/D; SE/F=Semifinals E/F; QF=Quarterfinals; R=Repechage
Shooting
Moroccan shooters achieved quota places for the following events by virtue of their best finishes at the 2018 ISSF World Championships, the 2019 ISSF World Cup series, and African Championships, as long as they obtained a minimum qualifying score (MQS) by May 31, 2020.
Surfing
Morocco sent one surfer to compete in the men's shortboard at the Games. Ramzi Boukhiam secured a qualification slot for his nation, as the highest-ranked and last remaining surfer from Africa, at the 2019 ISA World Surfing Games in Miyazaki, Japan.
Taekwondo
Morocco entered three athletes into the taekwondo competition at the Games. Achraf Mahboubi, Oumaima El-Bouchti, and Nada Laaraj secured the spots on the Moroccan squad with a top two finish each in the men's welterweight (80 kg), women's flyweight (49 kg), and women's lightweight category (57 kg), respectively, at the 2020 African Qualification Tournament in Rabat.
References
Category:Nations at the 2020 Summer Olympics
2020
Category:2020 in Moroccan sport |
[Proposal for the implementation of an interdisciplinary program to support the work of the nursing staff].
The purpose of this paper is to reflect on the psychodynamic of the nursing work developed in the hospital, and to suggest the implementation of an interdisciplinary programme for support the nursing workers to help them to understand and to solve social and managerial problems faced during the work. |
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2006-2017 Oracle and/or its affiliates. All rights reserved.
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common Development
* and Distribution License("CDDL") (collectively, the "License"). You
* may not use this file except in compliance with the License. You can
* obtain a copy of the License at
* https://oss.oracle.com/licenses/CDDL+GPL-1.1
* or LICENSE.txt. See the License for the specific
* language governing permissions and limitations under the License.
*
* When distributing the software, include this License Header Notice in each
* file and include the License file at LICENSE.txt.
*
* GPL Classpath Exception:
* Oracle designates this particular file as subject to the "Classpath"
* exception as provided by Oracle in the GPL Version 2 section of the License
* file that accompanied this code.
*
* Modifications:
* If applicable, add the following below the License Header, with the fields
* enclosed by brackets [] replaced by your own identifying information:
* "Portions Copyright [year] [name of copyright owner]"
*
* Contributor(s):
* If you wish your version of this file to be governed by only the CDDL or
* only the GPL Version 2, indicate your decision by adding "[Contributor]
* elects to include this software in this distribution under the [CDDL or GPL
* Version 2] license." If you don't indicate a single choice of license, a
* recipient has the option to distribute your version of this file under
* either the CDDL, the GPL Version 2 or to extend the choice of license to
* its licensees as provided above. However, if you add GPL Version 2 code
* and therefore, elected the GPL Version 2 license, then the option applies
* only if the new code is made subject to such option by the copyright
* holder.
*/
package wsa.fromjava.custom_action.client;
import junit.framework.TestCase;
import junit.framework.Test;
import junit.framework.TestSuite;
/**
* @author Rama Pulavarthi
*/
public class AllTests extends TestCase {
public AllTests(String name) {
super(name);
}
public static Test suite() {
TestSuite suite = new TestSuite();
suite.addTestSuite(AddNumbersClient.class);
return suite;
}
}
|
---
abstract: 'We study the magnetic properties of Bi$_2$Se$_3$ doped with isoelectronic magnetic impurities. We obtain that at zero temperature the impurities order ferromagnetically, but when raising the temperature the system undergoes a first order phase transition to a spin density wave phase before the system reaches the paramagnetic phase. The origin of this phase is the non-trivial dependence of the spin susceptibility on the momentum. We analyze the coupling of the non-uniform magnetic phase with the Dirac electronic system that occurs at the surfaces of the topological insulator.'
author:
- Martha Lasia and Luis Brey
title: 'Temperature Induced Spin Density Wave in Magnetic Doped Topological Insulator Bi$_2$Se$_3$'
---
Introduction
============
Topological insulators (TI) are a newly discovered type of systems which are insulating in the bulk and characterized by the existence of a robust helical gapless Dirac two dimensional electron system at their surface[@hasan_2010; @Qi_2010; @Qi_2011].
TI’s are typically band insulators for which strong spin orbit coupling produces an inversion of the bulk band gap. Therefore, in TI’s the energy gap is related with the spin orbit coupling and that limits its magnitude. The most studied and more promising topological insulator is Bi$_2$Se$_3$, which is a three dimensional TI with a relatively large bulk energy gap $\sim 0.3$eV and with the Dirac point of the surface states located outside the bulk bands[@Xia_2009; @Zhang_2009]. Angle resolved spectroscopy[@Hsieh_2009; @Xia_2009] and scanning tunneling microscopy[@Hanaguri_2010]experiments have shown the Dirac nature of the surface states of Bi$_2$Se$_3$.
The spin and wavevector of the surface states of a TI are strongly coupled, and the occurrence of a half-quantized Hall effect when a energy gap opens at the surface has been predicted[@Qi_2008; @Essin_2009]. Due to the protected character of the Dirac states, a gap at the surface should be opened with a perturbation that breaks the time reversal symmetry. This can be done by doping the system with magnetic impurities. At the surface of the TI, because of the large spin-orbit coupling, the interaction between the Dirac-like surface states and the impurities induces a large single ion magnetic anisotropy and polarizes the spin of the impurities perpendicularly to the surface. This spin-orbit coupling translates in the opening of an energy gap at the Dirac point of the surface states[@Liu_2009; @Biswas_2010; @Yu_2010; @Jiang_2011; @Yokoyama_2011; @Zhu_2011; @Abanin_2011; @Menshov_2011; @nunez_2012; @Tetsuro_2012].
From the experimental side, angle resolved photoemission spectroscopy (ARPES) studies on the surface of Fe-doped Bi$_2$Se$_3$ single crystals have confirmed the opening of an energy gap at the Dirac point[@Chen_2010] and the creation of odd multiples of Dirac fermions[@Wray_2010]. Also, recently, experiments in thin films of Cr-doped Bi$_x$Sb$_{2-x}$Te$_{3}$, has shown a large anomalous Hall conductance in a magnetically doped topological insulator[@Chang_2011].
However, recent experiments[@Honolka_2011] found that the spins of Fe ions deposited on Bi$_2$Se$_3$ orient inplane. Also ARPES experiments[@Scholz_2011; @Valla_2012] found Dirac crossing even in the presence of magnetic impurities in contradiction with earlier experiments and existing theory. On the other hand, recently it has been reported the suppression of the Dirac point spectral weight, both in magnetically doped and undoped TI, suggesting that the observed gap at the Dirac point can not be taken as the sole evidence of a magnetic gap[@Xu_2012]. In addition, density functional theory based calculations[@Schimdt_2011] find that Co adatoms lying in the Bi$_2$Se$_3$ surface exhibit an energetically stable magnetic moment perpendicular to the surface, whereas for Co atoms located on the interlayer Van der Waals spacing the momentum is in the plane parallel to the surface. All these results indicate the complexity of the interpretation of the ARPES experiments and the possible importance of other effects not included in the Dirac hamiltonian, as crystalline anisotropy or surface reconstruction, might play an important role on the orientation of the magnetic impurities. In this work we use an effective hamiltonian for describing Bi$_2$Se$_3$, which although it does not include microscopic details of the material describes appropriately the basic properties of the Bi$_2$Se$_3$ related with its band structure topology.
In this work we study the phase diagram of magnetically doped Bi$_2$Se$_3$. Bi$_2$Se$_3$ is a layered material formed by five atom layers arranged along the $z$-direction. We find that at low temperatures the magnetic impurities order ferromagnetically along the $z$-direction. By raising the temperature, the TI undergoes two transitions; A first order transition from the ferromagnetic to the spin density wave phase, and at higher temperatures a second order transition from the spin density wave phase to the paramagnetic phase. The spin density wave phase has both,the polarization and the wavevector, parallel to the $z$-direction. We have also studied the effect of the surface states by calculating the magnetization as function of temperature of a slab of Bi$_2$Se$_3$ topological insulator. Here we find that the surface magnetization survives to higher temperatures than the bulk spin density wave phase.
The paper is organized as follow, in Section II we define the hamiltonian we use for describing the electrical properties of Bi$_2$Se$_3$. In Section III we calculate the wavevector dependent paramagnetic spin susceptibility of Bi$_2$Se$_3$ and discuss the interaction between magnetic impurities through the paramagnetic susceptibility. In Section IV we formulate a Landau theory for describing the magnetic order of magnetically doped Bi$_2$Se$_3$, and discover the existence of a ferromagnetic to spin density wave phase transition at finite temperature. In Section V we study the polarization profiles of a magnetically doped Bi$_2$Se$_3$ slab and analyze the effect that the Dirac-like surface states have on the magnetic phases. We finish in Section V with some conclusions and remarks.
Hamiltonian
===========
The low energy and long wavelength electronic properties of Bi$_2$Se$_3$ topological insulators are described by the four bands ${\bf k }\cdot {\bf p }$ Hamiltonian[@Zhang_2009], $$\begin{aligned}
& & H \! \! = E({\bf k}) \label{H3D} \\
& +& \mathcal{M} ( {\bf k} ) \tau _z \otimes I \! + \! A_1 k_z \tau _x \otimes \sigma _z \! + \!
A_2 (k _x \tau _x + k_y \tau _y) \otimes \sigma _x \nonumber
\label{H0}\end{aligned}$$ where $\sigma _{\nu}$ and $ \tau _{\nu}$ and Pauli matrices, $I$ the unity matrix, $\mathcal{M} ( {\bf k} )$=$M_0 - B_2 (k_x ^2 + k_y
^2)-B_1k_z ^2$, $k_{\pm}$=$k_x \pm i k_y$ and $E({\bf k})$=$ C + D
_1 k_z ^2 + D_2 (k_x ^2+k_y ^2)$. The Hamiltonian is written in the basis $|1>$=$|p1 _z ^+, \uparrow>$, $|2>$=$-i |p2 _z ^- ,
\uparrow>$,$|3>$=$|p1 _z ^+, \downarrow>$, $|4>$= $i|p2 _z ^-,
\downarrow>$, which are the hybridized states of the Se-$p$ orbital and the Bi-$p$ orbital with even $(+)$ and odd $(-)$ parities and spin up ($\uparrow$) and down ($\downarrow$). The Hamiltonian parameters for Bi$_2$Se$_3$ are[@Liu_2010] , $M_0$=0.28$eV$, $A_1$=0.22$eV nm $, $A_2$=0.41$eVnm$, $B_1$=0.10$eV nm ^2$, $B_2$=0.566$eVnm^2$, $C$=-0.0068$eV$, $D_1$=0.013$eV nm ^2$ and $D_2$=0.196$eVnm^2$. In this basis the spin operators get the form[@Silvestrov_2011], $ S_z = I \otimes \sigma _z , \, \, \, S_x = \tau _z \otimes \sigma
_x \,\mathrm{ and} \, \, S_y = \tau _z \otimes \sigma _y $.
Bulk Spin Susceptibility
========================
The paramagnetic susceptibility obtained from the Hamiltonian Eq.\[H3D\] has the form $$\chi _{\mu \mu} ({\bf q}) \! = \! \frac 2 {\Omega} \! \sum _ {
\stackrel { {\scriptstyle n' \, \mathrm{occ.} }}
{ {\scriptstyle n \, \mathrm{empty} }}}
\sum _{ {\bf k }} \frac { | \! < \! n', {\bf {k+q}}| S _{\mu} |n,
{\bf k} \! > \! |^2 } { \varepsilon _{n' ,{\bf k}+{\bf q}} -
\varepsilon _{n ,{\bf k}}} \! . \label{chimumu}$$ Here $|n, {\bf k}>$ and $\varepsilon _{n ,{\bf k}}$ are the eigenfunctions and eigenvalues of Hamiltonian Eq.\[H3D\] and $\Omega$ is the sample volume. In the case of an insulator, this spin susceptibility is caused by the coupling of the valence and conduction band induced by the spin operator[@Vleck_1932]. The susceptibility is a smooth function of the wavevector and because the system is an insulator there are no anomalies associated with Fermi surfaces. The symmetry of the original Hamiltonian dictates that the non-diagonal elements of the susceptibility tensor are zero and $\chi_{xx}= \chi_{yy} \ne
\chi_{zz}$.
![ (Color online) Spin susceptibility as function of the wave vector along the $z$ and the $x$-directions. The arrow indicates the position of the maximum.[]{data-label="chi_qxqz"}](chi_qxqz){width="8.cm"}
In Fig.\[chi\_qxqz\] we plot the $\chi _{xx}$ and $\chi_ {zz}$ as a function of $q_z$ and $q_x$. The direct coupling, $A_2 k_{\pm}$, between atomic orbitals with opposite parities and opposite $z$-component of the spin, makes that for $k_{\pm} \ne 0$, occupied and empty states are coupled through $S_z$. Whereas those states are only connected through $ S_x $ when $k_z \ne 0$. This makes $\chi _{zz} ({\bf q}) > \chi_{xx} ({\bf q})$.
The more important contribution to $\chi _{zz} (q_z )$ comes from regions in the reciprocal space where the matrix elements $ < \! n',
{\bf {k}}+q_z| S _{z} |n, {\bf k} \! >|$, with $n$ occupied and $n'$ empty, reaches the maximum value. This happens when $\mathcal{M} (
{\bf k} )$=$0$ or $\mathcal{M} ( {\bf k}+ q_z)$=$0$. For a given $k_z$ these conditions define two circular crowns of radius $\sqrt{\frac {M_0 - B_1 k_z ^2}{B_2}}$ and $\sqrt{\frac
{M_0 - B_1 (k_z + q_z)^2}{B_2}}$ and thickness $A_2 /(2 B_2)$. Therefore, the area of the reciprocal space that contributes appreciably to $\chi_{zz} (q_z)$ increases with $q_z$. For larger values of $q_z$ one of the circular crowns collapses to zero and the contributions to the integral decrease. This behavior explains qualitatively the maximum that $\chi _{zz}$ presents at a wavevector $G \sim \sqrt{M_0 / B_1}$.
![(Color online)Spin magnetic susceptibility, $\chi_{zz}$, for different values of $M_0$, as function of the momentum in the $z$-direction. All other parameters of the band structure corresponds to those of Bi$_2$Se$_3$. As the value of the mass $M_0$ decreases the position of the maximum of the susceptibility moves towards small values of $q_z$. At small values of $M_0$ the maximum occurs at $q_z=0$. In the normal insulator phase, $M_0 <0$, the maximum of $\chi_{zz}$ occurs at $q_z=0$ for all values of the mass parameter. The dots indicate the position of the maximum.[]{data-label="chizz_M0"}](chizz_M0.pdf){width="8.cm"}
The existence of a maximum in $\chi _{zz} ({\bf q_z})$ at finite $q_z$ is robust against small changes in the parameters of the four bands Hamiltonian. In Fig.\[chizz\_M0\] we plot $\chi _{zz} ({\bf
q_z})$ for different values of the TI gap. The position of the maximum decreases continuously towards $q=0$ when $M_0$ decreases and only disappears for small values of $M_0$. In the normal insulator phase, $M_0 <0$, the maximum always occurs at $q=0$.
Coupling between diluted magnetic impurities
--------------------------------------------
Consider now a TI doped with magnetic impurities of spin $S$. We assume that the number of electrons in the system does not change in the presence of the magnetic impurities. That can be achieved by doping with isoelectronic magnetic dopants or by adding compensating non-magnetic dopants[@Hor_2009]. In this work we consider the dilute limit, i.e. concentration of impurities smaller than 5$\%$, for which the direct interaction between the spin of the magnetic impurities can be neglected.
However, the electrons spins have a strong exchange coupling, $\frac S 2 \tilde{J}(|{\bf r}|)$, with the magnetic impurities spins which, in turn, are equally affected by the exchange field of the electrons. In this form the magnetic impurities in the system interact mediated by electronic states. We treat this interaction in second order perturbation theory[@Dietl_2000; @Brey_2003], that has proved to be a reliable approximation in diluted magnetic semiconductors[@Brey_2003; @Calderon_2002]. In this approach the effective exchange parameter between two magnetic impurities separated by a vector ${\bf R}$ and spins pointing in the $\nu$-direction is, $$J _{\nu}({\bf R})=-\frac {S^2} 4{J_{eff}^2 }{\Omega} \sum _{\bf q}
\chi _{\nu \nu} ({\bf q}) e ^{i {\bf q}{\bf R}}$$ where $J_{eff}= \int \tilde {J} (|{\bf r}|) d {\bf r}$ is the effective exchange coupling between the magnetic impurity and the electron spin.
Because $\chi _{zz} > \chi_{xx}$ in all range of wavevectors, the system has an easy axis of magnetization along the $z$-direction and therefore isoelectronic magnetic impurities in Bi$_2$Se$_3$ will tend to polarize in the $z$-direction. The maximum that the spin susceptibility presents at finite wavevector in the $z$-direction, will determine the existence of non-uniform polarization in magnetically doped TI. We treat the magnetically ordered state in the virtual crystal approximation[@Dietl_2000; @Abolfath_2001; @Brey_2003; @FR_2001], and we consider that the system is invariant in the $(x,y)$-plane, and the polarization only depends on the $z$-direction. In the next section we obtain the magnetic polarization as function of temperature and $z$-coordinate by using a Landau free energy functional.
Landau free energy functional
=============================
We assume that the system is invariant in the $(x,y)$-plane, and allows the polarization to oscillate with period $2\pi/G$ along the $z$-direction. In consequence we define the normalized magnetic polarization, $-1 \le m(z,T) \le 1$, as, $$m(z,T)= m_0(T)+m_G(T) \cos (G z) \, \, \, , \label{mzT}$$ where $m_0$ and $m_G$ are the order parameters of the uniform ferromagnetic (FM) phase and the spin density wave phase (SDW) respectively.
The internal energy per unit volume corresponding to this magnetization is, $$E= - \frac J 2 m_0 ^2 \chi _{zz} (0) - \frac J 4 m_G ^2 \chi
_{zz} (G) \, \,.$$ where $J= \frac {S^2} 4 J ^2 _{eff} c$, being $c$ the density of magnetic impurities. In our case, the value of $\chi _{zz} (G) $ is less than 10$\%$ larger than $\chi _{zz} (0) $ and the zero temperature ground state is a uniform FM phase, $m(z,T=0)=1$. However the maximum of the spin susceptibility at $G$ will modify the spin density at larger temperatures.
Knowing that for small values of the polarization, the entropy of a classical spin at a given $T$ is, see Appendix A, $$-TS=-k_B T \ln(2) + \frac 3 2 k_B T m ^2+ \frac 9 {20} k_B T m^4 \,
\,$$ we get that in the mean field approximation and for small values of magnetic polarization, the Landau free energy per unit volume takes the form, $$\begin{aligned}
\mathcal {F} = - \frac J 2 m_0 ^2 \chi_{zz} (0)- \frac J 4 m_G ^2 \chi_{zz} (G) \nonumber \\
- \frac 1 {\beta} \frac 1 L \int dz \left \{ \ln 2 - \frac 3 2 m ^2
(z,T) - \frac 9 {20} m ^4 (z,T) ... \right \} \, \, ,\end{aligned}$$ where $\beta = 1/k_B T$ and $L$ is the sample dimension in the $z$-direction. Using the expression Eq.\[mzT\], and in the limit $\L \rightarrow \infty$, we get $$\begin{aligned}
\mathcal {F} & = &
\frac 3 2 m_0 ^2 k_B (T - T_0) + \frac 3 4 m_G ^2 k_B (T - T_G) \nonumber \\
& + & k_B T \frac {27}{20} m ^2 _0 m^2 _G + k_B
T \frac {9}{20} m_0 ^4 + k_B T \frac {27}{160} m_G ^4
\label{functional}\end{aligned}$$ where $T_0$ and $T_G$ are the critical temperatures of the pure FM and SDW phases respectively, $$k_B T _0 \! = \! \frac {J}{3} \chi_{zz}(0) \, \, \, \mathrm{and
}\, \, \, k_B T _G \! = \! \frac {J }{3} \chi_{zz}(G) \, \, \, .$$ The phase diagram of a system described by a free energy as that of Eq.\[functional\] depends on the relative magnitudes of the fourth-order potentials[@chaikin_book]. In our case the product of the pre-factors of $m_0 ^4$ and $m_G ^4$ is smaller than the square of the $m_0^2m_G^2$ pre-factor and there is no phase coexistence in the phase diagram. By increasing the temperature, there is a first order transition from the FM phase to the SDW phase at $$T ^* = \frac {\sqrt{3} T_0 - \sqrt{2} T_ G}{\sqrt{3} -\sqrt{2}} \, \, .$$ This is the main result of this work: by heating, a magnetically doped TI undergoes two phase transitions, a FM to SDW first order transition at $T ^*$ and a SDW to paramagnetic second order transition at $T_G$. Although at $T$=0, the FM phase has lower energy than the SDW phase, the FM to SDW transition at finite $T$ occurs because the entropy of the SDW increases faster with $T$ than the entropy of the FM phase.
In the next section we analyze how the surface states existing in topological insulators couple to the bulk magnetic polarization.
Spin polarization of magnetically doped TI slabs
================================================
At the surface of a TI there exists a two dimensional Dirac electron gas. Because the chirality of the electron gas, an exchange field perpendicular to the surface opens a gap in the spectra. Then, in order to minimize the energy, a magnetic impurity will polarize perpendicularly to the surface[@Liu_2009; @Biswas_2010; @Yu_2010; @nunez_2012]. In the diluted limit, surface states mediate an RKKY interaction among the impurities which is always ferromagnetic, whenever the chemical potential resides near the Dirac point[@Liu_2009; @Yu_2010; @nunez_2012; @Brey_2007]. Therefore magnetic impurities at the surface of a TI will order ferromagnetically perpendicular to the surface.
We are going to study numerically the spin polarization as function of temperature and position of a magnetically doped TI slab. The objective here is first to confirm the results obtained with the Landau functional where we consider a unique Fourier component of $\chi_{zz} (q_z)$ and second to analyze the coupling between the surface and the bulk magnetization.
We analyze a TI slab of thickness $L$ and perpendicular to the $z$-direction. We expect the electron affinity of Bi$_2$Se$_3$ to be much larger than its band gap. Therefore, at the surface of the TI we will neglect the penetration of the electron wavefunction into the vacuum. The eigenvalues, $\varepsilon _{n,{\bf k}}$, and wavefunctions, $\Psi _{n, {\bf k}} (z)$, are obtained by solving Eq.\[H3D\] with $k_z = -i\partial _z$ and forcing the wavefunction to vanish at $z=0$ and $z=L$. This is satisfied expanding $\Psi _{n,
{\bf k}} (z)$ in harmonics, $$\Psi _{n, {\bf k}} (z)= \frac {e ^{i {\bf k } {\bf r}}} { \sqrt{A} }
\sqrt { \frac 2 L}\sum _{l =1} ^{N_{\mathrm{max}}} \sum _{ j=1,4 }a
_{n,j} ^l ({\bf k}) \sin {( \frac l L \pi z)} \, \, ,
\label{2Dwf}$$ here $A$ is the sample area and we choose $N_{max}$ large enough so that the results does not depend on it.
For $L>10$nm, the surfaces of the slab are decoupled and the band structure is independent of $L$. In the bulk energy gap region, appear some surface states which are the benchmark of the TI. In Fig.\[surface\_bands\_wf\_mandar1\] we plot the band dispersion and the shape of the wavefunction of these states. The results we obtain agree completely with previous results[@Qi_2011; @Silvestrov_2011].
![ (Color online)In the left panel we plot the band structure of a topological insulator film 30$nm$ thick. For this thickness there is no coupling between localized states on opposite surfaces and surface states are degenerated. Dashed areas denote the bulk band structure. In the right panel we plot the absolute value of the four components of the wavefunction of a surface state with momentum close to zero. []{data-label="surface_bands_wf_mandar1"}](surface_bands_wf_mandar1.pdf){width="8.cm"}
In the slab geometry the momentum in the $z$-direction is not a good quantum number and the paramagnetic susceptibility depends on two position indices $z$ and $z'$. Therefore, in the virtual crystal approximation and in second order perturbation theory, the internal energy of the magnetically doped TI slab is, $$\begin{aligned}
E = \frac J {2 L} \! \int _{0} ^{L} \! \! \! \int _{0}
^{L} \! \!dz dz' \tilde{\chi} ( z,z') m(z) m(z') ,\, \, \, \mathrm{with} \\
\tilde{\chi} (z,z') = \frac 1 A \sum _{n,n', {\bf k } }
\frac { n_F ( \varepsilon _{n ,{\bf k}} )- n_F( \varepsilon _{n' ,{\bf {k}}}) }
{ \varepsilon _{n' ,{\bf {k}}} - \varepsilon _{n ,{\bf k}}} \times \nonumber
\\
\Psi _{n, {\bf k}} ^* (z) S_z \Psi _{n', {\bf k}} (z) \times
\Psi _{n ', {\bf k}} ^* (z') S_z \Psi _{n, {\bf k}}
(z') \, \, ,
\label{chi_2d}\end{aligned}$$ where $n_F(\varepsilon)$ is the Fermi distribution function. $\tilde{\chi} (z,z')$ indicates the coupling between uniform polarized $(x,y)$-planes, located at positions $z$ and $z'$. The interaction between magnetic impurities is mediated by electrons in the system, and because the bulk system is an insulator, the interaction is very short ranged in the $z$-direction, see Fig.\[chizz\].
![ (Color online)$\tilde{\chi} _{zz} (z,z')$ evaluated at the maximum of the surface wavefunction, $z$=1.2nm, and at the center of a 20nm thick slab, as function of $z'$. The first case corresponds to a region near the surface, where the two dimensional Dirac electron system contributes to the response functions. In the latter case the response function is not affected by the surface and it is the bulk response function. In both cases the functions are very peaked at $z$=$z'$. The negative values of the coupling in the bulk response function is a consequence of the maximum that the response function present at $q_z$=$G$ in the reciprocal space. Near the surfaces, and because of their metallic character, the magnetic coupling is stronger. This is reflected in the asymmetry of the dashed line, the interaction between planes is larger as closer the planes are to the surface.[]{data-label="chizz"}](chizz.pdf){width="8.cm"}
![(Color online)Magnetization as a function of temperature for TI slabs of thickness (a) $L=5$nm, (b) $L=10$nm and (c) $L=30$nm. $T_0$ is the bulk FM critical temperature of the topological insulator. The small “step” in the middle of the first order transition that occurs at $L=30$nm is consequence of an interference effect between the surface magnetization and the bulk SDW phase. []{data-label="Mag_T_L"}](Mag_T__L.pdf){width="8.cm"}
![ (Color online)Magnetic polarizations as a function of the position across the topological insulator slab $z$, for different layer thickness and temperatures. []{data-label="MagTz_zz"}](MagTz_zz.pdf){width="8.cm"}
We compute the temperature dependence of the magnetization profile in the mean field approximation. At a given position $z$, the magnetization $ m
(z,T)$ feels a (in energy units) magnetic field, $$B(z) = J \int _0 ^L dz' \tilde{\chi} (z,z') m (z') \, \, ,
\label{beff}$$ and the magnetization of an isolated impurity in the presence of the molecular field is, $$m(z,T)= \coth \left (\frac {B(z)}{k_B T} \right ) -
\frac {k_B T} {B }\, \, . \label{mT}$$ Solving self-consistently Eq.\[beff\] and Eq.\[mT\], we obtain the magnetization profiles as a function of T.
Because the metallic surface states intermediate a RKKY coupling[@Brey_2007; @Liu_2009] at the surface, the response function, $ \tilde \chi(z,z')$ is larger near the surface than in the bulk, see Fig.\[chizz\]. Therefore, as function of $T$, the absolute value of the magnetization decreases faster in the bulk region than in the surface[@Rosenberg_2012]. However, it is important to note that the surface and the bulk are part of a unique system and therefore there is only a [*unique critical temperature*]{}, corresponding to the transition of the paramagnetic phase.
In Fig.\[Mag\_T\_L\] we show the magnetization as function of temperature for TI slabs of thickness $L=5$nm, $L=10$nm and $L=30$nm. We plot the average value of $m(z,T)$, and the value of the magnetization on top of the surface states. In Figure \[MagTz\_zz\], we plot the magnetization profiles for different temperatures and $L=5$nm, $L=10$nm and $L=30$nm.
For $L=10$nm and $L=30$nm the surfaces are practically decoupled and the central part of the slab behaves as bulk. There is a strong jump in the magnetization at $T^*$, that indicates the first order FM to SDW transition. In the SDW phase the oscillating magnetization does not contribute to the total magnetization and the magnetization for $T>T^*$ is due to surface states. In Fig.\[MagTz\_zz\](b)-(c), it is apparent at the center of the slab, the abrupt transition from an uniform magnetization phase to a SDW phase. For smaller thickness of the slab, Fig.\[MagTz\_zz\](a), the surface states are coupled and there is no well defined bulk region, that reflects in the absence of FM to SDW transition.
The magnetization at the surface is practically not affected by the FM to SDW transition, and decays with $T$ continuously to zero. The ferromagnetism at the surface is more robust than in the central part. For temperatures where $m_0$ and $m_G$ are near zero, the surface of the system can be more than 30$\%$ polarized. These results indicate the possibility that the magnetization at the surfaces of TI’s could be finite at temperatures larger than the bulk critical temperatures $T_G$ and $T^*$[@Rosenberg_2012]. Because of the metallic character of the TI surface states, there is a range of temperatures, for which the Dirac-like electron system at the surface of the TI is gapped, although the bulk part of the system is practically unpolarized.
A similar SDW phase has been also obtained numerically by Rosenberg and Franz in a slab geometry of Bi$_2$Se$_3$[@Rosenberg_2012]. However these authors interpret the oscillation of the polarization as spatial fluctuations of the bulk magnetization coupled with the surface magnetization. From our calculation we attribute the oscillations in the magnetization reported in ref.[@Rosenberg_2012] as a signature of the bulk SDW phase.
Final Remarks and Conclusions
=============================
In this work we study the phase diagram of magnetically doped Bi$_2$Se$_3$. At low temperatures the magnetic impurities order ferromagnetically along the $z$-direction. By raising the temperature, the TI undergoes two transitions; A first order transition from the ferromagnetic to the spin density wave phase, and at higher temperatures a second order transition from the spin density wave phase to the paramagnetic phase. This results could explain recent experimental results[@Salman_2012] that suggest the existence, as function of the temperature, of two different magnetic phases in Fe doped Bi$_2$Se$_3$.
We have also studied the effect of the surface states by calculating the magnetization as function of temperature of a slab of Bi$_2$Se$_3$ topological insulator. Here we find that the surface magnetization survives to higher temperatures than the bulk spin density wave phase. The existence of a range of temperatures for which the bulk magnetization practically vanishes whereas a finite magnetization exits at the surface, could explain some experimental results that observe a gap at the surface of Bi$_2$Se$_3$ but not bulk magnetism[@Wray_2010; @Chen_2010].
It is important to analyze the behavior of the phase diagram as function of the gap parameter $M_0$. In Fig.\[Curie\_Temperatures\] we show the phase diagram of a magnetically doped thick TI slab as a function of $M_0$. For $M_0<0$ the system is a normal insulator and there are no surface states. Also the spin orbit coupling is small and the SDW phase does not exist. For $M_0>0$ the system is a TI and the gap increases with $M_0$. TI with larger gaps have more metallic surface states and the FM order at the surface is therefore more robust. Also the effective spin orbit coupling is stronger and both $T^*$ and $T_G$ increase with $M_0$. The results of Fig.\[Curie\_Temperatures\] show that the range of temperatures where the SDW phase exists increases with $M_0$.
![(Color online) Phase diagram of a thick magnetic doped TI, as function of the mass parameter $M_0$. []{data-label="Curie_Temperatures"}](Curie_Temperatures.pdf){width="8.5cm"}
Finally we make an estimation of the critical temperature. From the band structure parameters of Bi$_2$Se$_3$, choosing the density of the magnetic impurities to be 5$\times$10$^{20}$cm$^{-3}$, the total angular momentum of a single magnetic ion to be $S=3/2$ and the effective exchange coupling $J_{eff}$ =250$meV nm^3$[@Yu_2010] we obtain $T_G ^{bulk} \approx$18$K$. This values can change by factors of two by changing the magnetic ions or the density of impurities. It is well known that the mean-field approximations tend to overestimate the transition temperature due to the neglect of the fluctuations. In diluted magnetic semiconductors thermal fluctuations reduce the value of the Curie temperature in near 30$\%$[@Brey_2003],and we expect a similar reduction in topological insulators.
We are very grateful to P.G.Silvestrov who call our attention on the correct definition of the spin matrices. We also acknowledge fruitful discussion with E.Chacón, H.A.Fertig and A.H.MacDonald. Funding for this work was provided by MICINN-Spain via grant FIS2009-08744.
Mean Field Expression for the Entropy.
======================================
In this section we obtain an expression for the entropy of a system of classical spins of magnetization $m$, that are coupled with the topological insulator trough a general term $E[m]$.
The Free Energy of a system of classical spins of magnitude unity in an external magnetic field $h$ is $$\mathcal{F}= - \frac{1}{\beta}\ln \left ( 2 \frac{\sinh(\beta h
)}{\beta h } \right ) \,,$$ from where the magnetization can be calculated as $$m \equiv <m> = - \frac{\partial \mathcal{F} }{\partial h } =
\frac{1}{\tanh ( \beta h)} -\frac{1}{\beta h} \,.
\label{magnetization}$$
The entropy of the spin system is then $$-TS= \mathcal{F} - m h = \frac{1}{\beta} \left ( - \ln \left ( 2
\frac{\sinh ( \beta h )}{\beta h } \right ) - m \beta h \right )
\,.$$ The total energy of the system is $$\mathcal{F} ^{total} =E[m]-TS=E[m]-\frac 1 {\beta}\left [\ln \left (
2 \frac {\sinh (\beta h)} {\beta h} \right ) + m \beta h \right ]$$ where $E[m]$ is the change in the electronic energy of the system because of the polarization of the magnetic impurities.
To obtain $h$, we minimize the total free energy with respect to $h$, $\partial \mathcal{F} ^{\rm total}/\partial h =0$. In the limit of small $h$ $$\ln ( 2 \frac{\sinh ( \beta h ) }{\beta h }) \simeq \ln ( 2) +
\frac{( \beta h ) ^2 }{6}- \frac {(\beta h ) ^4}{180} + ...$$ In this limit, the minimization condition gives $\beta h = -3
m-\frac 3 5 m^3+...$, and the entropy gets the form $$-TS = - k_B T \ln (2) + \frac{3}{2}k_{\rm B} T m ^2 +
\frac{9}{20}k_{\rm B} T m ^4.$$
[40]{} natexlab\#1[\#1]{}bibnamefont \#1[\#1]{}bibfnamefont \#1[\#1]{}citenamefont \#1[\#1]{}url \#1[`#1`]{}urlprefix\[2\][\#2]{} \[2\]\[\][[\#2](#2)]{}
, ****, ().
, ****, ().
, ****, ().
, ****, ().
, ****, ().
, ****, ().
, , , , , ****, ().
, , , ****, ().
, , , ****, ().
, , , , , ****, ().
, ****, ().
, , , , , , ****, ().
, ****, ().
, ****, ().
, , , , ****, ().
, ****, ().
, , , ****, ().
, ****, ().
, ****, ().
, ****, ().
, ****, ().
, , , , , , , , , , , (), .
, , , , , , , , , , , (), .
, , , , , , , (), .
, , , , , ****, ().
, , , , , , , , , , (), .
, , , ****, ().
, , , , , , ****, ().
, , (), <arXiv.org:1111.3650>.
, ** (, ).
, , , , , , , , , ****, ().
, , , , , ****, ().
, ****, ().
, , , ****, ().
, , , , ****, ().
, ****, ().
, ** (, , ).
, , , ****, ().
, ****, ().
, , , , , , , , , , (), .
|
Q:
Cannot solve Ubongo Extreme B-38 purple puzzle
Today, I was playing Ubongo Extreme and I could NOT solve the following puzzle:
B-38, purple colour.
Let me know if you can solve it!
A:
Given that the pieces are reversible (see comment from Jefromi):
You just have to flip piece 3 over, then arrange them like so:
|
Facing questions over the privacy and security of the Aadhaar systems in the Supreme Court, the government has decided to conduct an independent audit of all 50,000-odd Aadhaar enrolment centres and inspect them in person.Three independent auditors will assess if enrolment centres are adhering to UIDAI processes and guidelines, if the hardware and software deployed at the enrolment centres are as per UIDAI specifications and check if the enrolment centre is not involved in any corrupt practices and people are not being overcharged for Aadhaar services.Photographs of all staff at the enrolment centre and equipment will be taken and a 5-10 minute video be shot of the ongoing enrolment and update process at the Centre. The three auditors would be allotted 10,000 centres apiece in the first year for the job. The auditors will assess if supervisors and verifiers are present at each enrolment centre to help and guide residents, if the original documents of the resident are scanned and reviewed as per UIDAI guidelines without retaining their hard copies, if the behaviour with the resident is courteous and if the centre is covered by CCTVs.Law and IT minister Ravi Shankar Prasad in an interview to ET last year had said that government planned to appoint auditors across the country to inspect Aadhaar’s systems. The Aadhaar Act, 2016, provides for the same. UIDAI has engaged enrolment agencies as registrars who have set up enrolment centres by hiring operators and supervisors and UIDAI recommended hardware. There have been concerns raised in the past over how the registrars are capturing demographic and biometric detail of residents and uploading them to UIDAI’s Central Identification Data Depository. UIDAI has claimed its systems are secure and it will pass the ‘privacy test’ before SC.UIDAI is also launching a major information drive to impress upon people the benefits of linking their Aadhaar with their bank account, PAN, mobile number or ration cards and put to rest security concerns. In a brief for private agencies to make short films, UIDAI says there have been “wild allegations that CIA has gained access to Aadhaar data” and said nothing could be more untrue.“Even if someone gets hold of a machine on which enrolment took place, it will take a billion years to crack open a single encrypted Aadhaar data packet. So Aadhaar is safe,” says the brief reviewed by ET.The brief further says that linking one’s bank account with Aadhaar “opens a new world of digital payments” and a person can withdraw funds from such a bank account just by using his Aadhaar number and fingerprint. It also claims by linking mobile with Aadhaar, a host of servicessuchase-filingof I-Treturnscan be availed from the comfort of one’s home and one can be rest assured that “no one will be able to forge their identity to obtain a mobile SIM, which can be used to perpetrate frauds or crimes”. The brief stresses that UIDAI does not share Aadhaar details with any entity and databases of banks and telecom firms are not interconnected.“Linking Aadhaar with Mobile SIM will only secure your mobile connection, nothing else,” it says. “Your Aadhaar number can be used to make or receive payments, but to do so, the person will need to have a fingerprint if using an Aadhaar-enabled micro-ATM,” the UIDAI brief says. |
using System;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using static PKHeX.Core.MessageStrings;
namespace PKHeX.Core
{
/// <summary>
/// Logic for converting a <see cref="PKM"/> from one generation specific format to another.
/// </summary>
public static class PKMConverter
{
public static void SetPrimaryTrainer(ITrainerInfo t)
{
Trainer = t;
if (t is IRegionOrigin o)
Trainer67 = o;
}
private static ITrainerInfo Trainer { get; set; } = new SimpleTrainerInfo();
private static IRegionOrigin Trainer67 { get; set; } = new SimpleTrainerInfo(GameVersion.SN);
public static string OT_Name => Trainer.OT;
public static int OT_Gender => Trainer.Gender;
public static int Language => Trainer.Language;
public static int Format => Trainer.Generation;
public static int Game => Trainer.Game;
public static bool AllowIncompatibleConversion { private get; set; }
public static void SetConsoleRegionData3DS(IGeoTrack pkm)
{
var trainer = Trainer is IRegionOrigin r ? r : Trainer67;
pkm.ConsoleRegion = trainer.ConsoleRegion;
pkm.Country = trainer.Country;
pkm.Region = trainer.Region;
}
public static void SetFirstCountryRegion(IGeoTrack pkm)
{
var trainer = Trainer is IRegionOrigin r ? r : Trainer67;
pkm.Geo1_Country = trainer.Country;
pkm.Geo1_Region = trainer.Region;
}
/// <summary>
/// Gets the generation of the Pokemon data.
/// </summary>
/// <param name="data">Raw data representing a Pokemon.</param>
/// <returns>An integer indicating the generation of the PKM file, or -1 if the data is invalid.</returns>
public static int GetPKMDataFormat(byte[] data)
{
if (!PKX.IsPKM(data.Length))
return -1;
switch (data.Length)
{
case PokeCrypto.SIZE_1JLIST:
case PokeCrypto.SIZE_1ULIST:
return 1;
case PokeCrypto.SIZE_2ULIST:
case PokeCrypto.SIZE_2JLIST:
return 2;
case PokeCrypto.SIZE_3PARTY:
case PokeCrypto.SIZE_3STORED:
case PokeCrypto.SIZE_3CSTORED:
case PokeCrypto.SIZE_3XSTORED:
return 3;
case PokeCrypto.SIZE_4PARTY:
case PokeCrypto.SIZE_4STORED:
case PokeCrypto.SIZE_5PARTY:
if ((BitConverter.ToUInt16(data, 0x4) == 0) && (BitConverter.ToUInt16(data, 0x80) >= 0x3333 || data[0x5F] >= 0x10) && BitConverter.ToUInt16(data, 0x46) == 0) // PK5
return 5;
return 4;
case PokeCrypto.SIZE_6STORED:
return 6;
case PokeCrypto.SIZE_6PARTY: // collision with PGT, same size.
if (BitConverter.ToUInt16(data, 0x4) != 0) // Bad Sanity?
return -1;
if (BitConverter.ToUInt32(data, 0x06) == PokeCrypto.GetCHK(data))
return 6;
if (BitConverter.ToUInt16(data, 0x58) != 0) // Encrypted?
{
for (int i = data.Length - 0x10; i < data.Length; i++) // 0x10 of 00's at the end != PK6
{
if (data[i] != 0)
return 6;
}
return -1;
}
return 6;
case PokeCrypto.SIZE_8PARTY:
case PokeCrypto.SIZE_8STORED:
return 8;
default:
return -1;
}
}
/// <summary>
/// Creates an instance of <see cref="PKM"/> from the given data.
/// </summary>
/// <param name="data">Raw data of the Pokemon file.</param>
/// <param name="prefer">Optional identifier for the preferred generation. Usually the generation of the destination save file.</param>
/// <returns>An instance of <see cref="PKM"/> created from the given <paramref name="data"/>, or null if <paramref name="data"/> is invalid.</returns>
public static PKM? GetPKMfromBytes(byte[] data, int prefer = 7)
{
int format = GetPKMDataFormat(data);
switch (format)
{
case 1:
var list1 = new PokeList1(data);
return list1[0];
case 2:
var list2 = new PokeList2(data);
return list2[0];
case 3:
return data.Length switch
{
PokeCrypto.SIZE_3CSTORED => new CK3(data),
PokeCrypto.SIZE_3XSTORED => new XK3(data),
_ => new PK3(data)
};
case 4:
if (BitConverter.ToUInt16(data, 0x04) != 0)
return new BK4(data);
return new PK4(data);
case 5:
return new PK5(data);
case 6:
var pkx = new PK6(data);
return CheckPKMFormat7(pkx, prefer);
case 8:
return new PK8(data);
default:
return null;
}
}
/// <summary>
/// Checks if the input PK6 file is really a PK7, if so, updates the object.
/// </summary>
/// <param name="pk">PKM to check</param>
/// <param name="prefer">Prefer a certain generation over another</param>
/// <returns>Updated PKM if actually PK7</returns>
private static G6PKM CheckPKMFormat7(PK6 pk, int prefer)
{
if (GameVersion.Gen7b.Contains(pk.Version))
return new PB7(pk.Data);
if (IsPK6FormatReallyPK7(pk, prefer))
return new PK7(pk.Data);
return pk;
}
/// <summary>
/// Checks if the input PK6 file is really a PK7.
/// </summary>
/// <param name="pk">PK6 to check</param>
/// <param name="preferredFormat">Prefer a certain generation over another</param>
/// <returns>Boolean is a PK7</returns>
private static bool IsPK6FormatReallyPK7(PK6 pk, int preferredFormat)
{
if (pk.Version > Legal.MaxGameID_6)
return true;
// Check Ranges
if (pk.Species > Legal.MaxSpeciesID_6)
return true;
if (pk.Moves.Any(move => move > Legal.MaxMoveID_6_AO))
return true;
if (pk.RelearnMoves.Any(move => move > Legal.MaxMoveID_6_AO))
return true;
if (pk.Ability > Legal.MaxAbilityID_6_AO)
return true;
if (pk.HeldItem > Legal.MaxItemID_6_AO)
return true;
int et = pk.EncounterType;
if (et != 0)
{
if (pk.CurrentLevel < 100) // can't be hyper trained
return false;
if (!pk.Gen4) // can't have encounter type
return true;
if (et > 24) // invalid gen4 EncounterType
return true;
}
int mb = BitConverter.ToUInt16(pk.Data, 0x16);
if (mb > 0xAAA)
return false;
for (int i = 0; i < 6; i++)
{
if ((mb >> (i << 1) & 3) == 3) // markings are 10 or 01 (or 00), never 11
return false;
}
if (pk.Data[0x2A] > 20) // ResortEventStatus is always < 20
return false;
return preferredFormat > 6;
}
/// <summary>
/// Checks if the input <see cref="PKM"/> file is capable of being converted to the desired format.
/// </summary>
/// <param name="pk"></param>
/// <param name="format"></param>
/// <returns></returns>
public static bool IsConvertibleToFormat(PKM pk, int format)
{
if (pk.Format >= 3 && pk.Format > format)
return false; // pk3->upward can't go backwards
if (pk.Format <= 2 && format > 2 && format < 7)
return false; // pk1/2->upward has to be 7 or greater
return true;
}
/// <summary>
/// Converts a PKM from one Generation format to another. If it matches the destination format, the conversion will automatically return.
/// </summary>
/// <param name="pk">PKM to convert</param>
/// <param name="destType">Format/Type to convert to</param>
/// <param name="comment">Comments regarding the transfer's success/failure</param>
/// <returns>Converted PKM</returns>
public static PKM? ConvertToType(PKM pk, Type destType, out string comment)
{
Type fromType = pk.GetType();
if (fromType == destType)
{
comment = "No need to convert, current format matches requested format.";
return pk;
}
var pkm = ConvertPKM(pk, destType, fromType, out comment);
if (!AllowIncompatibleConversion || pkm != null)
return pkm;
// Try Incompatible Conversion
pkm = GetBlank(destType);
pk.TransferPropertiesWithReflection(pkm);
if (!IsPKMCompatibleWithModifications(pkm))
return null;
comment = "Converted via reflection.";
return pkm;
}
private static PKM? ConvertPKM(PKM pk, Type destType, Type srcType, out string comment)
{
if (IsNotTransferable(pk, out comment))
return null;
string destName = destType.Name;
string srcName = srcType.Name;
Debug.WriteLine($"Trying to convert {srcName} to {destName}.");
int destGeneration = destName.Last() - '0';
var pkm = ConvertPKM(pk, destType, destGeneration, ref comment);
var msg = pkm == null ? MsgPKMConvertFailFormat : MsgPKMConvertSuccess;
var formatted = string.Format(msg, srcName, destName);
comment = comment.Length != 0 ? formatted : string.Concat(formatted, Environment.NewLine, comment);
return pkm;
}
private static PKM? ConvertPKM(PKM pk, Type destType, int destGeneration, ref string comment)
{
PKM? pkm = pk.Clone();
if (pkm.IsEgg)
pkm.ForceHatchPKM();
while (true)
{
pkm = IntermediaryConvert(pkm, destType, destGeneration, ref comment);
if (pkm == null) // fail convert
return null;
if (pkm.GetType() == destType) // finish convert
return pkm;
}
}
private static PKM? IntermediaryConvert(PKM pk, Type destType, int destGeneration, ref string comment)
{
switch (pk)
{
// Non-sequential
case PK1 pk1 when destGeneration > 2: return pk1.ConvertToPK7();
case PK2 pk2 when destGeneration > 2: return pk2.ConvertToPK7();
case PK3 pk3 when destType == typeof(CK3): return pk3.ConvertToCK3();
case PK3 pk3 when destType == typeof(XK3): return pk3.ConvertToXK3();
case PK4 pk4 when destType == typeof(BK4): return pk4.ConvertToBK4();
// Invalid
case PK2 pk2 when pk.Species > Legal.MaxSpeciesID_1:
var lang = pk2.Japanese ? (int)LanguageID.Japanese : (int)LanguageID.English;
var name = SpeciesName.GetSpeciesName(pk2.Species, lang);
comment = string.Format(MsgPKMConvertFailFormat, name, destType.Name);
return null;
// Sequential
case PK1 pk1: return pk1.ConvertToPK2();
case PK2 pk2: return pk2.ConvertToPK1();
case CK3 ck3: return ck3.ConvertToPK3();
case XK3 xk3: return xk3.ConvertToPK3();
case PK3 pk3: return pk3.ConvertToPK4();
case BK4 bk4: return bk4.ConvertToPK4();
case PK4 pk4: return pk4.ConvertToPK5();
case PK5 pk5: return pk5.ConvertToPK6();
case PK6 pk6: return pk6.ConvertToPK7();
case PK7 pk7: return pk7.ConvertToPK8();
case PB7 pb7: return pb7.ConvertToPK8();
// None
default:
comment = MsgPKMConvertFailNoMethod;
return null;
}
}
/// <summary>
/// Checks to see if a PKM is transferable relative to in-game restrictions and <see cref="PKM.AltForm"/>.
/// </summary>
/// <param name="pk">PKM to convert</param>
/// <param name="comment">Comment indicating why the <see cref="PKM"/> is not transferable.</param>
/// <returns>Indication if Not Transferable</returns>
private static bool IsNotTransferable(PKM pk, out string comment)
{
switch (pk.Species)
{
default:
comment = string.Empty;
return false;
case 025 when pk.AltForm != 0 && pk.Gen6: // Cosplay Pikachu
case 172 when pk.AltForm != 0 && pk.Gen4: // Spiky Eared Pichu
case 025 when pk.AltForm == 8 && pk.LGPE: // Buddy Pikachu
case 133 when pk.AltForm == 1 && pk.LGPE: // Buddy Eevee
comment = MsgPKMConvertFailForme;
return true;
}
}
/// <summary>
/// Checks if the <see cref="PKM"/> is compatible with the input <see cref="PKM"/>, and makes any necessary modifications to force compatibility.
/// </summary>
/// <remarks>Should only be used when forcing a backwards conversion to sanitize the PKM fields to the target format.
/// If the PKM is compatible, some properties may be forced to sanitized values.</remarks>
/// <param name="pk">PKM input that is to be sanity checked.</param>
/// <returns>Indication whether or not the PKM is compatible.</returns>
public static bool IsPKMCompatibleWithModifications(PKM pk) => IsPKMCompatibleWithModifications(pk, pk);
public static bool IsPKMCompatibleWithModifications(PKM pk, IGameValueLimit limit)
{
if (pk.Species > limit.MaxSpeciesID)
return false;
if (pk.HeldItem > limit.MaxItemID)
pk.HeldItem = 0;
if (pk.Nickname.Length > limit.NickLength)
pk.Nickname = pk.Nickname.Substring(0, pk.NickLength);
if (pk.OT_Name.Length > limit.OTLength)
pk.OT_Name = pk.OT_Name.Substring(0, pk.OTLength);
if (pk.Moves.Any(move => move > limit.MaxMoveID))
pk.ClearInvalidMoves();
if (pk.EVs.Any(ev => ev > limit.MaxEV))
pk.EVs = pk.EVs.Select(ev => Math.Min(limit.MaxEV, ev)).ToArray();
if (pk.IVs.Any(iv => iv > limit.MaxIV))
pk.IVs = pk.IVs.Select(iv => Math.Min(limit.MaxIV, iv)).ToArray();
return true;
}
/// <summary>
/// Checks if the input <see cref="PKM"/> is compatible with the target <see cref="PKM"/>.
/// </summary>
/// <param name="pk">Input to check -> update/sanitize</param>
/// <param name="target">Target type PKM with misc properties accessible for checking.</param>
/// <param name="c">Comment output</param>
/// <param name="pkm">Output compatible PKM</param>
/// <returns>Indication if the input is (now) compatible with the target.</returns>
public static bool TryMakePKMCompatible(PKM pk, PKM target, out string c, out PKM pkm)
{
if (!IsConvertibleToFormat(pk, target.Format))
{
pkm = target;
c = string.Format(MsgPKMConvertFailBackwards, pk.GetType().Name, target.Format);
if (!AllowIncompatibleConversion)
return false;
}
if (IsIncompatibleGB(target.Format, target.Japanese, pk.Japanese))
{
pkm = target;
c = GetIncompatibleGBMessage(pk, target.Japanese);
return false;
}
var convert = ConvertToType(pk, target.GetType(), out c);
if (convert == null)
{
pkm = target;
return false;
}
pkm = convert;
Debug.WriteLine(c);
return true;
}
public static string GetIncompatibleGBMessage(PKM pk, bool destJapanese)
{
var src = destJapanese ? MsgPKMConvertInternational : MsgPKMConvertJapanese;
var dest = !destJapanese ? MsgPKMConvertInternational : MsgPKMConvertJapanese;
return string.Format(MsgPKMConvertIncompatible, src, pk.GetType().Name, dest);
}
public static bool IsIncompatibleGB(int format, bool destJapanese, bool srcJapanese) => format <= 2 && destJapanese != srcJapanese;
/// <summary>
/// Gets a Blank <see cref="PKM"/> object of the specified type.
/// </summary>
/// <param name="type">Type of <see cref="PKM"/> instance desired.</param>
/// <returns>New instance of a blank <see cref="PKM"/> object.</returns>
public static PKM GetBlank(Type type)
{
var constructors = type.GetTypeInfo().DeclaredConstructors.Where(z => !z.IsStatic);
var argCount = constructors.Min(z => z.GetParameters().Length);
return (PKM)Activator.CreateInstance(type, new object[argCount]);
}
public static PKM GetBlank(int gen, GameVersion ver)
{
if (gen == 7 && GameVersion.Gen7b.Contains(ver))
return new PB7();
return GetBlank(gen);
}
public static PKM GetBlank(int gen, int ver) => GetBlank(gen, (GameVersion) ver);
public static PKM GetBlank(int gen)
{
var type = Type.GetType($"PKHeX.Core.PK{gen}");
return GetBlank(type);
}
}
}
|
This week, the present US Secretary of State, Rex Tillerson, during his trip to five Latin American nations, made headlines world wide when he made the following barely veiled threatening statement, “In the history of Venezuela and South American countries, it is often times that the military is the agent of change when things are so bad, and the leadership can no longer serve the people.” and shortly afterward referring to the elected president of Venezuela, Nicolas Maduro added,
“If the kitchen gets a little too hot for him, I am sure that he’s got some friends over in Cuba that could give him a nice hacienda on the beach and he could have a nice life over there.”
There are few countries in Latin America that have not experienced the USA both secretly and overtly backing a right wing military government coup.[1]
The US Secretary of State’s criminally insane back handed remarks favoring a civil war, with all the probable loss of lives a civil war would bring, seems to fit as appropriate within a US foreign policy of world domination. Human suffering has never been of any consequence to the financial interests of that 1/10 of 1 per cent of Americans who, to one degree or another, rule us all.
That is the way it has been since the end of the Second World War, a war made possible by US investments and joint ventures in the rearming of Nazi Germany,[ 2] a war that made the USA rich and the first all powerful single superpower.
Now that China is about to replace the USA as the most powerful economy in the world,[3] maybe the days of such arrogance from a US Secretary of State are numbered, though the all powerful criminal media owned by the US military industrial complex would have us think otherwise. The CIA overseen mainstream media is preparing its audience for a probable future ‘necessary’ war with US designated ‘adversaries’ Russia and China.
However, although ‘Might makes right!’ might continue to prove to be axiomatic and to assure US capability to make war whenever and wherever, there is a countering ultimate truth that whoever has the most money can buy the most guns. Also worth noting is that overspending on one’s military could lead to the demise experienced by the now non-existent Soviet Union.
There is something else that has made this archival research peoples historian wonder, and that is the prevalent assumption that the US and its allied neocolonial powers will forever continue to get away with mass murder and genocide.
That there be no law against invading other countries the way the USA has done to so many dozens of vulnerable Third World nations. At Nuremberg in 1945, Nazi Germans and Japanese leaders were held legally accountable for their much shorter run at doing the same as Americans have been doing since these principles were universally signed on to. It is also worth remembering that according to the long since universally adopted Nuremberg Principles of International Law, every single soldier following illegal orders to invade or bomb shall be tried as criminally responsible for his actions.[4]
Back in 1991, former US Attorney General Ramsey Clark wrote, “US Foreign Policy is the Greatest Crime Since WWII,” in his book, The Fire This Time – US War Crimes in the Gulf, in which, Attorney Clark sites specific crimes in dozens of nations bombed and invaded by Americans since WW II[5]. Thirteen years later, back in Iraq for the crimes of a second President Bush, Clark declared, that
“American aggression had already created incalculable levels of “misery for the world”; that “the poor of the planet [are] made poorer, dominated and exploited by the foreign policies of the U.S. and its rich allies;” that “the U.S. invasion of Iraq was a war of aggression, an offense called ‘the supreme international crime’ in the Nuremberg Judgment.”
The question arises, ‘how long can indescribably enormous crimes go unpunished?’ How long can the human race, so phenomenally accomplished in science and art, in space exploration and medicine, afford to let this unearthly criminal insanity continue – an indescribably idiotic wholesale extermination of millions of children, women and men?
Yours truly, just back from a month in China, as guest of his students of thirty years ago and marveling on the calm, warm, intelligent and joyful behavior of people throughout all levels of society, tuned in on C-Span Public TV Channels to watch the US Senate Committee on Foreign Relations and the US House of Representatives Armed Services Committee discuss the “present day threats to American interests world wide,” and the eighteen year and failing occupation war in Afghanistan. It was embarrassingly amazing to listen to government officials tossing outright fabrications back and forth while continually congratulating one and another obsequiously on ‘each other’s fine service in protecting our great country.’ Freaky! People who are really great, don’t need to keep telling each other and everyone else how great they are.
Seems, when time runs out on ‘exceptional America,’ a very considerable amount of Americans should be able to escape being put in the dock, by simply claiming, with good proof, criminal insanity. |
Section 40
Search
General Laws
Go Directly to a General Law
Section 40: Service of new warrant of commitment upon convict
Section 40. If a convict imprisoned under sentence is again sentenced to confinement in a prison other than that in which he is then held, the warrant for his commitment in pursuance of the second sentence shall be placed in the hands of the superintendent or keeper of the prison where the convict is held, and said superintendent or keeper, upon the expiration of the first sentence, shall commit the convict in obedience to said warrant. |
Q:
What does ~ means in Java?
Searching on the documentation of Node in JavaFX i walked through this method:
/**
* Set all dirty bits
*/
private void setDirty() {
dirtyBits = ~0;
}
//where dirtyBits is an int
I have searched on search engine but can't find what ~ means?
A:
Is a the unary bitwise operator, changes in binary each 0 by 1 and each 1 by 0
From documentation
The unary bitwise complement operator "~" inverts a bit pattern; it can be applied to any of the integral types, making every "0" a "1" and every "1" a "0".
For example, a byte contains 8 bits; applying this operator to a value whose bit pattern is 00000000 would change its pattern to 11111111.
As stated in comments, problem of this is not lack of effort by user either documentation but problem of the search engines like google because remove punctuation symbols (like ~) when searching.
For people like me, non English native speakers is a real problem sometimes to find the correct words. In order to avoid this, in this case, you can search java bitwise operator for further info.
|
External coaptation.
The goal of any method of fracture repair should be the early return of total limb function and the prevention of fracture disease. This can be accomplished through adhering to the basic principles of good patient and fracture assessment, choosing the correct method of fracture repair, and appropriate patient care. The complications of external coaptation can be minimized by appropriate patient and fracture assessment as well as correct cast and splint application. Choosing external coaptation as a method of fracture repair can be rewarding as long as the appropriate steps are taken to ensure success. |
/*
* Copyright (C) 2016 Simon Fels <morphis@gravedo.de>
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 3, as published
* by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranties of
* MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include <iostream>
#include "anbox/logger.h"
#include "anbox/runtime.h"
namespace {
// exception_safe_run runs service, catching all exceptions and
// restarting operation until an explicit shutdown has been requested.
//
// TODO(tvoss): Catching all exceptions is risky as they might signal
// unrecoverable
// errors. We should enable calling code to decide whether an exception should
// be considered
// fatal or not.
void exception_safe_run(boost::asio::io_service& service) {
while (true) {
try {
service.run();
// a clean return from run only happens in case of
// stop() being called (we are keeping the service alive with
// a service::work instance).
break;
} catch (const std::exception& e) {
ERROR("%s", e.what());
} catch (...) {
ERROR("Unknown exception caught while executing boost::asio::io_service");
}
}
}
}
namespace anbox {
std::shared_ptr<Runtime> Runtime::create(std::uint32_t pool_size) {
return std::shared_ptr<Runtime>(new Runtime(pool_size));
}
Runtime::Runtime(std::uint32_t pool_size)
: pool_size_{pool_size},
#if BOOST_VERSION >= 106600
service_{static_cast<int>(pool_size_)},
#else
service_{pool_size_},
#endif
strand_{service_},
keep_alive_{service_} {}
Runtime::~Runtime() noexcept(true) {
try {
stop();
} catch (...) {
// Dropping all exceptions to satisfy the nothrow guarantee.
}
}
void Runtime::start() {
for (unsigned int i = 0; i < pool_size_; i++)
workers_.push_back(std::thread{exception_safe_run, std::ref(service_)});
}
void Runtime::stop() {
service_.stop();
for (auto& worker : workers_)
if (worker.joinable())
worker.join();
}
std::function<void(std::function<void()>)> Runtime::to_dispatcher_functional() {
// We have to make sure that we stay alive for as long as
// calling code requires the dispatcher to work.
auto sp = shared_from_this();
return [sp](std::function<void()> task) { sp->strand_.post(task); };
}
boost::asio::io_service& Runtime::service() { return service_; }
} // namespace anbox
|
Kaleem the boy with large hands
Unfortunately abnormalities happen sometimes, due to the quality of life and lack of resources in some areas around the world—some suffer greatly. Every aspect of daily life is a struggle; and for those who cannot afford healthcare, they certainly have a rough road ahead for them.
Meet 8 year old Kaleem from India, this young boy suffers from an extraordinarily rare condition where his hands are severely overgrown. The top part of his chest also seems to suffer protruding outwards.
Kaleem had over-sized hands at birth being twice the size of a normal child. His hands are now 13 inches from the bottom to his palm and from the tip of his middle finger. He has problems feeding himself because he cannot do routine tasks such as opening a bottle. Kaleem is also teased from other children who point fingers at him.
His father Shamin mentioned: “The headmaster told him to put into writing that the school would not be held responsible—if the other children were afraid of his hands or bullied and laughed at him.”
Kaleem said he doesn’t go to school now, because the teacher said the other children are scared of his hands. He has even been threatened by other children who said they would beat up him from his deformations.
Kaleem’s family desperately wants to help their child but cannot afford to do so. After they spoke with a Dr. Krishan Chugh near Dehli, he mentioned that the increased growth rate from his hands could damage his cardiovascular system.
His guess is this is a very rare case of acromegaly. This would shorten his life by quite a bit. Kaleem’s parents are quite poor earning only 15£ a month. This has left them without many options. After learning more, a donation has been established to help Kaleem.
Loading...
Related
Began his blogging career writing about movies. After further study about different paranormal encounters, he decided spend more time researching about them. Along the way, he has met many people from all walks of life. His open minded theories about various topics give him a different perspective in his writings. |
Oncore Cables provides the best customized fiber and copper solutions while offering a wide selection of stock products. Although we are known for our quick turnaround, we have established a reputation for having quality cables at a competitive price. Our products, which include assemblies in Cat5e, Cat6 and 6a, 10 gigabit laser-optimized and standard 50 micron multimode, 62.5/125 multimode, singlemode and mode conditioning cables are all invidually tested and guaranteed for a lifetime. We also stock every combination of cables with LC, SC, ST and MTRJ connectors and we can build to order almost any custom cable assembly. Cables are also available in custom lengths, colors, environmental specifications, and various multi-fiber cable configurations and combinations according to your needs. |
You currently have javascript disabled. Several functions may not work. Please re-enable javascript to access full functionality.
Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.
This morning it was fine and I got the error while running a scan. I then restarted the scan and it went fine. I don't know what to think.
I read the other post that all pointed to the same solution to uninstall and install the latest release. But I can't because it is a part of the OS. Also I read an article that said the same thing but it was from the end of 2007 I think.
I use XP, but look under Services & see if the Windows Defender Service Startup is set to Automatic & that Log -On is set to Enabled. If no luck, or if the problem keeps occurring, you may have to disable it & keep it from running at start-up. |
Liverpool's title challenge ultimately fell short as Manchester City stole in to take the crown in the final week of the season. Regardless of that late disappointment, Champions League football is finally returning to Anfield, and manager Brendan Rodgers will need to strengthen his squad if Liverpool are to compete domestically and in Europe.
There is bound to be a large transfer kitty at Rodgers' disposal this summer, and with the World Cup on the horizon, there will be a number of players catching his eye. Here are five players who will be playing in Group G that could be on Rodgers' radar this summer...
After Simon Mignolet endured an inconsistent first season at Anfield, and it's believed that Rodgers is looking to add another goalkeeper to push the Belgian. One of the names linked with a move to Merseyside is former Manchester United stopper is Zieler. Unlikely to play much of a part at the World Cup unless Manuel Neuer is injured or suspended, the Hannover goalkeeper has developed into a consistent player since leaving Old Trafford.
One of the more ambitious moves Liverpool could make this summer is to sign Bayern Munich forward Muller. The 24-year-old could leave the Allianz Arena, and whilst Manchester United are believed to be interested, Liverpool can offer Champions League football as they look to make their attack even more deadly. Alongside the likes of Luis Suarez, Daniel Sturridge and Raheem Sterling, the Reds would be all but unstoppable.
Even after the capture of Bayer Leverkusen's Emre Can, Liverpool could still look to add more midfielders - particularly if Lucas Leiva or Joe Allen decide to leave the club. A reported target is Udinese's Agyemang-Badu, who at just 23, has the best years of his career ahead of him. An energetic midfielder who has a reputation for scoring goals from range, the Ghanaian could be a valuable addition.
Andre Ayew, Ghana
If Muller proves to be too expensive or he decides to stay with Bayern, the Reds may rekindle their interest in Marseille's Ayew. The French club have to sell this summer, and Ghanaian winger Ayew could be a bargain for the Reds. The 24-year-old declared his intention to move to Liverpool last summer, and having hit 49 goals in four seasons, Rodgers could add Ayew to his already fearsome frontline.
If Rodgers does look to add another midfield player, then they may vie with Manchester United for the signature of Sporting Lisbon's Carvalho. The 22-year-old Angolan-born anchorman has had a superb season in Portugal and is widely expected to continue his great form into the World Cup. He reportedly has a £37m price tag on his head, but his potential is huge - and he looks to be ideal for the Premier League.
Olly Dawes
Olly is a Sports Management graduate and aspiring journalist, with most of his work surrounding football or NFL. He has formed two of his own sites, as well as contributing to a number of others before starting with Here Is The City. |
using System;
using System.Collections.Generic;
using Xamarin.Forms;
using TouchEffect;
using System.Windows.Input;
using TouchEffect.EventArgs;
using System.Threading.Tasks;
using TouchEffect.Enums;
using System.Threading;
namespace TouchEffectSample
{
public partial class TogglePage : ContentPage
{
public ICommand Command { get; }
private readonly Dictionary<VisualElement, CancellationTokenSource> _animatedElements = new Dictionary<VisualElement, CancellationTokenSource>();
public TogglePage()
{
var count = 0;
Command = new Command(p =>
{
Title = $"TAPS COUNT: {++count}";
});
InitializeComponent();
}
private async void OnAnimStarted(VisualElement sender, AnimationStartedEventArgs args)
{
if(_animatedElements.ContainsKey(sender))
{
_animatedElements[sender].Cancel();
}
var tokenSource = new CancellationTokenSource();
var token = tokenSource.Token;
_animatedElements[sender] = tokenSource;
var image = (sender as Frame).Content as Image;
await Task.Delay(args.Duration / 2);
if(token.IsCancellationRequested)
{
return;
}
image.Source = args.State == TouchState.Pressed
? "x.png"
: "check.png";
_animatedElements.Remove(sender);
}
}
}
|
First Butt Experience
Oh my... the subject of this post sounds like this could be pronographic. It's only that way to Pork lovers I reckon
Had thursday off, so decided to smoke a butt on wednesday night, for an early dinner on thursday. Rubbed and let sit in the fridge for a few hours (mustard and doctored up grillmates pork rub).
Also, doing some chicken thighs so I can have a snack about 3:00 am.
Got the smoker heated up, and put these in about 10:00 pm.
Hit 170 about 8:00 am, foiled until 205, removed, placed in cooler, and pulled about 2:00 pm. It was reading 195 on the thermo when I decided to pull it.
Took it out of the cooler, and it looked like this:
Close up:
took my hand, and pressed it along the top of the butt, like a piano player does when he runs his hand over the keys real quick, and it fell apart like this. It was awesome, and without a doubt the tastiest meat I have ever cooked in my life.
My many heart felt thanks and warmest wishes to everyone who has posted tips and tricks for the Char Griller SFB grills, and for the wonderful rub and sauce receipes as well. I also made that one guys slaw we were talking about last week, and it was awesome!!! |
Updated at 6:45 PM, Feb 21st – New Build Available
I’ve prepared a new build of the game. It’s a totally normal build. There’s nothing weird in this build. It’s just a normal build, like all the others. I didn’t put anything weird into the game. It’s a normal, average, ordinary, everyday, standard update. You shouldn’t expect anything weird in this update. It’s completely, totally, entirely, absolutely, 100% normal. Don’t go hunting for weird new things that might have been added, or anything like that.
Just look at this totally normal illustration that was created by minorpeybee:
Look, I just posted some artwork, like I always do. That’s clearly evidence that this is a normal update, right?
Stop looking at me like that! I didn’t put anything weird into the game! Just look at this totally normal changelog!
Totally Normal Changelog
Attempted to implement support for all aspect ratios, not just the 16:9 aspect ratio that I’ve been using up until now. Warning: Any aspect ratio other than 16:9 will be buggy during Yandere Vision.
Pointing your camera at a girl who is wearing pants is no longer considered to be lewd behavior.
Yandere-chan now wears thigh-high stockings instead of leggings in all of her outfits.
Fixed bug that would cause some characters to appear bald in the “Witness Camera”.
Gave the Titans in Titan Mode a new texture, thanks to help from Druelbozo !
! Removed several copyrighted tracks and replaced them with original tracks.
Fixed bug that would cause teachers to go bald when decapitated.
It is now possible to dismember male corpses.
Restored Senpai’s normal default picture.
Totally didn’t add anything weird in the Occult room.
Totally Normal Edit
Fixed bug that would screw up Yandere-chan’s holding/carrying animations after traveling to the…totally normal place.
Fixed bug that would prevent Yandere-chan from taking out her camera once she had visited the…totally normal place.
Removed debug command that made it way too easy to summon the…totally normal things.
Replaced the sound effect that plays when you travel to the…totally normal place.
Added new voiced lines for one of the…totally normal people.
There! Are you happy?! Now you can see everything that’s different in this build! And it’s all totally normal! All of it! Nothing weird at all!
In Closing
Currently, only one of them is functional. The other two don’t do anything yet. Once you figure out which one of them is functional, you can stop trying to get the other two to do something.
That was a TOTALLY NORMAL paragraph that I just wrote, and there was nothing weird about it AT ALL, so stop getting weird ideas about this build, okay? TOTALLY NORMAL. Don’t give me that look! Baka!
I’ll try to update the game again on March 1st. I hope there will be enough time to implement a good feature between now and then! |
= -48*l - 5. Let y(k) = -15*k - 2. Let p(a) = 4*h(a) - 11*y(a). Let c(g) = -g. Give c(p(b)).
27*b - 2
Let h(i) = -i. Let p(m) = -1834*m + 44. Give h(p(g)).
1834*g - 44
Let t(c) = 5*c**2. Let m = -48 - -46. Let s(p) = 2*p + 6*p**2 + 2 - 5 - 2*p. Let z(w) = 5*w**2 - 2. Let i(r) = m*s(r) + 3*z(r). Calculate i(t(d)).
75*d**4
Let z(b) = -2*b - 64. Let k(f) be the first derivative of -f**3/3 - 69. Determine z(k(h)).
2*h**2 - 64
Let j(k) = -21*k**2. Let l(r) = -8691*r**2. Give j(l(q)).
-1586203101*q**4
Let i(c) = -28*c**2 + 4. Let w(v) = -8*v**2 + 2*v. Calculate w(i(d)).
-6272*d**4 + 1736*d**2 - 120
Let l(k) = 117*k + 27. Let u(b) be the third derivative of 3*b**4/8 + b**3/3 - 18*b**2. Let q(z) = -4*l(z) + 54*u(z). Let c(x) = -2*x**2. Calculate q(c(s)).
-36*s**2
Let g(f) = -f**2 + 4*f + 2. Let u(v) = 15*v**2 - 66*v - 33. Let k(s) = -33*g(s) - 2*u(s). Let w(q) = -49*q**2. Calculate w(k(c)).
-441*c**4
Let g(q) be the third derivative of -13*q**4/24 + 183*q**2. Let o(n) = 8*n**2. Give o(g(l)).
1352*l**2
Let q(v) = 4*v. Let c(h) be the first derivative of -h**2 + 38*h + 170. Give q(c(i)).
-8*i + 152
Let k(d) = 5*d**2 + 2*d**2 - 9*d**2. Let w(g) = -109*g. Calculate w(k(v)).
218*v**2
Let m(x) = -x**3 + 4*x**2 - 2*x + 6. Let o be m(4). Let v(n) = 3*n + 8. Let u be v(o). Let t(l) = l + 4*l - 2*l + u*l. Let d(q) = q**2. Determine d(t(p)).
25*p**2
Let h(g) = 34*g**2. Let k be (-7)/14*14*-1. Let a(z) = -2*z - 4*z + k*z. Give h(a(u)).
34*u**2
Suppose 4*w - 37 = -4*v - v, -4*v = -4*w - 8. Suppose -v*p = -2*p - 6. Let r(q) = -3*q**2 - 3*q**p + 8*q**2. Let k(t) = -t**2. Determine r(k(f)).
2*f**4
Let i(c) = -c - 11*c + 5*c + c - 15*c. Let a(r) = r + 1. Let t(z) = -1. Let n(p) = -3*a(p) - 3*t(p). Determine i(n(v)).
63*v
Let m(x) = -2*x. Let z(v) be the third derivative of 31*v**5/60 - 4*v**2 - 28*v. Calculate z(m(c)).
124*c**2
Let u(q) = q**2 - 2*q. Let p(a) be the second derivative of -3*a**4/4 + 7*a**3/2 - 11*a. Let l(t) = 2*p(t) + 21*u(t). Let f(s) = 2*s. Calculate f(l(n)).
6*n**2
Let t(z) = 45*z. Let q(x) be the third derivative of x**5/15 - 250*x**2. Give q(t(k)).
8100*k**2
Let c(k) = 18*k**2 + 7 - 16 + 9 - 17*k**2. Let n(i) = -4*i**2 - 77. Give n(c(a)).
-4*a**4 - 77
Let v(k) = 22*k**2 + 1. Let h(a) = 7*a - 10. Calculate h(v(p)).
154*p**2 - 3
Let l(z) = -41*z - 1. Let q(r) = 462*r. What is l(q(n))?
-18942*n - 1
Let d(q) = q**2 - 2*q + 2. Let s be d(3). Let o(l) = -1 + 1 + 3*l - s*l. Let k(r) = -20*r. Calculate k(o(c)).
40*c
Let m = 76 + -74. Let r(p) = 145*p**2 - 76*p**m - 127*p**2. Let c(h) = h**2. What is r(c(q))?
-58*q**4
Let h(k) be the third derivative of -k**6/720 - k**4/4 + k**2. Let q(x) be the second derivative of h(x). Let a(r) = 2*r. Give a(q(b)).
-2*b
Let r(p) = p. Let o(j) = 2641201*j. Determine o(r(y)).
2641201*y
Let y(i) = 42*i**2 + 2*i - 8. Let z(v) = -7*v. What is y(z(p))?
2058*p**2 - 14*p - 8
Let n(l) = -10*l - l + 28*l - 11*l. Let d(c) = -4*c. Determine n(d(m)).
-24*m
Let a(j) = j**2. Let c = -15 + 22. Let m(b) = -c - b + 7. Let i(s) = -s. Let q(d) = -3*i(d) + 6*m(d). Calculate a(q(w)).
9*w**2
Let z(g) be the third derivative of g**5/12 + 7*g**4/24 + 224*g**2. Let m(v) be the third derivative of v**4/12 + 8*v**2. Determine m(z(j)).
10*j**2 + 14*j
Let i(h) = 29*h + 45*h - 101*h + 30*h. Let s(y) = 46*y. Give s(i(g)).
138*g
Let f(h) = -8*h**2 - 9*h + 9. Let q(k) = -k**2 - k + 1. Let g(l) = 2*f(l) - 18*q(l). Let v(o) = -88*o**2 - 64*o**2 - 102*o**2 + 289*o**2. Determine v(g(n)).
140*n**4
Let h(y) be the second derivative of 0*y**2 + 29/6*y**3 + 7*y + 0. Let p(m) = m**2. Give h(p(g)).
29*g**2
Let x = -38 - -59. Let n(s) = -x*s**2 + 19*s**2 + s - s. Let z(y) = 15*y. Give n(z(b)).
-450*b**2
Let r(j) = -4*j**2. Let f(b) = -b**2. Let t(o) = 22*f(o) - 6*r(o). Let x(h) = -87*h**2. Calculate t(x(k)).
15138*k**4
Let h(t) = -2*t. Let z = -93 - -118. Let q(a) = 12*a + 14*a - z*a. Determine q(h(u)).
-2*u
Let h(u) = 178*u**2 + 70*u**2 - 90*u**2 + 15*u**2 + 178*u**2. Let n(g) = -2*g**2. Determine h(n(j)).
1404*j**4
Let f(a) = -3*a**2. Let y(w) = 6*w - 133*w**2 + 11 + 135*w**2 - 6*w. What is f(y(u))?
-12*u**4 - 132*u**2 - 363
Let q(b) = -1011*b. Let p(c) = 297*c - 2. Give p(q(u)).
-300267*u - 2
Let f(l) = 5*l**2 + 2*l + 537. Let s(k) = 4*k. Give f(s(z)).
80*z**2 + 8*z + 537
Let n(b) = 13*b**2. Let r(k) = -14*k**2 + 73*k - 74*k + 19*k**2 - 15*k**2. Determine r(n(m)).
-1690*m**4 - 13*m**2
Let i(a) = a - 123. Let t(f) = 738*f. Determine t(i(d)).
738*d - 90774
Let k(j) = 0*j - 2*j**2 + 0*j. Let v(a) be the first derivative of -1/3*a**3 - 9 + 0*a + 0*a**2. Determine v(k(w)).
-4*w**4
Let g(b) = 10*b**2 + 4. Let m(z) be the second derivative of -z**4/4 + 92*z. Determine g(m(a)).
90*a**4 + 4
Let z(q) = 3*q + q - 13*q + 5*q. Let x(t) = 2*t**2 - 1. Let r(s) = 16*s**2 - 9. Let l(a) = 4*r(a) - 36*x(a). Calculate l(z(h)).
-128*h**2
Let x(y) = 857*y**2. Let a(g) = 5*g**2 - 8*g. Give a(x(z)).
3672245*z**4 - 6856*z**2
Let a(u) = -u**2 - 15766*u + 15766*u. Let q(h) = -63*h**2. Give a(q(i)).
-3969*i**4
Let u(j) = 5*j. Let o(y) = 54774*y**2. Calculate u(o(k)).
273870*k**2
Let m(a) = 248*a + 15. Let c(z) = -16*z. What is c(m(o))?
-3968*o - 240
Let n(s) = -234*s + 2 + 1 - 3 + 505*s. Let y(i) = -i**2. Determine n(y(c)).
-271*c**2
Let i(b) = b**2. Let p(z) be the second derivative of -4*z**4/3 + 39*z + 1. What is i(p(y))?
256*y**4
Let p(n) = -6*n**2. Let w(k) be the third derivative of k**5/30 - 6*k**2 - 4. Determine w(p(o)).
72*o**4
Let h(x) = 7*x + 9. Let g(z) = 8*z + 12. Let k(u) = 3*g(u) - 4*h(u). Let t(b) = 23*b. Calculate t(k(o)).
-92*o
Let c(q) = -9788*q. Let z(f) = -152*f - 2. Determine z(c(u)).
1487776*u - 2
Let b(p) be the second derivative of p**5/60 + 9*p**2/2 - 7*p. Let n(t) be the first derivative of b(t). Let a(l) = 6*l**2. What is a(n(y))?
6*y**4
Let x(q) = -3*q**2 + 2*q + 2. Let r(y) = -y**2 - y - 1. Let s(b) = 2*r(b) + x(b). Let g(j) = -7*j. Calculate g(s(h)).
35*h**2
Let j(d) be the second derivative of 10*d**3/3 + d. Let a(h) = 2*h**2 - h. Let p(s) = -7*s**2 + 3*s. Let z(w) = -3*a(w) - p(w). Calculate j(z(l)).
20*l**2
Let b(x) = -2*x**2 + 9*x. Let o(r) be the third derivative of -r**5/60 + 3*r**2 + 15*r. What is o(b(u))?
-4*u**4 + 36*u**3 - 81*u**2
Let h(c) = -2*c. Suppose 11*w - 2*r - 14 = 7*w, 3*r + 9 = 0. Let a(s) be the third derivative of 0*s**3 + 0 + 5*s**w - 1/24*s**4 + 0*s. Calculate h(a(x)).
2*x
Let t(z) = -2*z + 159. Let v(x) be the first derivative of -2*x**3/3 + 345. Determine t(v(h)).
4*h**2 + 159
Let l(f) be the third derivative of -3*f**5/5 + 132*f**2. Let h(m) = m**2. What is l(h(g))?
-36*g**4
Let z be (-15)/9*(-6)/4. Let m(j) be the first derivative of -z*j**2 + 4 + 0*j. Let d(g) = 3*g**2. Determine m(d(n)).
-15*n**2
Let m(d) = 2*d + 439. Let h(g) = 380*g. What is m(h(t))?
760*t + 439
Let c(o) = -30785*o. Let k(u) = -u**2. Determine c(k(x)).
30785*x**2
Let j be ((-2)/4)/((-44)/(-16) - 3). Let u(f) = 30*f - 19*f - f**j - 11*f. Let c(w) = 20*w. Calculate c(u(v)).
-20*v**2
Let l(a) = 969885*a**2. Let q(f) = -2*f**2. Give l(q(b)).
3879540*b**4
Let c = 2 + 2. Let q(b) = 4 - 2*b - c. Let m(g) = -331*g**2 - 324*g**2 + 651*g**2. Determine m(q(t)).
-16*t**2
Let g(l) = -2870*l**2. Let p(j) = -11*j**2. Determine p(g(a)).
-90605900*a**4
Let j(g) = 2*g**2 - 748*g + 18. Let f(s) = -110*s. Determine f(j(o)).
-220*o**2 + 82280*o - 1980
Let r = 40 + -38. Let c(z) = -144*z**r + 290*z**2 - 144*z**2. Let v(j) = 14*j. Calculate v(c(o)).
28*o**2
Let p(l) = -l. Let b(y) = -y**2 - 7*y. Let r = -7 - -7. Let o(c) = r*c + c - 3*c + c. Let x(u) = -2*b(u) + 14*o(u). What is p(x(m))?
-2*m**2
Let i(j) = -18*j**2. Suppose -f + 4680 = 8*f. Let q(k) = -2*k + f - 520. Calculate q(i(u)).
36*u**2
Let r(f) = 2*f. Let u(v) = v - 1. Let l(n) = 15 + 0*n - 11*n - 9. Let h(q) = -l(q) - 6*u(q). Calculate r(h(k)).
10*k
Let j(x) = -7*x. Let b(d) = -d**3 - 5*d**2 - 5*d + 3. Let s be b(-4). Let n(q) = s - 12 + 4*q**2 + 5. Calculate n(j(g)).
196*g**2
Let b(t) = t**2 + 1138*t + 3. Let o(g) = -16*g. What is o(b(s))?
-16*s**2 - 18208*s - 48
Suppose -2*w = 2*w - 20. Let z(c) = -2*c + 0*c - c + w*c. Let v(h) = -4*h - 4. Let o(f) = 4*f + 3. Let d(p) = -4*o(p) - 3*v(p). Calculate z(d(t)).
-8*t
Let j(x) = -5*x. Let v(h) = 3*h. Let c(n) = 4*j(n) + 5*v(n). Let p(d) = -d. What is p(c(y))?
5*y
Let y(u) |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plot.effectsize_table.R,
% R/plot.equivalence_test.R
\name{plot.see_equivalence_test_effectsize}
\alias{plot.see_equivalence_test_effectsize}
\alias{plot.see_equivalence_test}
\alias{plot.see_equivalence_test_lm}
\title{Plot method for (conditional) equivalence testing}
\usage{
\method{plot}{see_equivalence_test_effectsize}(x, ...)
\method{plot}{see_equivalence_test}(
x,
rope_color = "#0171D3",
rope_alpha = 0.2,
show_intercept = FALSE,
n_columns = 1,
...
)
\method{plot}{see_equivalence_test_lm}(
x,
size_point = 0.7,
rope_color = "#0171D3",
rope_alpha = 0.2,
show_intercept = FALSE,
n_columns = 1,
...
)
}
\arguments{
\item{x}{An object.}
\item{...}{Arguments passed to or from other methods.}
\item{rope_color}{Color of ROPE ribbon.}
\item{rope_alpha}{Transparency level of ROPE ribbon.}
\item{show_intercept}{Logical, if \code{TRUE}, the intercept-parameter is included
in the plot. By default, it is hidden because in many cases the intercept-parameter
has a posterior distribution on a very different location, so density curves of
posterior distributions for other parameters are hardly visible.}
\item{n_columns}{For models with multiple components (like fixed and random, count and zero-inflated), defines the number of columns for the panel-layout. If \code{NULL}, a single, integrated plot is shown.}
\item{size_point}{Size of point-geoms.}
}
\value{
A ggplot2-object.
}
\description{
The \code{plot()} method for the \code{bayestestR::equivalence_test()} function.
}
\examples{
library(effectsize)
m <- aov(mpg ~ factor(am) * factor(cyl), data = mtcars)
result <- eta_squared(m)
plot(result)
}
|
pH-responsive properties of hollow polyelectrolyte microcapsules templated on various cores.
Hollow polyelectrolyte microcapsules made of poly(allylamine hydrochloride) and sodium poly(styrene sulfonate), templated on various cores, manganese and calcium carbonate particles or polystyrene latexes, were investigated. The polyelectrolyte multilayers respond to a change of pH, leading to a swelling of the capsules in basic conditions and a further shrinking when the pH is reduced to acidic. The nature of the core and the subsequent dissolution process have an influence on this pH responsiveness, and the structuring effect of tetrahydrofuran on the multilayers has been demonstrated. Increasing the molecular weight of the polymers or the number of layers causes also a rigidification of the structure and modifies the pH response. |
Follow Us
Energy Saving Tips
Paint your computer green!
A typical desktop computer draws about 125 to 140 watts of power when in use. Not only can this be wasteful when the computer is not needed, it also impacts our building air conditioning systems, since most of that energy is transformed into heat that is blown out the back of the PC.
These setting are best handled by your local systems administrator, but a reasonably savvy computer user should have no trouble turning their computers green. In a WINDOWS ™ computer, go to the START menu, then Control Panel, then Hardware and Sound, then either “Power Options” (classic view) or “Performance and Maintenance.” You will then need to select the “Power Saver” version under preferred plans and make power management changes to that plan by selecting the option on the right “Change Plan Settings.”
Here’s a quick primer on computer power management. Computers save energy through a number of steps which they can be configured to take after specified periods of idle time. They’re listed below in the order they’re generally invoked:
Turn off the monitor. This does not effect your current session, all applications remain open, and it can be reversed quickly. Boise State recommends all computers should be set up to power down the monitor and that the user’s password is required to return to your session. This step not only saves electricity, but it enhances the security of our computing network. Five minutes is a good setting for this feature, and your electricity usage will fall by about 30% when the monitor is turned off.
Turn off the hard drive. This is not as effective as the other measures because operating systems use the hard drive periodically for background applications and they’re not as idle.
System Standby. This mode comes from the laptop community and allows the system to nearly shut down while preserving your session. Minimal power is consumed to preserve the state of your applications while making it fast and easy to return to it when needed. When in Standby mode, your computer will consume about 5% of it’s normal power. This adds up to significant savings. Many users find that going into standby after 20 or 30 minutes is an appropriate setting.
Hibernate. This mode is as close to turning off the computer as you can get, but still preserves your setting. The computer writes a large file to your hard disk recording all the details of your desktop and open applications, then shuts down the computer. Upon return, it takes a few moments (30 seconds or so) to read that file and gets you back to your desktop. Having your system hibernate after 1 hour would be a great energy savings over time. In some cases you have to explicitly enable the Hibernate mode using the control panel.
Power down. Going through the system shutdown procedure turns off your computer and allows it to boot fresh when you come back. The re-boot process takes several minutes and this is why many people keep their computers running all night.
Unplugged. To make sure your computer is completely off, you must disconnect it from the grid. You can do this by either unplugging it, or using a switched power strip. In either case, this is the only way to ensure that you’re not wasting any electricity.
Folks at the OIT help desk are always available to help if you have any questions, call 426-4357 or email helpdesk@boisestate.edu. |
These authentic heritage designs were used to create a beautifully modern country collection. The Orchard pattern offers a floral motif on soft pastel green and features a distinctive speckle in the glaze which adds to the rustic feel of the ...
This authentic heritage design is used to create a beautifully modern country collection. The Pavilion pattern offers an abstract motif on a soft blue palette and features a distinctive speckle in the glaze, which adds to the rustic feel of ...
Temper chocolate, proof bread dough, make fondue, soups, yogurts and more with the KitchenAid® Precise Heat Mixing Bowl. (Designed exclusively for use with KitchenAid® Household Stand Mixer all 4.5-qt. or larger tilt-head models, or as a standalone unit) For everything ... |
about this item
WELCOME TO THE FAMILY - London, 1868. The Industrial Revolution fattens the purses of the privileged while the working class struggles to survive – until an Assassin emerges from the underworld to rally to their defense. Rise to lead the world’s first organized crime family. Conquer the streets of London. Bring the ruling class to their knees. Make history in a visceral adventure unlike any game you’ve played before.
Game Features: TAKE OVER THE LONDON UNDERWORLD Establish London's fiercest gang and bring justice to the lawless streets.
DEVASTATE YOUR ENEMIES Fight with an all-new combat system and weapons like the Cane Sword and the Assassin’s Gauntlet featuring the Hidden Blade and Rope Launcher.
PLAY AS TWIN ASSASSINS Play as rebellious Jacob Frye and his swift, deadly sister Evie.
Creed Fan Talking
(would recommend)
5 out of 5 stars
adisesha8 — 2 years ago
I have played the Assasin's Creed 1,2 brotherhood, revelations , black flag and syndicate. I have just started playing syndicate....and its completely different from the previous parts. Now there are 2 characters to switch. I bought it because I recently purchased an xbox and got a 60$ gift card wit...see moreof the reviewer's review |
Acoustical properties of individual liposome-loaded microbubbles.
A comparison between phospholipid-coated microbubbles with and without liposomes attached to the microbubble surface was performed using the ultra-high-speed imaging camera (Brandaris 128). We investigated 73 liposome-loaded microbubbles (loaded microbubbles) and 41 microbubbles without liposome loading (unloaded microbubbles) with a diameter ranging from 3-10 μm at frequencies ranging from 0.6-3.8 MHz and acoustic pressures ranging from 5-100 kPa. The experimental data showed nearly the same shell elasticity for the loaded and unloaded bubbles, but the shell viscosity was higher for loaded bubbles compared with unloaded bubbles. For loaded bubbles, a higher pressure threshold for the bubble vibrations was noticed. In addition, an "expansion-only" behavior was observed for up to 69% of the investigated loaded bubbles, which mostly occurred at low acoustic pressures (≤30 kPa). Finally, fluorescence imaging showed heterogeneity of liposome distributions of the loaded bubbles. |
When analyzing the behavior of an engineering structure made of complex mixed materials, a three phase concept of the material profile can be introduced. The first phase of the profile is at a macro-continuum level of the structure. That is, the structure is built as an assembly of macro-continuum elements. The second phase is at a micro-continuum level of the structure. It should be noted that most macro-continuum materials, which seem to be homogeneous in the macro-continuum level, in fact comprise several constituent components when considered from the microscopic point of view. This kind of material is said to be micro-inhomogeneous. The third phase of the profile is at a molecular level. This phase is founded on the physical fact that each constituent material of the micro-continuum consists of a vast number of atoms and/or molecules.
As an example, a bridge is considered as a target structure that is made of granite. The granite is a macro-continuum material. Granite includes three major component minerals such as quartz, feldspar and mica in the micro-continuum level thereof. That is, the micro-structure of granite comprises three constituent minerals, each in turn including a set of atoms/molecules that constitutes a molecular system. Similarly, a concrete dam structure has the same phases. That is, the concrete is a macro-continuum material; gravel, sand and cement paste are micro-continuum materials; and each of the micro-continuum materials constitutes a molecular system.
When designing an engineering structure with plural member elements, it is known to follow a theory of macro-phenomenological mechanics, and to perform a series of experiments in order to determine the macro-mechanical properties of each macro- continuum element. It should be recalled that the material properties obtained in these experiments are averaged in the specimen. This procedure is applied in the same manner in many fields of mechanics such as mechanical engineering and civil engineering.
In order to overcome the theoretical insufficiency involved in the above described macro-phenomenological theory, it is commonly believed that for the micro-inhomogeneous material the size of experimental specimens must be more than ten times larger than the largest size of the constituent components. However, in fact it is not truly known if this belief is true. Furthermore, it is difficult for the macro-phenomenological theory to recognize what happens in the micro-continuum level, although the local phenomena are directly related to the global behavior of the structure.
It can thus be said that the conventional macro-phenomenological procedure is not appropriate for analyzing the behavior of the micro-inhomogeneous material, especially where such a material is used under very extreme engineering condition such as high pressure, high temperature and/or long elapsed time.
In analyzing the behavior of micro-inhomogeneous material two essential problems must be solved. Firstly, it is necessary to determine characteristics of constituent components of the micro-continuum which are directly affected by their molecular movement. Secondly, there must be developed an approach to relating the microscale characteristics to the macroscale behavior of the structure and the macro-continuum elements thereof.
The prior art has not yet succeeded in developing such a fully unified procedure to analyze the molecular movements of the constituent components of the micro-continuum with respect to the macroscale behavior of the structure, much less to design the micro-structure optimally based on such considerations.
MS is a known type of a computer simulation technique. In an MS computation, one gives a material system which consists of particles, atoms and/or molecules, and provides two physical laws, that is, the interatomic interaction potential and the equation of motion or equilibrium. Positions, velocities and/or accelerations of all particles are then calculated under the foregoing physical laws. A statistical thermodynamics procedure is applied to the simulated results, and one can estimate bulk-based physicochemical properties of the material (hereinafter called the bulk properties of the material) such as structure factor of the solid crystal. It is noted that the bulk properties represent thermodynamical averages of the ensemble of particles.
Three classes of MS methods are known:
1) the Monte Carlo method (hereafter abbreviated as MC), PA1 2) the Molecular Mechanics method (hereafter abbreviated as MM), and PA1 3) the Molecular Dynamics method (hereafter abbreviated as MD).
MC, developed by Metropolis et al, estimates the statistical equilibrium state of particles by generating their displacements randomly. Various thermomechanical properties are then calculated by averaging over the states in the Markov chain.
MM is applied for a molecular system which consists of a finite number of atoms, and determines the equilibrium state by optimizing the structure and potential energy. The bulk properties are calculated by using statistical thermodynamics procedure. MM is mainly used in the field of organic chemistry.
On the other hand, MD solves the equation of motion for a system of particles under a given interatomic interaction potential by using a time-discrete finite difference scheme, and the whole time trajectories of particles are specified. The bulk properties are calculated by using statistical thermodynamics procedure for the results.
As MC and MM provide no knowledge of chronological trajectories of particles, these techniques are incapable of considering quantities that are defined in terms of particle motion, such as diffusion. In this sense, except for computational efficiency, MD is more useful so the MD procedure is shown herein as a typical example of MS.
In the MD calculation, the law of conservation of linear momentum is applied for every particle to get the following equation of motion for the i-th component: ##EQU1##
where m.sub.i is the mass of the i-th particle, v.sub.i =dr.sub.i /dt is its velocity at the position r.sub.i, and the force F.sub.i is calculated from the potential function U.sub.ij between two particles by ##EQU2##
The MD system usually contains many particles of atoms and/or molecules in a basic cell, and (for simplicity of calculation) the method uses a three dimensional periodic lattice, which is repeated in each direction. Under these conditions one solves a time discrete form of the equation of motion, and the instantaneous position, velocity and acceleration of each particle are specified. Then, using these results and statistical thermodynamic theory, one computes for the material the bulk properties and their change with time, such as density, diffusivity of atoms, molecular vibrations, temperature- and/or pressure-dependent nonlinear elastic moduli, viscosity, heat capacity and heat conductivity.
The interatomic potential function for all atom-atom pairs plays an essential role for the MD calculation. Equation (3) presents a potential function developed by Kawamura so as to reproduce structural and physical properties of several oxide crystals such as quartz, corundum and feldspars properly.
2-body term: ##EQU3##
The right hand side of this equation shows the Coulomb, the short-range repulsion, the van der Waals and the Morse terms, respectively. These terms are selectively used for some materials due to the nature of the interaction. For water a 3-body term is also added to the H--O--H interaction because of its Sp.sup.3 hybrid orbital.
3-body term: ##EQU4##
Parameters {z, a, b, c} and {D, .beta., r*} for the 2-body term, and {f.sub.k, .theta..sub.0, g.sub.r, r.sub.m } for the 3-body term are specified by using experimental data of structural and physical properties of relevant materials.
Many types of simulation schemes have been developed in MD. For example, in the early stage of MD there was employed a scheme where the number of particles N, the volume V and the total energy E are constant (the constant-(NVE) ensemble), while in the 1980's there was developed a scheme in which the number of particles N, the pressure P and the temperature T are constant (the constant-(NPT) ensemble). MD generates information at the molecular level such as position, velocity and acceleration of each particle. Statistical thermodynamics provide averaged quantities of the system which are called the bulk properties. For example, one can calculate the temperature as ##EQU5##
where k.sub.B is Boltzmann's constant, and ##EQU6##
is the kinetic energy of the k-th particle with its mass m.sub.k and velocity v.sub.k. Note that <A>gives the time average of a quantity A(t) taken over a long time interval: ##EQU7##
The right hand side term is used for a discrete system with N-particles for N.sub.s -number of a time slice .DELTA..tau.. Then, by applying the virial theorem the pressure P is calculated as ##EQU8##
where r.sub.i is the position vector and F.sub.i the force acting on the i-th particle. Similar to this, one can calculate the stress tensor which is the force per unit area acting on three coordinate surfaces in the three dimensional case. On the other hand, if one uses the constant-(NPT) ensemble scheme for example, the normal strain .epsilon..sub.xx in the x-direction is calculated by ##EQU9##
where L.sub.x is the original size of the basic cell in the x-direction, and L.sup.c.sub.x is its size after relaxation by the MD calculation. Other components of strains including shear components can be calculated in a similar manner. If the pressure is changed, one gets a different value of strain. Plotting these values yields a stress-strain relation in the micro-continuum level. Thus, one gets a stress or strain dependent type of the Young's modulus E.
Though MD is quite powerful for simulating the true behavior of materials, it is impossible to use this method directly for designing an engineering structure on a human size scale, such as a car, an airplane and a bridge, because such structures involve extremely large numbers of molecules. Note that one mole of material (equivalent to 12 g of carbon) consists of 6.0221367.times.10.sup.23 molecules, and even if the fastest computer known at present were used, one can calculate a system with at most 10.sup.6 molecules. It is thus impossible to use MS in a simple manner for designing a practical engineering structure. This circumstance will not be changed in near future.
The HA method, which is based on a new type of perturbation theory, has been developed for micro-inhomogeneous media with a periodic microstructure. This method allows a determination of both macroscopic and microscopic distribution of field variables such as temperature, displacement, stress and strain. It is noted that the perturbation theory is a method mainly for solving nonlinear problems.
The simplest example of HA is shown herein for applying the one dimensional static equilibrium problem, which is described by the following equation. ##EQU10##
where u.sup..epsilon. (x) denotes the displacement which changes rapidly in the micro-continuum level, E Young's modulus, and f the body force. Note that E also varies in that micro-continuum level. Let the size of the microstructure be .epsilon.Y, and one introduces a local coordinate system y in the micro-continuum level. The global coordinate x is related to the local one y by ##EQU11##
By using this .epsilon., a perturbation expansion is introduced by EQU u.sup..epsilon. (x).congruent.u.sub.0 (x,y)+.epsilon.u.sub.1 (x,y)+.epsilon..sup.2 u.sub.1 (x,y)+.LAMBDA. (12)
where u.sub.0 (x,y), u.sub.1 (x,y), u.sub.2 (x,y), . . . are periodic functions satisfying the condition u.sub.i (x,y+Y)=u.sub.i (x,y) (i=0,1,2, . . .). If the two coordinates x and y are used, the differentiation is changed as ##EQU12##
On substituting the perturbed expansion (12) and the differentiation form (13) into the equilibrium equation (10), and setting each term of the series for .epsilon. to be zero, the following relations can be obtained: ##EQU13##
This implies that u.sub.0 is the function of only the global coordinate x, that is, u.sub.0 =u.sub.0 (x). ##EQU14##
This gives a differential equation to determine u.sub.1 (x,y) in y, and on introducing a separation of variable ##EQU15##
yields a differential equation for the characteristic function N(y): ##EQU16##
This equation is called the microscale equation. ##EQU17##
For this equation, the following average operation is introduced: ##EQU18##
then the macroscale equation is obtained for determining u.sub.0 as ##EQU19##
where ##EQU20##
The quantity E* is called the homogenized elastic coefficient. Thus, first the microscale equation is solved under the periodic boundary condition to get the characteristic function N(y). One substitutes it for the definition of the homogenized elastic coefficient, and solving the macroscale equation which is of the same form of the original equation of equilibrium yields u.sub.0. Now one gets u.sub.1 by using u.sub.0 and N(y), then u.sub.2 can be calculated by the differential equation of .epsilon..sup.0 -term. However since the value of terms .epsilon..sup.k u.sub.k (x,y)(k.gtoreq.2) is thought to be small, one sets EQU u.sup..epsilon. (x).congruent.u.sub.0 (x,y)+.epsilon.u.sub.1 (x,y). (22)
In this case, the strain can be obtained as ##EQU21##
and the stress is given by EQU .sigma..sup..epsilon. =Ee.sup..epsilon.. (24)
In practical engineering problems with two or three dimensions, a finite element approximation method is applied for solving the above mentioned microscale and macroscale equations.
The various methods of MS and HA have been developed in different fields, and no intercorrelation has been tried in these two fields. Both the MS methods and HA involve difficulties in attempting to apply them to simulate the behavior of a practical engineering structure made of a micro-inhomogeneous material: MS methods can only treat a system with far less particles than in a practical structure, while in HA it is difficult to find bulk properties of each constituent material and their interfaces. In view of the difficulties of the prior art, it is thus important to establish an accurate method for analyzing the behavior of a structure made of micro-inhomogeneous material and for designing the micro-structure of the micro-inhomogeneous material optimally in the case of manufacturing.
It is accordingly an object of the invention to overcome the difficulties of the prior art and to provide a novel method for analyzing and designing a structure made of micro-inhomogeneous material. |
Getty Images
Packers quarterback Aaron Rodgers has turned R-E-L-A-X into a catchphrase of sorts over the years, but that’s not the message he’s sending to the team’s fans ahead of the 2017 season.
Rodgers noted how the team played offensively down the stretch last season and the additions of tight end Martellus Bennett and Lance Kendricks while sharing his optimism about his side of the ball. He thinks the team still has a little tweaking to do on the defensive side, but that there’s plenty of reason for excitement in Green Bay.
“We probably need a couple more pieces on defense before the season starts, but we’re going to be really tough to stop on offense,” Rodgers said on a podcast with Evan Daniels of FOX Sports. “Mike [McCarthy] has a great system there that’s ever evolving and changing. I put my stamp on it once we get it down on paper. It’s exciting, man. Green Bay Packers fans should be really excited about this season and the possibilities.”
The Packers have made the playoffs in each of the last eight seasons and they’ve won at least one playoff game in each of the last three, which is a run that Rodgers called “phenomenal” while noting that the team has to find a way to push through for his second Super Bowl. Rodgers said that this would be as good a year as any to break the drought as it would mean the Packers were celebrating their title on the Vikings’ home field. |
//
// AppDelegate.swift
// OpalImagePicker
//
// Created by Kristos Katsanevas on 1/15/17.
// Copyright © 2017 Opal Orange LLC. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}
}
|
Elite U.S. Army special operators took out the Islamic State in Iraq and Syria’s (ISIS/ISIL) head honcho, sources confirmed to Breitbart News.
The U.S. Army’s Delta Force, 75th Ranger Regiment, and the 160th Special Operations Aviation Regiment conducted the raid on the world’s most wanted jihadi, Abu Bakr al-Baghdadi, the emir of the Islamic State in Iraq and Syria (ISIS), according to two U.S. officials.
The highly secretive Delta Force, known as the 1st Special Forces Operational Detachment-Delta (SFOD-D), is a special mission unit under Joint Special Operations Command (JSOC), which commands the elite of the elite special operations forces. They are also referred to as Tier One forces and are tasked with special missions, such as the operation to kill Osama Bin Laden.
Delta Force soldiers were among the first to engage ISIS after the terrorist group swept across Iraq in 2014. The first U.S. service member to be killed in the war against ISIS was Army Master Sgt. Joshua Wheeler, who was a member of Delta Force, on October 22, 2015.
Rangers are the Army’s premier light infantry forces, and the 160th SOAR is the Army’s elite aviation unit specializing in nighttime raids, giving them the name “Night Stalkers.”
President Donald Trump on Sunday praised the forces he authorized to conduct the raid but did not mention the units that took part in the operation.
“U.S. Special Operations Forces executed a dangerous and daring nighttime raid in northwestern Syria and accomplished their mission in grand style. The U.S. personnel were incredible. I got to watch much of it,” he said during a 48-minute live press conference.
Defense Secretary Mark Esper, who was in the Situation Room with the president as the operation unfolded, also praised the forces involved for “flawlessly” executing the operation in a statement and said earlier on ABC News’ This Week that it was “brilliantly executed.”
“Our troops are the best in the world. They know what they’re doing. They’ve done this hundreds of times and it was a brilliantly executed operation. And the president deserves credit for giving it the green light,” he said.
He also said there were less than a hundred forces on the ground but more involved in the entire operation, including from the intelligence community and other parts of the government.
He also confirmed there were a “number” of different types of aircraft, “principally the CH-47s” helicopters, which are Chinooks. The 160th SOAR operates modified Chinooks that can carry about two dozen forces each. Those Chinooks are painted black and have inflight refueling capability. The regiment also operates Black Hawk and Little Bird attack helicopters.
Trump and Esper said some of the helicopters took fire but that U.S. forces returned fire in self-defense and eliminated the threat. Esper said U.S. forces also destroyed the compound where al-Baghdadi was found to be hiding once the U.S. forces left, but he did not say what kind of platform was used.
They described a harrowing raid in which a number of adults were killed, including two of Baghdadi’s wives who were wearing suicide vests that had not exploded and more adults and children taken into custody.
According to Trump and Esper, U.S. forces, accompanied by military dogs, chased al-Baghdadi, who dragged three of his young children with him into a dead-end tunnel and exploded his suicide vest, killing himself, his children, and collapsing the tunnel.
Esper indicated U.S. forces did not enter the tunnel: “Before we could get in there and get him he blew himself up.”
One dog was injured but survived. Trump said the U.S. forces had a robot with them, but things moved too fast to be able to use it.
Esper declined to say whether U.S. forces had eyes on al-Baghdadi but said there was a “high degree of confidence” that he was in the tunnel, and it was subsequently verified through DNA evidence. U.S. forces also collected intelligence from the raid, having to do with ISIS “origins, future plans, things that we very much want,” Trump said.
Al-Baghdadi died “whimpering and crying and screaming all the way,” Trump said.
“He reached the end of the tunnel, as our dogs chased him down. He ignited his vest, killing himself and the three children. His body was mutilated by the blast. The tunnel had caved in on it, in addition. But test results gave certain immediate and totally positive identification. It was him,” Trump said.
Esper said the raid took more than two hours.
Esper was not the only former Army leader in the Situation Room with Trump. Chairman of the Joint Chiefs of Staff Army Gen. Mark Milley — who previously served as chief of staff of the Army, was also present.
Milley himself spent time in Army special operations. He served with the Special Forces’ 5th Group as a Green Beret.
Despite a report that some current and retired Army Special Forces were upset with Trump’s press conference discussing the raid in such detail, several current and retired Special Forces sources praised the press conference to Breitbart News and dismissed criticism that the press conference revealed anything that would compromise future raids.
“There aren’t specifics that anyone can take away from that that they can use to their advantage,” one Green Beret told Breitbart News. “The only thing someone can maybe really point to is when he said ,’We were there for two hours,’ but…our dwell time on an objective is never a constant…Literally every mission is different.”
Retired Green Beret Joe Kent, whose wife Navy Chief Petty Officer Shannon Kent was killed by ISIS in Syria this year, reflected on the successful raid in a tweet:
“When my sons are old enough to know their mother was killed hunting evil it will be an honor to tell them America’s silent warriors relentlessly hunted & destroyed it to avenge her & so many. Thank you brothers & sisters,” he tweeted.
When my sons are old enough to know their mother was killed hunting evil it will be an honor to tell them America’s silent warriors relentlessly hunted & destroyed it to avenge her & so many. Thank you brothers & sisters. — joe kent (@joekent16jan19) October 27, 2019
Follow Breitbart News’ @Kristina_Wong. |
<#@ template debug="false" hostspecific="true" language="C#" #>
<#@ include file="../ILGPU.Tests/Generic/ConfigurationBase.tt" #>
<#@ assembly name="System.Core" #>
<#@ import namespace="System.IO" #>
<#@ output extension=".cs" #>
using Xunit;
using Xunit.Abstractions;
<#
var configurationFile = Host.ResolvePath("../ILGPU.Tests/Configurations.txt");
var configurations = TestConfig.Parse(configurationFile, out var _);
#>
namespace ILGPU.Tests.OpenCL
{
<# foreach (var config in configurations) { #>
<# foreach (var optLevel in config.OptimizationLevels) { #>
<# var name = "CL" + config.Name + "_" + optLevel; #>
[Collection("CLContextCollection<#= optLevel #>")]
public sealed partial class <#= name #> : <#= config.Name #>
{
public <#= name #>(
ITestOutputHelper output,
CLTestContext<#= optLevel #> testContext)
: base(output, testContext)
{ }
}
<# } #>
<# } #>
} |
Methemalbumin: reality and myth.
The ability to form methemalbumin by binding oxidized heme is described frequently as a characteristic of albumin from all animal species. Actually, only albumin from a limited number of species makes methemalbumin. Lack of recognition of interspecies differences has led to the myth of methemalbumin in domestic animals. The literature on methemalbumin is reviewed including the chemical characteristics of true methemalbumin and the misuse of mythical methemalbumin. |
---
abstract: 'Half vortices have been recently shown to be the elementary topological defects supported by a spinor cavity exciton-polaritons condensates with spin anisotropic interactions (Y. G. Rubo, *Phys. Rev. Lett.* **99**, 106401 (2007)). A half vortex is composed by an integer vortex for one circular component of the condensate, whereas the other component remain static. We analyze theoretically the effect of the splitting between TE and TM polarized eigen modes on the structure of the vortices in this system. For TE and TM modes, the polarization states depend on the direction of propagations of particles and imposes some well defined phase relation between the two circular component. As a result elementary topogical defects in this system are no more half vortices but integer vortices correspond to an integer vortex for both circular components of the condensate. The intrinsic life time of half vortices is given and the texture of a few vortex states is analyzed.'
author:
- 'H. Flayac'
- 'I.A. Shelykh'
- 'D.D. Solnyshkov'
- 'G. Malpuech'
title: 'Effect of the TE-TM splitting on the topological stability of Half-vortices in spinor exciton-polariton condensates'
---
Introduction
============
Interactions between quantum particles lie behind a number of intriguing phenomena in the field of condensed matter physics. Being treated within mean field approximation, for a system of interacting bosons they result in a non-linear term in the Gross-Pitaevskii equation, which is currently routinely used for the description of dynamics of Bose-Einstein Condensates (BECs) of cold atoms [@GPBEC]. A similar equation, known as non-linear Schrödinger equation, is widely used in non-linear optics for description of such phenomena as self-focusing of laser beams and propagation of solitons [@Kivshar].
The fields of BEC and non-linear optics meet each other in the context of planar semiconductor microcavities: the mesoscopic objects designed to enhance the light-matter interaction. A microcavity consists of a pair of distributed Bragg mirrors confining an electromagnetic mode and one or several Quantum Wells (QWs) with an excitonic resonance, which are placed at the antinodes of the electric field $\overrightarrow{E}$. In strong coupling regime, where coherent exciton-photon interaction overcomes the damping provided by the finite lifetime of excitons and cavity photons, a new type of elementary excitations, called exciton-polaritons (or cavity polariton), appears in the system. The polaritons are a mixture of material excitations (excitons) with light (photons).
The hybrid nature of polaritons gives them a set of peculiar properties. First, at relatively small densities, polaritons exhibit bosonic properties [@StimScatt]. Second, due to the presence of a photonic component, the effective mass of the polaritons is extremely small ($10^{-4}-10^{-5}$ of the free electron mass), while the presence of an excitonic component makes possible efficient polariton-polariton and polariton-phonon interactions. These properties make possible polariton Bose condensation [@Imamoglu] suggested more than 10 years ago, up to high temperatures [@Malpuech02; @Zamfirescu]. The simulations have shown that relaxation of polaritons can become faster than their radiative lifetime, allowing the formation of a quasi-equilibrium polariton gas. These predictions have been confirmed by the recent observation of polariton condensation [@Richard; @Kasprzak; @Snoke; @Yamamoto; @Baumberg; @Christmann; @Kasprzak08; @Wertz] and the demonstration of the thermodynamic regime [@Kasprzak08; @Wertz] where the behavior of the polariton gas is well described by its thermodynamic variables (temperature and chemical potential). The next step after the observation of the condensation itself is to study the dynamical properties and the specificities of polariton condensates. One of the important properties is superfluidity. The phase transition expected for 2D polaritons is rather a Berezinskii-Kosterlitz-Thouless (BKT) transition toward a superfluid state [@Malpuech03], and not the BEC. Such a phase transition has not been immediately observed in CdTe and GaN based structures, because of the presence of a structural disorder, which has led to the formation of an Anderson Glass phase [@Malpuech07] or to the condensation in a single in-plane potential trap [@Sanvitto09]. Only in a cleaner GaAs-based sample some signatures of BKT phase transition have been reported [@Yamamoto08]. If this observation is confirmed, it would rule out the claims that no superfluid behavior can be achieved in a system of particles showing a finite life time [@Marzena; @Carusotto07]. Another way to excite a superfluid flow of polaritons is to properly design a resonant excitation experiment, as described theoretically [@Carusotto04; @Solnyshkov07] and recently evidenced experimentally [@Amo09]. In this framework the study of fundamental properties of polariton vortices is of a strong interest. On one side, the BKT transition between normal and superfluid states in two-dimensional system is closely connected with the formation of topological defects (vortex-antivortex pairs). On the other side, the recent growth of the experimental activity devoted to cavity polariton condensates opened a race to the observation of exotic phenomena. Observation of a vortex pinned to a defect in a disordered cavity has been reported [@Lagoudakis], whereas the formation of a lattice of vortices in a potential trap has been predicted theoretically in the scope of a Ginzburg-Landau model [@Keeling]. In these two works the peculiar spin structure of polaritons was not taken into account. In fact, only one theoretical work did study vortex states in homogeneous spinor polariton condensates [@Rubo]. In this work Y. Rubo shows that elementary polariton vortex states are the so-called “half-vortices”. They are characterized by a half-quantum change of the phase of the condensate, i.e. the phase of the wave function is changed by $\pm\pi$ after encircling the point of singularity. This analysis however was not considering the facts that polariton eigen states in a microcavity are normally TE or TM polarized [@Panzarini], with a finite energy splitting between these two states (TE-TM splitting).
In the present work we therefore consider the impact of the TE-TM splitting on polariton vortices. We first show that using the basis of circularly polarized states (contrary to the basis of linearly polarized states used by Rubo [@Rubo]) allows to describe a half vortex as one vortex for one circular component, whereas the other circular component remains immobile. We then show that the TE-TM splitting couples the half-vortices of opposite circularity, which cease to be the stationary solutions of the spinor Gross-Pitaevskii equations. The elementary (stationary) excitation of the condensate with the TE-TM splitting is composed by one vortex of each circular component. This result does not mean that the half-vortices cannot be observed experimentally. It is however a state which should decay in time and therefore should not be used for the calculation of the critical temperature of the BKT phase transition. In the second section we present in details the spin structure of cavity polaritons. In the third section the polarization structure of polariton vortices is analyzed. Results and discussions are presented in the fourth section. The fifth section draws the main conclusions.
Spin structure of cavity polaritons
===================================
An important peculiarity of cavity polaritons is linked with their spin structure. Like other bosons, polaritons exhibit an integer spin, inherited from spins of excitons and photons. In QWs the lowest energy level of a heavy-hole (having a spin $S_z=3/2$) lies typically lower than any light-hole level ($S_z=1/2$) and thus the entire exciton spin in a QW has projections $S_z=\pm2,\pm1$ on the structure growth axis. The states with $S_z=\pm2$ are not coupled to light and thus do not participate in polariton formation. As they are split-off in energy, normally they can be neglected while considering polariton dynamics [@LuisSSC]. On the contrary, states with $S_z=\pm1$ form the optically active polariton doublet and can be created by $\sigma_+$ and $\sigma_-$ circularly polarized light, respectively. Thus, from the formal point of view, the spin structure of cavity polaritons is analogical to spin structure of the electrons (both being two-level systems), which permits to introduce the concept of a pseudo-spin vector $\overrightarrow{S}$ for the description of their polarization dynamics [@KirillPRL]. The latter is determined as the coefficient of the decomposition of the $2\times2$ spin density matrix $\rho$ of polaritons on a set consisting of the unity matrix **I** and three Pauli matrices $\sigma_{x,y,z}$.
$$\rho=\frac{N}{2}\textbf{I}+\overrightarrow{S}\cdot\overrightarrow{\sigma}$$
$N$ is the total number of particles. The orientation of the pseudo-spin completely determines the polarization of the emission from a microcavity. According to a generally accepted convention, orientation of the pseudo-spin along $z$-axis corresponds to circular polarized emission, while pseudo-spin lying in $x-y$ plane corresponds to linear polarized emission.
The spin dynamics of cavity polaritons has become a field of intense research since 2002 [@LolaPRL]. It is governed by two factors. First, at $\overrightarrow{k}\neq0$ there is an effective in-plane magnetic field which results in the pseudo-spin rotation manifesting in the oscillations of the polarization degree of photoemission in the time domain. It is well known that due to the long-range exchange interaction between the electron and hole, for excitons having non-zero in-plane wave-vectors, the states with dipole moment oriented along and perpendicular to the wave vector are slightly different in energy [@Maialle]. In microcavities, the TE-TM splitting of polariton states is greatly amplified due to the exciton coupling with the cavity mode, which is also split in TE and TM polarizations [@Panzarini]. An important feature of the effective magnetic field generated by the TE-TM splitting is the dependence of its direction on the direction of the wave-vector : it is oriented in the plane of the microcavity and makes a double angle with the $x$-axis in the reciprocal space : $$\vec{\Omega}_{eff}(k)\sim\mathbf{e}_x\text{cos}(2\phi)+\mathbf{e}_y\text{sin}%
(2\phi). \label{OmegaEff}$$ This peculiar link between the orientation of the effective magnetic field and polariton wave-vector leads to remarkable effects in the real-space dynamics of the polarization in quantum microcavities, including the optical spin Hall effect [@OSHE], possible formation of polarization patterns [@Langbeincross], and creation of polarization vortices [@LiewVortex].
Second, polariton-polariton interactions are known to be spin- anisotropic. Since the exchange interaction plays a major role, the interaction of polaritons with parallel spin projections on the structure growth axis is much stronger than that of polaritons with antiparallel spin projections [@Combescot]. This leads to a mixing of linearly polarized polariton states, manifesting itself in remarkable non-linear effects in polariton spin relaxation, such as self-induced Larmor precession and inversion of linear polarization upon scattering [@Krizhanovskii].
In the domain of polariton BEC, spin properties of cavity polaritons play a major role. It was argued that under unpolarized non-resonant pump the transition to phase-coherent states should be accompanied by spontaneous appearance of a linear polarization in the emission from the ground state. Consequently, linear polarization can be considered as an experimentally measurable order parameter of the polariton BEC [@Laussy].
It is well known that the BKT transition between normal and superfluid states in two-dimensional systems is closely connected with the formation of the topological defects (vortex-antivortex pairs). It is thus of a crucial importance to understand the structure and polarization properties of vortices in the homogeneous polariton condensates.
Polarization vortices in spinor polariton condensates
=====================================================
To the best of our knowledge, up to the present time, there exists only one theoretical work regarding vortices in the context of the spinor polariton condensation [@Rubo]. In this pioneer paper the polarization structure of the polariton vortices was analyzed and the existence of peculiar half-vortices was predicted [@Vortexsupercond]. It was shown that contrary to the case of a normal vortex in scalar superfluid, the particle density differs from zero in the center of a half-vortex. Besides, these objects have been predicted to possess a peculiar spatial dependence of the polarization: it is circular in the center of the core and becomes linear at large distances from it. The energy required to create a half-vortex is twice smaller than the one required to create a normal vortex, because only one half of the total fluid mass is rotating. As a result, the existence of half vortices as stationary stable states divides by 2 the critical temperature of the BKT phase transition as discussed in Ref..
However, the effects of the in-plane effective magnetic fields of various nature, in particular of the TE-TM splitting, on the structure of the polarization vortices was neglected in this seminal work. As we shall see below, these fields can have drastic effects on the structure of polarization vortices. Besides, in our opinion, the choice of the basis of linear polarizations used in Ref.[@Rubo] hindered the clear physical understanding of the physical origin of the half-vortices. In the present manuscript we revise and extend the results of Y. Rubo, accounting for non zero TE-TM splitting of a polariton doublet and using the basis of circular polarizations, which makes the obtained results much more transparent.
The Hamiltonian of an interacting polariton system written in the basis of circular polarized states reads :
$$\begin{aligned}
\widehat{H}=\widehat{H}_0+\widehat{H}_{int}=\int\left[\overrightarrow{\psi}^\dag\widehat{\textbf{T}}(-i\nabla)\overrightarrow{\psi}-
\mu\left(\overrightarrow{\psi}^\dag\overrightarrow{\psi}\right)\right]d\textbf{r}\\
\nonumber+\int\left[\frac{\alpha_1}{2}\left(|\psi_+|^4+|\psi_-|^4\right)+
\alpha_2|\psi_+|^2|\psi_-|^2\right]d\textbf{r}\end{aligned}$$
where $\psi_\pm$ are the field operators for right and left circular polarized polaritons, $\overrightarrow{\psi}=(\psi_+,\psi_-)^T$, the coefficients $\alpha_1$ and $\alpha_2$ describe the interaction between the polaritons with same and opposite circular polarizations [@Kirill], $\mu$ is the chemical potential determined by the condensate density at infinity. The parameters we use are connected with those introduced in Ref. in the following way :
$$\begin{aligned}
U_0=\alpha_1,\\
U_1=(\alpha_1-\alpha_2)/2\end{aligned}$$
The tensor of the kinetic energy reads : $$\begin{aligned}
\widehat{\textbf{T}}(-i\nabla)=\left(\begin{array}{cc}\widehat{H}_0(-i\nabla)&\widehat{H}_{TE-TM}(-i\nabla)\\
\widehat{H}_{TE-TM}^\dag(-i\nabla)&\widehat{H}_0(-i\nabla)\end{array}\right)\end{aligned}$$ where the diagonal terms $\widehat{H}_0$ describe the kinetic energy of lower cavity polaritons, and the off-diagonal terms $\widehat{H}_{TE-TM}$ correspond to the longitudinal-transverse splitting, mixing opposite circular polarized components. In our further considerations we will adopt the effective mass approximation,
$$\begin{aligned}
\widehat{H}_0=-\frac{\hbar^2}{2m^*}\nabla^2;\end{aligned}$$
$$\begin{aligned}
\widehat{H}_{TE-TM}=\beta\left(\frac{\partial} {\partial
y}+i\frac{\partial}{\partial x}\right)^2 \label{HTETM}\end{aligned}$$
where $m^*$ is the effective mass of cavity polaritons. The Eq. \[HTETM\] is the simplest form of the Hamiltonian providing the correct symmetry of the effective magnetic field given by the expression \[OmegaEff\] [@Maialle; @Pikus]. The dependence of the absolute value of this field on the wave number is taken to be quadratic, which corresponds well to the effective mass approximation we are using in the current paper. $\beta$ is a constant, characterizing the strength of the TE-TM splitting which can be expressed via the longitudinal and transverse polariton effective masses $m_l$ and $m_t$ :
$$\beta=\frac{\hbar^2}{4}\left(\frac{1}{m_l}-\frac{1}{m_t}\right)
\label{beta}$$
Within the framework of mean-field approximation at $T=0$, the dynamics of the spinor polariton superfluid can be completely described by a set of 2 coupled Gross-Pitaevskii equations [@ShelykhPRL2006], which in the basis of circular polarized states reads :
$$\begin{aligned}
i\hbar\frac{\partial}{\partial t}\left(\begin{array}{cc}\psi_+\\ \psi_-\end{array}\right)=\left(\begin{array}{cc}
-\frac{\hbar^2}{2m^*}\nabla^2-\mu+\alpha_1|\psi_+|^2+\alpha_2|\psi_-|^2 & \beta\left(\frac{\partial}
{\partial y}+i\frac{\partial}{\partial x}\right)^2\\
\beta\left(\frac{\partial}
{\partial y}-i\frac{\partial}{\partial x}\right)^2& -\frac{\hbar^2}{2m^*}\nabla^2-\mu+\alpha_1|\psi_-|^2+\alpha_2|\psi_+|^2 \end{array}\right)
\left(\begin{array}{cc}\psi_+\\ \psi_-\end{array}\right)
\label{GP}\end{aligned}$$
where the chemical potential is $\mu=\left(\alpha_1+\alpha_2\right)n_\infty/2$ with $n_\infty=|\psi_+(\infty)|^2+|\psi_-(\infty)|^2$ being the condensate density far away from the vortex core. Rescaling the variables $\psi_{\pm}\rightarrow\left(\mu/(\alpha_1+\alpha_2)\right)^{1/2}\psi_{\pm}$, $\textbf{r}\rightarrow
\left(\hbar^2/(m^*\mu)\right)^{1/2}\textbf{r}$ and $t\rightarrow\left(\hbar/\mu\right)t$, one can represent the system \[GP\] in the following dimensionless form :
$$\begin{aligned}
i\frac{\partial}{\partial t}\left(\begin{array}{cc}\psi_+\\ \psi_-\end{array}\right)=\left(\begin{array}{cc}
-\frac{1}{2}\nabla^2-1+A_1|\psi_+|^2+A_2|\psi_-|^2 & \chi\left(\frac{\partial}
{\partial y}+i\frac{\partial}{\partial x}\right)^2\\
\chi\left(\frac{\partial}
{\partial y}-i\frac{\partial}{\partial x}\right)^2& -\frac{1}{2}\nabla^2-1+A_1|\psi_-|^2+A_2|\psi_+|^2 \end{array}\right)
\left(\begin{array}{cc}\psi_+\\ \psi_-\end{array}\right)
\label{GPDimensionless}\end{aligned}$$
where $A_{1,2} =\alpha_{1,2} /(\alpha_1+\alpha_2)$ and $\chi=\beta m^*/\hbar^2$.
Let us start our analysis from the simplest case, where the TE-TM splitting can be neglected, $\chi=0$. This case has been considered already in Ref., but we feel that it will be instructive to re-examine it using the basis of the circular polarized states, because the final result is more transparent.
Equations \[GPDimensionless\] allow a time-independent solution, which can be represented in the following form:
$$\begin{aligned}
\overrightarrow{\psi}=\left(\begin{array}{cc} \psi_+(r,\theta)\\
\psi_-(r,\theta)\end{array}\right)=\left(\begin{array}{cc}
f_{+}(r)e^{il_+\theta}\\ f_{-}(r)e^{il_-\theta}\end{array}\right)
\label{PsiVort}\end{aligned}$$
where $(r,\theta)$ are the polar coordinates. Due to the conservation of the z-component of the spin by polariton-polariton interactions, the winding numbers of the two circular polarized components $l_{\pm}$ are independent. Rewriting Eq.\[PsiVort\] in the basis of linear polarized components $\psi_\pm=2^{-1/2}(\psi_X\pm i\psi_Y)$, one easily obtains the relation between our winding numbers $l_\pm$ and those of Ref. :
$$\begin{aligned}
k=\frac{l_+-l_-}{2},\\
m=\frac{l_++l_-}{2}.\end{aligned}$$
The situation describing a half-vortex corresponds to the case where for one circular polarized component the winding number is zero (say $l_+=0$), while for the other one it is ($l_-=+1$). Radial wave functions $f_{\pm}$ satisfy the following set of equations:
$$\begin{aligned}
f_ + ^{''}+f_ + ^{'}+\left(2-2A_{1}f_+^2-2A_{2}f_-^2-\frac{{l_ + ^2}}{{{r^2}}}\right)f_+=0\\
f_ - ^{''}+f_ - ^{'}+\left(2-2A_{1}f_-^2-2A_{2}f_+^2-\frac{{l_ - ^2}}{{{r^2}}}\right)f_-=0\end{aligned}$$
Which corresponds to Eqs.10 of the Ref., if one puts $f_\pm=2^{-1/2}(f\pm g)$.
In the simplest case, when the circular polarized components do not interact ($A_{2}=0$), the half-vortex with $l_+=0$, $l_-=1$ corresponds to a homogeneous distribution of $\sigma_+$ component and a simple vortex in $\sigma_-$. Clear enough, in the center of such a half-vortex the density is non-zero (due to the $\sigma_+$ component) and polarization is circular, since the density of the $\sigma_-$ component is zero in the center of the vortex. Moving from the center of the vortex changes polarization from circular to linear in a continuous manner.
Now let us consider a more interesting case where $\chi\neq0$. The terms associated with the TE-TM splitting rewritten in polar coordinates read:
$$\begin{aligned}
\left(\frac{\partial}{\partial y}\pm i\frac{\partial}{\partial
x}\right)^2 = e^{\mp2i\theta}\left(-\frac{\partial ^2}{\partial
r^2}\pm2ir^{-1}\frac{\partial ^2}{\partial r\partial
\theta}\mp2ir^{-2}\frac{\partial }{\partial\theta}
+r^{-1}\frac{\partial}{\partial r}+r^{-2}\frac{\partial ^2}{\partial
\theta^2}\right) \label{TETMPolar}\end{aligned}$$
The non-zero coupling between the circular polarized components leads to the mutual dependence of their winding numbers. The only cylindrically symmetric solutions of Eqs.\[GPDimensionless\] have the following form:
$$\begin{aligned}
\left(\begin{array}{cc} \psi_+(r,\theta)\\ \psi_-(r,\theta)\end{array}\right)=e^{il\theta}\left(\begin{array}{cc} f_{+}(r)\\ e^{2i\theta}f_{-}(r)\end{array}\right)
\label{AnsatzLT}\end{aligned}$$
which means that necessarily
$$l_+=l=l_--2
\label{Coupling}$$
In terms of Ref. [@Rubo] this state correspond to a winding number $k=-1$. Thus, one can conclude that the presence of the TE-TM splitting does not allow the half-vortex as a stationary solution anymore.
The radial functions describing the vortex core can be found from the following system of coupled equations, which can be obtained by putting expressions \[TETMPolar\], \[AnsatzLT\] into Eq.\[GPDimensionless\].
$$\begin{aligned}
\frac{1}{2}\left(\frac{d^2}{dr^2}+\frac{1}{r}\frac{d}{dr}\right)f_+-\left(A_1f_+^2+A_2 f_-^2-1+\frac{l^2}{2r^{2}}\right)f_++\chi\left(\frac{d^2}{dr^2}+\frac{2l+3}{r}\frac{d}{dr}+\frac{l(l+2)}{r^2}\right)f_-=0 \label{fplus}\\
\frac{1}{2}\left(\frac{d^2}{dr^2}+\frac{1}{r}\frac{d}{dr}\right)f_--\left(A_1f_-^2+A_2
f_+^2-1+\frac{(l+2)^2}{2r^{2}}\right)f_-+\chi\left(\frac{d^2}{dr^2}-\frac{2l+1}{r}\frac{d}{dr}+\frac{l(l+2)}{r^2}\right)f_-=0\label{fminus}\end{aligned}$$
The above equations are quite complicated and only allow numerical solution.
Results and discussion
======================
In this section we present numerical results for radial functions $f_\pm$ and the associated vortex polarization textures. To determine which configuration will have the lowest energy, let us remind that without the TE-TM splitting, the elastic energy of the vortex in a spinor condensate can be estimated as [@Rubo]:
$$\begin{aligned}
E_{el}=\frac{\rho_s}{2}\int\left[(\nabla\theta_+)^2+(\nabla\theta_-)^2\right]d\textbf{r}\\
\nonumber\approx\pi\rho_s\left(l_+^2+l_-^2\right)\textrm{ln}\left(\frac{R}{a}\right)\end{aligned}$$
where $\rho_s=\hbar^2n_\infty/m^*$ is the rigidity or stiffness of the condensate, $a=\hbar/(m^*\mu)^{1/2}$ is the coherence length or the vortex core radius, $R$ is the size of the system and $\theta_\pm$ are the phases of the circular polarized components. From the above formula it follows that if $l_+=l_--2$, the minimal energy corresponds to a vortex $(l_+,l_-)=(-1,+1)$. We thus start our analysis from such a situation.
In this case the radial functions corresponding to the opposite circular polarizations found from numerical solution of Eqs. \[fplus\], \[fminus\] with $l=-1$ are identical and can be satisfactory approximated by the following function plotted at Fig.\[Fig1\] :
$$f_\pm(r)\approx\frac{r}{\sqrt{r^2+1}}
\label{Approx}$$
One should make a remark at this point. Indeed, if $f_+=f_-$ is a solution of \[fplus\] and \[fminus\], this is also the case for $f_+=-f_-$, but in such a situation the pseudospin will point in the opposite direction with respect to the first case. We will talk again about this in the next section.
![(Color online) The exact numerical solution for radial function of (-1,1) vortex (dashed red line) together with the fitting function (solid blue line). The parameter values are $\chi=-1/78$, $A_1=10/9$ and $A_2=-1/9$[]{data-label="Fig1"}](Fig1){width="50.00000%"}
As $f_+=f_-$, the polarization of the system is always linear, which makes the $z$-component of the pseudospin vanish : $S_z=0$. The pseudospin lies in the plane and is at any point aligned with the TE-TM effective field. The orientation of the TE-TM effective field depends on the wave vector orientation, which, in turn, depends on the position of the particles with respect to the core of the vortex. The angular dependence both in reciprocal and real space is given by the formula \[OmegaEff\], which shows that the orientation of the effective field varies as 2 times the polar angle $\varphi$. The resulting polarization pattern is the one of a simple (with only one winding number) vortex with winding number 2, as it’s shown Fig.\[Fig2\]. If one investigates the $f_+=-f_-$ solution, the pseudospin will be totally symmetric and opposed to the TE-TM field, which from one side would cost some energy, but which moreover would be a situation unstable against any perturbation.
Let us now try to understand qualitatively the way the TE-TM splitting would affect a half-vortex state, which could be created, for instance, by some external means. At $t=0$, $\sigma_-$ particles are almost homogeneously covering space and immobile. They are not affected by the TE-TM splitting which is zero at $\overrightarrow{k}=0$. $\sigma_+$ particles are rotating. The pseudo-spin in the non-zero wave vector states is fully aligned along z, perpendicular to the TE-TM field which is in the plane. The pseudo-spin therefore starts to rotate, demonstrating that the half-vortex is not stationary. The speed of rotation is large close to the core where particles rotate fast and where the TE-TM splitting is large, whereas the rotation is slower and slower going away from the center. For each radius, the situation is reminiscent of the one happening in the optical Spin Hall effect [@OSHE]. The density of $\sigma_+$, $\sigma_-$ particles is locally modified, which should provoke a drift of particles perpendicularly to the vortex motion, and probably, a destruction of the vortex. The life time of such a transient state is therefore linked with the value of the TE-TM splitting in the core region. We propose an estimation based on the value of the splitting $\beta_{\xi}$ seen by particles moving at the core radius $\xi$ characterized by a wave vector $\overrightarrow{k}_{\xi}$ :
$$\label{tau}
\tau = \frac{\hbar }{{{\left|\beta _\xi\right|}\left( {{{\overrightarrow k }_\xi }} \right)}}$$
This value can strongly depend on the type of structure, on the value of detuning etc. The typical values which can be expected, however, lie between 10 and a few hundreds of picoseconds. These times are comparable to the typical coherence times which have been measured for polariton condensates. We conclude that the half-vortices could be experimentally observed both in resonant and non-resonant experiments. They are however, intrinsically transient states with a life time probably limited by the TE-TM splitting value. Thus they should be not considered in principle in a rigorous calculation of the BKT critical temperature.
![(Color online) Pseudospin $(S_x,S_y)$ vector field for $(-1,+1)$ configuration. This pattern is known to be the one of a simple vortex with winding number 2. The pseudospin is aligned with the TE-TM effective magnetic field[]{data-label="Fig2"}](Fig2){width="50.00000%"}
The vortex $(-1,+1)$ can be considered as a bound state of two half- vortices, $(-1,0)$ and $(0,+1)$. As it was shown in Ref., without TE-TM splitting the interaction energy of a pair of vortices $(l_{1+},l_{1-})$ and $(l_{2+},l_{2-})$ placed at distance $d$ from each other reads:
$$\begin{aligned}
{E_{int}} \approx 2\pi {\rho _s}({k_1}{k_2} + {m_1}{m_2}){\rm{ln}}\left( {{a \mathord{\left/
{\vphantom {a d}} \right.
\kern-\nulldelimiterspace} d}} \right)\\\nonumber
=\pi {\rho _s}({l_{1 + }}{l_{2 + }} + {l_{1 - }}{l_{2 - }}){\rm{ln}}\left( {{a \mathord{\left/
{\vphantom {a d}} \right.
\kern-\nulldelimiterspace} d}} \right)\end{aligned}$$
According to this formula, the half-vortices $(-1,0)$ and $(0,+1)$ do not interact and the corresponding vortex pair is unbound. Let us reexamine the $(-1,+1)$ case, while adding the distance $d$ between $\sigma_+$ and $\sigma_-$ vortices along the $x$-axis. One has to write the associated wave function in cartesian coordinates with \[Approx\], $r=\sqrt{x^2+y^2}$ and $\theta_\pm=\arctan\left(y/x\right)+\pi H\left(-x\right)$ (H is the Heaviside function):
$$\begin{aligned}
\left(\begin{array}{cc} \psi_+(x+d,y)\\
\psi_-(x-d,y)\end{array}\right)=\left(\begin{array}{cc}
f_{+}(x+d,y)e^{il_+\theta_{+}(x+d,y)}\\ f_{-}(x-d,y)e^{il_-\theta_{-}(x-d,y)}\end{array}\right)
\label{VortPair}\end{aligned}$$
The corresponding pseudospin configuration is shown Fig.\[Fig3\] for $d=5$ and the pattern compared with the one of Fig.\[Fig2\] shows that as $d$ increases, the pseudospin becomes less and less aligned with the TE-TM field and the energy should consequently increase. The normalized TE-TM energy part of the polariton condensate reads:
$$\begin{aligned}
E_{TE-TM}=\rho_s\chi\int\left[\psi_{+}^*\left(\frac{\partial} {\partial y}+i\frac{\partial}{\partial x}\right)^2\psi_{-}+\psi_{-}^*\left(\frac{\partial} {\partial y}-i\frac{\partial}{\partial x}\right)^2\psi_{+}\right]d\textbf{r}
\label{ETETM}\end{aligned}$$
![(Color online) Pseudospin $(S_x,S_y)$ vector field for a separation $d=5$ of the $\sigma_+$ and $\sigma_-$ vortices along the $x$-axis.[]{data-label="Fig3"}](Fig3){width="50.00000%"}
The numerical computation of $E_{TE-TM}$ as a function of $d$ is shown Fig.\[Fig4\]. One can see that the energy increases logarithmically with $d$ and that the lowest energy state is, as expected, the one with $d=0$, where the pseudo-spin is aligned with the effective field. Thus the TE-TM splitting makes $(-1,0)$ and $(0,+1)$ vortices interact and collapse on each other to form a $(-1,+1)$ vortex. Let us remark that for the $f_+=-f_-$ solution, the opposite behavior will be observed and the energy will decrease when the vortices moved away from each other. For $d=0$ and a system of size $\pi R^2$, the TE-TM and the kinetic energy read in polar coordinates: $$\begin{aligned}
E_{kin} = \rho_s\frac{\pi }{2}\left[ {\frac{{{R^2}\left( {{R^2} - 2}
\right)}}{{{{\left( {1 + {R^2}} \right)}^2}}} + 2\ln \left( {1 +
{R^2}} \right)} \right]\label{Ek}\\
E_{TE-TM}= 2\chi E_{kin}\end{aligned}$$
which with Eq.\[beta\], ${m^*}^{-1} = {2^{-1}}\left( {m_t^{-
1} + m_l^{ - 1}} \right)$ and the definitions of $\chi$ and $\rho_s$ gives ${E_c} + {E_{TE - TM}}=E_c^*$, where $E_c^*$ is the kinetic energy associated with the new rigidity constant $\rho _s^* =
{n_\infty }{\hbar ^2}/{m_t}$. One concludes, as it could be expected, that the TE-TM effective magnetic field switches the effective mass $m^*$ to the TE polarized particles mass $m_t$ [@CommentMasses].
![(Color online) TE-TM normalized energy part as a function of the separation $d$ for a $1000\times1000$ square system, the lowest energy is reached for $d=0$[]{data-label="Fig4"}](Fig4){width="50.00000%"}
Finally we will say a word about $(0,+2)$ and $(+1,+3)$ configurations that, if they are not energetically favorable, exhibit interesting pseudospin (polarization) patterns. One can note by the way, that these two states are totally symmetric respectively to $(-2,0)$ and $(-3,-1)$. In these cases radial functions are no more identical for the two components, which will introduce a nonzero circular polarization close to the vortex core. Numerically calculated radial functions are plotted in the upper part of Fig.\[Fig5\] and $S_z(x,y)$ functions as the background of $(S_x,S_y)$ vector fields at the lower part. One can remark that the latter vector fields are exactly the same as the one of Fig.\[Fig2\]. Indeed, this configuration is fixed by the condition \[Coupling\]. The $(0,+2)$ state is peculiar, so far as there is no vortex for $\sigma_+$. Nevertheless, the corresponding radial function is not constant as expected. Indeed, the interaction between circular components implies a small depletion around the center of the system, observed as a minimum at $r=0$. The polarization becomes more and more circular while approaching $r=0$, but is never fully circular. In the $(+1,+3)$ configuration, one has a vortex for each component and the pseudospin $S_z$ component exhibits a maximum before reaching $r=0$ which corresponds to a ring around the vortex core that figures out the maximum of circular polarization degree at about $r=0.6$.
![(Color online) Left column is $(0,+2)$ and right column is $(+1,+3)$ configuration. The top line shows radial functions with a blue line for $f_+$ and a purple line for $f_-$. The bottom line shows $\left(S_x(x,y),S_y(x,y)\right)$ vector fields (white arrows) over $\rho_c=2S_z(x,y)$ (the degree of circular polarization) background.[]{data-label="Fig5"}](Fig5){width="50.00000%"}
conclusions
===========
In conclusion, we analyzed the impact of the TE-TM splitting on vortices in spinor polariton condensates. We have shown that this splitting induces a qualitative change of the nature of the stationary vortex state supported by a polariton condensate. The half-vortices are no more stationary solutions of the spinor Gross-Pitaevskii equations and should not affect the critical temperature of the BKT phase transition. Their life time is of the order of 10 to a few hundreds of ps, limited by the TE-TM splitting value. However, they can, in principle, be observed experimentally. The stable vortex having the smallest energy is the state $(-1,+1)$ (in the circular basis), whose polarization pattern follows the one implied by the peculiar TE-TM symmetry. Polarization textures of other vortex states ($(0,+2)$ and $(+1,+3)$) have also been analyzed.
[99]{}
For review on a subject see e.g. F. Dalfovo et al, *Rev. Mod. Phys.* **71**, 463 (1999); A.J. Legett, *Rev. Mod. Phys.* **73**, 307 (2001); L. Pitaevskii, S. Stringari, Bose-Einstein Condensation, ISBN-13 : 978-0198507192, Oxford University press, 2003.
Yu. S. Kivshar and G. Agrawal, Optical Solitons : From Fibers to Photonic Crystals, ISBN-13 : 978-0124105904, Academic press, 2003.
P. G. Savvidis, J. J. Baumberg, R. M. Stevenson, M. S. Skolnick, D. M. Whittaker, and J. S. Roberts, *Phys. Rev. Lett.* **84**, 1547 (2000).
A. Imamoglu and J. R. Ram, *Phys. Lett. A* **214**, 193 (1996).
G. Malpuech, A. Di Carlo, A. Kavokin, J. J. Baumberg, M. Zamfirescu, P. Lugli, *Appl. Phys. Lett.* **81**, 412 (2002).
M. Zamfirescu, A. Kavokin, B. Gil, G. Malpuech, and Mikhail Kaliteevski, *Phys. Rev. B* **65**, 161205 (2002).
M. Richard, J. Kasprzak, R. Andre, R. Romestain, and Le Si Dang, *Phys. Rev. B* **72**, 201301 (2005).
J. Kasprzak, M. Richard, S. Kundermann, A. Baas, P. Jeambrun, J. M. J. Keeling, F. M. Marchetti, M. H. Szymanska, R. Andre, J. L. Staehli, V. Savona, P. B. Littlewood, B. Deveaud, and Le Si Dang, *Nature* **443**, 409 (2006).
R. Balili, V. Hartwell, D. Snoke, L. Pfeiffer, and K. West, *Science* **316**, 1007 (2007).
S. Utsunomiya, L. Tian, G. Roumpos, C. W. Lai, N. Kumada, T. Fujisawa, M. Kuwata-Gonokami, A. Loffler, S. Hofling, A. Forchel, and Y. Yamamoto, *Nature Physics* **4**, 700-705 (2008).
J.J. Baumberg, A.V. Kavokin, S. Christopoulos, A. J. D. Grundy, R. Butte, G. Christmann, D. D. Solnyshkov, G. Malpuech, G. Baldassarri, Hoger von Hogersthal, E. Feltin, J.-F. Carlin, and N. Grandjean, *Phys.Rev.Lett*. **101**, 136409 (2009).
G. Christmann, R. Butte, E. Feltin, J. F. Carlin, and N. Grandjean *Appl. Phys. Lett.* **93**, 051102 (2008).
J. Kasprzak, D.D. Solnyshkov, R. Andre, Le Si Dang, and G. Malpuech, *Phys. Rev. Lett.* **101**, 146404, (2008).
E. Wertz, L. Ferrier, Dmitry D. Solnyshkov, P. Senellart, D. Bajoni, A. Miard, A. Lemaitre, G. Malpuech, and J. Bloch, *Appl. Phys. Lett.* **95**, 051108 (2009).
G. Malpuech, Y.G. Rubo, F. P. Laussy, P. Bigenwald and A. Kavokin, *Semicond. Sci. and Technol.* **18**, Special issue on microcavities, edited by J.J. Baumberg and L. Vina, S 395, (2003).
G. Malpuech, D. Solnyshkov, H. Ouerdane, M. Glazov, I. Shelykh, *Phys. Rev. Lett.* **98**, 206402 (2007).
D. Sanvitto, A. Amo, L. Vina, R. Andre, D. Solnyshkov, and G. Malpuech *Phys. Rev.B* **80**, 045301, (2009).
C. W. Lai, N. Y. Kim, S. Utsunomiya, G. Roumpos, H. Deng, M. D. Fraser, T. Byrnes, P. Recher, N. Kumada, T. Fujisawa, Y. Yamamoto, *Nature Physics* **450**, 529-532 (2007).
M. H. Szymanska, J. Keeling, and P. B. Littlewood, *Phys. Rev. Lett.* **96** 230602, (2006).
M. Wouters and I. Carusotto, *Phys. Rev. Lett.* **99**, 140402 (2007).
I. Carusotto and C. Ciuti, *Phys. Rev. Lett.* **93**, 166401 (2004).
D. D. Solnyshkov, I. A. Shelykh, N. A. Gippius, A. V. Kavokin, and G. Malpuech, *Phys. Rev. B* **77**, 045314 (2008).
A. Amo et al., *Nature* 2009.
M. Richard, A. Baas, I. Carusotto, R. Andre, Le Si Dang, B. Deveaud-Pledran, K. G. Lagoudakis and M. Wouters, *Nature Physics* **4**, 706-710 (2008).
Yu. G. Rubo, *Phys. Rev. Lett.* **99**, 106401 (2007).
J. Keeling and N.G. Berloff, *Phys. Rev. Lett.* **100**, 250401 (2008).
Giovanna Panzarini, Lucio Claudio Andreani, A. Armitage, D. Baxter, M. S. Skolnick, V. N. Astratov, J. S. Roberts, Alexey V. Kavokin, Maria R. Vladimirova, and M. A. Kaliteevski *Phys. Rev. B* **59**, 5082 (1999).
See, however, the work where it was argued that dark states can sometimes play substantial role, I.A. Shelykh, L.Vina, A.V. Kavokin, N.G. Galkin, G.Malpuech and R.Andre, *Solid State Comm.* **135**, 1 (2005).
K.V. Kavokin, I. A. Shelykh, A.V. Kavokin, G. Malpuech, P. Bigenwald, *Phys. Rev. Lett.* **92**, 017401 (2004).
M.D. Martin, G. Aichmayr, L. Vina, R. Andre, *Phys. Rev. Lett.* **89**, 077402 (2002).
M. Z. Maialle, E. A. de Andrada e Silva, and L. J. Sham, *Phys. Rev. B* **47**, 15776 (1993).
G. Panzarini, L.C. Andreani, A. Armitage, D. Baxter, M.S. Skolnick, V.N. Astratov, J.S. Roberts, A.V. Kavokin, M.R. Vladimirova, and M.A. Kaliteevski, *Phys. Rev. B* **59**, 5082 (1999).
C. Leyder, M. Romanelli, J.-Ph. Karr, E. Giacobino, T.C.H. Liew, M.M. Glazov, A.V. Kavokin, G. Malpuech, and A. Bramati, *Nature Physics* **3**, 628 (2007).
W. Langbein, I.A. Shelykh, D. Solnyshkov, G. Malpuech, Yu. Rubo and A. Kavokin, *Phys. Rev. B* **75**, 075323 (2007).
T. Liew, A.V. Kavokin, I.A. Shelykh, *Phys. Rev. B* **75**, 241301 (2007).
M. Combescot and O. Betbeder-Matibet, *Phys. Rev. B* **74**, 125316 (2006).
D.N. Krizhanovskii, D. Sanvitto, I.A. Shelykh, M.M. Glazov, G.Malpuech, D.D. Solnyshkov, A. Kavokin, M.S. Skolnick and J.S. Roberts, *Phys. Rev. B* **73**, 073303 (2006).
F. Laussy, I.A. Shelykh, A.V. Kavokin, G. Malpuech, *Phys. Rev. B* **73**, 035315 (2006).
J. M. Kosterlitz and D. J. Thouless, *J. Phys. C* **6**, 1181 (1973).
The topological defects analogical to half-vortices were studied earlier in a context of the investigation of non-conventional superconductors, I. A. Lukyanchuk and M. E. Zhitomirsky, *Supercond. Rev.* **1**, 207 (1995).
In realistic situations usually $\alpha_1$ is about 10-20 times bigger then $\alpha_2$, see P. Renucci, T. Amand, X. Marie, P. Senellart, J. Bloch, B. Sermage, and K. V. Kavokin, *Phys. Rev. B* **72**, 075317 (2005).
G. E. Pikus and G. L. Bir, *Zh. Eksp. Teor. Fiz.* **60**, 195 (1971) *Sov. Phys. JETP* **33**, 108 (1971).
I.A. Shelykh, Yu. G. Rubo, G. Malpuech, D.D. Solnyshkov, A.V. Kavokin, *Phys. Rev. Lett.* **97**, 066402 (2006).
We supposed that $m_t>m_l$ and thus $\chi<0$. In the case of the vortex in which the pseudospin is oriented antiparallel to effective magnetic field, one should replace $m_t$ by $m_l$.
|
Energy Secretary Ed Davey has set out a "once-in-a-generation transformation" of the UK's power sector which ministers hope will keep the lights on, drive growth and jobs and cut emissions.
The long-delayed Energy Bill allows ministers to treble investment in low-carbon power generation to £7.6 billion by 2020, up from £2.35 billion this year.
But its failure to include a target to slash emissions from the electricity sector by 2030 has led to criticism from environmental groups that the measures do not go far enough to secure the investment in green technology needed in the next two decades.
Concerns have also been raised that the trebling of funding for green power sources such as wind farms this decade, which will be levied on fuel bills, will push up already soaring household energy costs.
Mr Davey insisted that government policies were designed to reduce consumer bills and prevent them being at the mercy of rising global fossil fuel prices. Overall, government policies on electricity generation and support for energy efficiency measures would reduce bills, he said. He told MPs in the Commons: "The net effect of government policy on energy bills is downward, not upwards."
Current analysis from the Department of Energy and Climate Change (DECC) suggests the average household bill will be 7% or £94 lower in 2020 than it would without all the policies the Government is pursuing in the sector. Mr Davey has said the support for low-carbon electricity will add less than £100 a year to bills.
An estimated £110 billion is needed in the next decade to renew the UK's ageing electricity infrastructure, with much set to go into low-carbon power sources such as wind farms.
The Energy Bill sets out plans for long-term contracts which will ensure companies are paid a guaranteed price for the electricity they generate from low-carbon sources, to overcome the high capital costs of offshore wind and nuclear reactors.
The Energy Secretary told MPs: "We are now preparing a once-in-a-generation transformation of the energy landscape to bring on massive private sector investment which will boost the economy, create jobs and power Britain towards a prosperous low carbon future."
The Bill will also include measures to ensure consumers are on the lowest tariff that suits their needs, after an intervention by Prime Minister David Cameron which caused surprise and confusion in many quarters. Other measures set out include a "capacity mechanism" in which companies will be able to bid for support to provide power sources or reduce demand to ensure the lights stay on even during peak demand. |
Interleukin 6 destabilizes atherosclerotic plaques by downregulating prolyl-4-hydroxylase α1 via a mitogen-activated protein kinase and c-Jun pathway.
Interleukin 6 (IL-6) is a pivotal cytokine that regulates extracellular matrix metabolism by ameliorating the modification of collagen content, important in fibrous caps of atherosclerotic plaque. Prolyl-4-hydroxylase α1 (P4Hα1) is a key intracellular enzyme required for synthesis of collagen in animals. We investigated the relationship of IL-6 and P4Hα1 in atherosclerosis-prone mice and human aortic smooth muscle cells (HASMCs). Apolipoprotein E (ApoE)-/- mice were fed a high-fat diet and a perivascular constrictive silica collar was placed on the right common carotid artery to induce atherosclerotic lesions, then mice were divided into two groups for transfection with empty lentivirus or IL-6 lentivirus. HASMCs were transfected with small interfering RNA or treated with recombinant human IL-6. IL-6 significantly downregulated collagen, P4Hα1 and smooth muscle cell contents in atherosclerotic mouse arteries. Macrophage and lipid contents in the atherosclerotic area were significantly increased with IL-6 treatment. IL-6 significantly downregulated P4Hα1 expression in HASMCs through an RAF-MEK1/2-ERK1/2 mitogen-activated protein kinase (MAPK) pathway, and c-Jun was involved in the process. Our findings highlight IL-6 destabilize atherosclerotic plaques in mice by downregulating P4Hα1 via an RAF-MEK1/2-ERK1/2 MAPK and c-Jun pathway. |
Time to come in from the cold.
Securitisation, or the packaging and selling of debt instruments, has been a dirty word in Europe since the global financial crisis. But policy makers from Yves Mersch at the European Central Bank to Andrew Haldane at the Bank of England are increasingly talking of the need to revive securitisation in Europe. That is encouraging.
The market seems unlikely to boom any time soon. Regulatory hurdles are much higher than before the crisis, and end-demand for consumer and corporate borrowing in Europe remains uncertain given the anaemic growth outlook.
Still, any progress on this front could help spur more lending in Europe, especially as banks continue to look to shed assets to clear higher regulatory hurdles. And European securitisation deals issued before the crisis have held up remarkably well, showing the practice has merit.
Excluding covered bonds, where defaults have been zero, only €41.5 billion of the €1.7 trillion of European securitisations rated by Standard & Poor's by mid-2007 have defaulted, the ratings firm notes. Losses on residential mortgage-backed securities, the largest part of the market, have been just 0.1%. By contrast, the structured-finance default rate for US deals since mid-2007 is 18.4%, S&P notes.
The turmoil caused by the eurozone debt crisis and the subsequent deep European recession and soaring unemployment make these figures all the more impressive, and show that securitisation can be a valuable tool. Yet while US issuance of asset-backed securities has bounced back post-crisis, in Europe it remains moribund: just €50.7 billion of securities were sold to investors in the first three quarters of 2013, 12% less than in the same period of 2012, according to industry body Sifma.
A crucial issue is whether there are sufficient buyers for European securitisations. Pre-crisis, a large chunk of issuance was bought by banks or by vehicles set up by banks. When the crisis hit, their funding sources dried up and they were forced to sell, whether the assets were good or not: all securitisations were tarred with the same brush.
There may be some demand from banks in the future since some high-quality securitisations will count as liquid assets that banks are required to hold. But they are being encouraged far more to buy other securities such as covered bonds. The market needs a new, broader investor base.
Related
Securitisation is also unlikely to be a silver bullet for policy makers' latest hot-button issue: funding for small- and medium-size enterprises. While consumer loans are well-suited for securitisation, corporate loans tend to be more idiosyncratic, particularly for small businesses.
And there are still questions around whether the economics of securitisation will help those parts of Europe that might benefit most. In Spain, for instance, the price of senior slices of residential mortgage-backed securities is high compared with benchmarks, making such deals uneconomic, JP Morgan notes.
These hurdles need to be overcome; progress may well be slow. But the first step is to tone down the demonisation of securitisation. Rehabilitation by policy makers is overdue but welcome. |
(CNN) Vermont Sen. Bernie Sanders' lead in New Hampshire continues to hold, according to the second release from a tracking poll conducted by the University of New Hampshire for CNN.
Saturday's interviews, which make up roughly a quarter of the poll's sample, show Klobuchar having her best day in the tracker so far, while Warren had her worst.
Still, the major contours of the race have held steady: Sanders continues to outpace Buttigieg by a wide margin among those who have definitely made up their minds about whom to support, while the two top contenders run about even among those who have yet to commit to a candidate.
Read More |
Q:
C Program: Updating max and min integers without using arrays
I'm experimenting with a simple C program that should prompt user to enter a chosen number of positive integers. I'm having an issue getting the maximum and minimum of the set of integers I input without the use of an array.
The way that I currently have it is that it will update the max and min among the last two entered values. If someone wouldn't mind looking to see what I'm doing wrong, it would be appreciated.
take a look here:
#include<stdio.h>
int main()
{
int N ,i, value=0, min=0, max=0, sum=0, oldmin=0, Newmin=0, oldmax=0, Newmax=0;
double mean;
do{
printf("How many values are to be entered?: ");
scanf("%d", &N);
printf("\n");
if (N>0){
do{
if (N>0){
// 1st value updated
for (i=1;i<=N;i++)
{
printf("Value %d:\n",i);
scanf("%d", &value);
sum = sum+value;
}
mean = (double)sum/(double)N;
//max
if(oldmax<Newmax){
max = Newmax;
}
else max = oldmax;
//min
if(oldmin>Newmin){
min = Newmin;
}
else min = oldmin;
}
else printf("INPUT ERROR!\n");
}
while(N<0);
printf("\nThe minimum value is %d, the maximum value is %d, and the average value is %.2lf.",min,max,mean);
}else printf("INPUT ERROR!\n");
} while(N<0);
return 0;}
A:
if(oldmax<Newmax){
Don't compare newmax and oldmax. Compare max and value. Same with min.
I'm not even sure about the purpose of Newmax and oldmax. Remove these variables all-together, as it will just confuse you.
Just use min, max, and value. It will sort out.
A:
some remarks :
you need to set the min/max value from value in the same loop you do sum = sum+value; , this is the reason of your problem about min/max
check the scanf result to be sure a number was enter
if (N>0){ do{ if (N>0){ so two check but N never change
if (N > 0) { do { ... } while (N<0); } that has no sense
the embedded loops have no sense, only 1 loop is needed
A proposal removing the problems :
#include<stdio.h>
int main()
{
int N;
fprintf(stderr, "How many values are to be entered?: ");
if ((scanf("%d", &N) != 1) || (N <= 0))
printf("INPUT ERROR!\n");
else {
int i, min, max, sum = 0;
for (i = 0; i < N; ++i) {
int value;
fprintf(stderr, "Value %d:\n",i);
if (scanf("%d", &value) != 1) {
printf("INPUT ERROR!\n");
return -1;
}
sum = sum+value;
if (i == 0) {
min = max = value;
}
else {
if (value < min)
min = value;
if (value > max)
max = value;
}
}
printf("\nThe minimum value is %d, the maximum value is %d, and the average value is %.2lf\n",
min,max, (double)sum/(double)N);
}
return 0;
}
Compilation and execution :
pi@raspberrypi:/tmp $ gcc -g -pedantic -Wextra c.c
pi@raspberrypi:/tmp $ ./a.out
How many values are to be entered?: 3
Value 0:
1
Value 1:
2
Value 2:
3
The minimum value is 1, the maximum value is 3, and the average value is 2.00
I used fprintf to flush the message with a \n, and I set the first min and max value on the first turn to not have to use the MIN_INT MAX_INT may be not defined for you
|
[From anamnesis to the art of interpretation, or: What is a "genuine" psychoanalyst? Wolfgang Warda, Ludwig Binswanger, Wilhelm Strohmayer and the origins of psychoanalysis in Thuringia].
Warda and Strohmayer from Thuringia were among the first German physicians who developed an interest in Freuds theory and therapeutic method around 1900. Their contributions reflect the influence of Otto Binswanger, professor of psychiatry in Jena, a representative of the "psychological direction" in psychiatry which in the beginning was relatively receptive to Freud. The paper discusses their rapprochement to, and detachment from, the Freudian school, including also the work of a third young physician: Ludwig Binswanger, Otto's nephew, who was active in Jena at the same time. It points to certain factors contributing to the increasing rejection Freud met in academic circles which have been underrated to date: (1) the transformation of psychoanalysis into an art of interpretation; (2) the introduction of transference. Both factors which were elaborated by Freud as essentials of his theoretical and practical approach around 1900 and published in 1904/05, undermined the claim of academic medicine to objectivity. The paper describes how psychoanalysis officially abandoned the scientific standards of contemporary medicine at the Weimar congress in 1911, at the same time as Warda and Strohmayer left the Freudian group. |
Friday, May 30, 2008
So for Memorial Day weekend while Jeremy worked on Sat my dad, brother, grandmother, mom, and owen all went to spanish fork cemetary. Pretty much my whole mom's side is there and its really cool to see all the names of my ansestors there together. After we had lunch at this little hole in the wall place its sortof a tradition in my family to have lunch there after we go put flowers down. It goes back clear to my great grandma morgan she would make my mom and siblings stop for a icecream. Pretty cool i could introduce it to owen.
Jer had to work again on sunday but finally on monday he was off! We really love his days off with us. We wanted to make it a fun day for Owen since his days off are usually filled with honey-do's from me that we dont make it out of the house! We bought tickets to A Day with Thomas in Heber. We chose the earliest time to ride the train so we could divide our time between our families the rest of the day. It seemed like a good idea at the time but waking up at 6:30 to get ready and get out there by 9 was no good! Plus it was raining cats and dogs. Owen had on 3 layers of clothes and a hoodie but i stupidly forgot his gloves so his little hads were just about froze till we pulled them into his coat to be next to the warmness of his body. He looked pretty funny and just as we did it the train conductor came by and we asked for a picture with him. I wonder if he thought Owen didnt have arms at all!?! He did kinda look at him strangley.......whatever.
The ride was very short for the money we forked out but we made it up with the little pony's they had in a pen to pet. They were so cute the one in the picture is only a month old and his name was oreo! Owen loved him can you belive how tiny he is standing next to owen i am just thankfull he didnt want to ride him with all the rodeo action we got in our house! |
Pencils
Want to bring an easy smile to your students', friends' or employees' faces? Consider novelty pencils! U.S. School Supply has a wide variety of colorful, fun, novelty and designer pencils to choose from. From birthday pencils to motivational
classroom pencils; you're sure to find the style of school pencil you need to spread the joy at US School Supply. We also offer imprinted pencils. |
The notoriously sensitive media giant cut off the Times’ access in response to the newspaper’s coverage of Disney’s business ties with the city of Anaheim. The article published last month examined the public policy debate around whether Disney, which has received subsidies, incentives, rebates and protections from future taxes on its Disneyland theme park, is paying its fair share. |
This shows an atomic-scale model of a nanophononic metamaterial. The vibrations caused by the pillar slow down the horizontal flow of heat through the thin film. Credit: Mahmoud Hussein
University of Colorado Boulder scientists have found a creative way to radically improve thermoelectric materials, a finding that could one day lead to the development of improved solar panels, more energy-efficient cooling equipment, and even the creation of new devices that could turn the vast amounts of heat wasted at power plants into more electricity.
The technique—building an array of tiny pillars on top of a sheet of thermoelectric material—represents an entirely new way of attacking a century-old problem, said Mahmoud Hussein, an assistant professor of aerospace engineering sciences who pioneered the discovery.
The thermoelectric effect, first discovered in the 1800s, refers to the ability to generate an electric current from a temperature difference between one side of a material and the other. Conversely, applying an electric voltage to a thermoelectric material can cause one side of the material to heat up while the other stays cool, or, alternatively, one side to cool down while the other stays hot.
Devices that incorporate thermoelectric materials have been used in both ways: to create electricity from a heat source, such as the sun, for example, or to cool precision instruments by consuming electricity.
However, the widespread use of thermoelectric materials has been hindered by a fundamental problem that has kept scientists busy for decades. Materials that allow electricity to flow through them also allow heat to flow through them. This means that at the same time a temperature difference creates an electric potential, the temperature difference itself begins to dissipate, weakening the current it created.
Until the 1990s, scientists addressed this problem by looking for materials with intrinsic properties that allowed electricity to flow more easily than heat.
"Until 20 years ago, people were looking at the chemistry of the materials," Hussein said. "And then nanotechnology came into the picture and allowed researchers to engineer the materials for the properties they wanted."
Using nanotechnology, material physicists began creating barriers in thermoelectric materials—such as holes or particles—that impeded the flow of heat more than the flow of electricity. But even under the best scenario, the flow of electrons—which carry electric energy—also was slowed.
In a new study published in the journal Physical Review Letters, Hussein and doctoral student Bruce Davis demonstrate that nanotechnology could be used in an entirely different way to slow the heat transfer without affecting the motion of electrons.
The new concept involves building an array of nanoscale pillars on top of a sheet of a thermoelectric material, such as silicon, to form what the authors call a "nanophononic metamaterial." Heat is carried through the material as a series of vibrations, known as phonons. The atoms making up the miniature pillars also vibrate at a variety of frequencies. Davis and Hussein used a computer model to show that the vibrations of the pillars would interact with the vibrations of the phonons, slowing down the flow of heat. The pillar vibrations are not expected to affect the electric current.
The team estimates that their nanoscale pillars could reduce the heat flow through a material by half, but the reduction could be significantly stronger because the calculations were made very conservatively, Hussein said.
"If we can improve thermoelectric energy conversion significantly, there will be all kinds of important practical applications," Hussein said. These include recapturing the waste heat emitted by different types of equipment—from laptops to cars to power plants—and turning that heat into electricity. Better thermoelectrics also could vastly improve the efficiency of solar panels and refrigeration devices.
The next step is for Hussein to partner with colleagues in the physics department and other institutions to fabricate the pillars so that the idea can be tested in the lab. "This is still early in the phase of laboratory demonstration but the remaining steps are within reach."
Hussein also hopes to further refine the models he used to gain additional insight into the underlying physics. "A team of highly motivated Ph.D. students are working with me around the clock on this project," he said.
Explore further Large thermoelectric power from a combination of magnets and superconductors |
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.coldFusion.model.files;
import com.intellij.coldFusion.CfmlBundle;
import com.intellij.coldFusion.model.CfmlLanguage;
import com.intellij.openapi.fileTypes.LanguageFileType;
import icons.CFMLIcons;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import javax.swing.*;
/**
* Created by Lera Nikolaenko
*/
public final class CfmlFileType extends LanguageFileType {
public static final CfmlFileType INSTANCE = new CfmlFileType();
private CfmlFileType() {
super(CfmlLanguage.INSTANCE);
}
@Override
@NotNull
public String getName() {
return "CFML";
}
@Override
@NotNull
public String getDescription() {
return CfmlBundle.message("file.type.description.coldfusion");
}
@Override
@NotNull
public String getDefaultExtension() {
return "cfm";
}
@Override
public Icon getIcon() {
return CFMLIcons.Cfml;
}
@NonNls
public String @NotNull [] getExtensions() {
return new String[]{"cfm", "cfml", "cfc"};
}
}
|
1. Lhermitte, J., Lévy, G. & Kyriaco, N. Les perturbations de la représentation spatiale chez les apraxiques. Rev. Neurol. (Paris) 2, 586–600 (1925).
2. Rebeiz, J. J., Kolodny, E. H. & Richardson, E. P. Jr. Corticodentatonigral degeneration with neuronal achromasia. Arch. Neurol. 18, 20–33 (1968).
3. Gibb, W. R. G., Luthert, P. J. & Marsden, C. D. Corticobasal degeneration. Brain 112, 1171–1192 (1989).
4. Di Maria, E. et al. Corticobasal degeneration shares a common genetic background with progressive supranuclear palsy. Ann. Neurol. 47, 374–377 (2000).
5. Houlden, H. et al. Corticobasal degeneration and progressive supranuclear palsy share a common tau haplotype. Neurology 56, 1702–1706 (2001).
6. Kouri, N. et al. Genome-wide association study of corticobasal degeneration identifies risk variants shared with progressive supranuclear palsy. Nat. Commun. 6, 7247 (2015).
7. Feany, M. B. & Dickson, D. W. Widespread cytoskeletal pathology characterizes corticobasal degeneration. Am. J. Pathol. 146, 1388–1396 (1995).
8. Komori, T. et al. Astrocytic plaques and tufts of abnormal fibers do not coexist in corticobasal degeneration and progressive supranuclear palsy. Acta Neuropathol. 96, 401–408 (1998).
9. Arai, T. et al. Identification of amino-terminally cleaved tau fragments that distinguish progressive supranuclear palsy from corticobasal degeneration. Ann. Neurol. 55, 72–79 (2004).
10. Rösler, T. W. et al. Four-repeat tauopathies. Prog. Neurobiol. 180, 101644 (2019).
11. Paulus, W. & Selim, M. Corticonigral degeneration with neuronal achromasia and basal neurofibrillary tangles. Acta Neuropathol. 81, 89–94 (1990).
12. Wakabayashi, K. et al. Corticobasal degeneration: etiopathological significance of the cytoskeletal alterations. Acta Neuropathol. 87, 545–553 (1994).
13. Ksiezak-Reding, H. et al. Ultrastructure and biochemical composition of paired helical filaments in corticobasal degeneration. Am. J. Pathol. 145, 1496–1508 (1994).
14. Arima, K. et al. Corticonigral degeneration with neuronal achromasia presenting with primary progressive aphasia: ultrastructural and immunocytochemical studies. J. Neurol. Sci. 127, 186–197 (1994).
15. Sergeant, N., Wattez, A. & Delacourte, A. Neurofibrillary degeneration in progressive supranuclear palsy and corticobasal degeneration: tau pathologies with exclusively “exon 10” isoforms. J. Neurochem. 72, 1243–1249 (1999).
16. Goedert, M., Eisenberg, D. S. & Crowther, R. A. Propagation of tau aggregates and neurodegeneration. Annu. Rev. Neurosci. 40, 189–210 (2017).
17. Fitzpatrick, A. W. P. et al. Cryo-EM structures of tau filaments from Alzheimer’s disease. Nature 547, 185–190 (2017).
18. Falcon, B. et al. Structures of filaments from Pick’s disease reveal a novel tau protein fold. Nature 561, 137–140 (2018).
19. Falcon, B. et al. Novel tau filament fold in chronic traumatic encephalopathy encloses hydrophobic molecules. Nature 568, 420–423 (2019).
20. Taniguchi-Watanabe, S. et al. Biochemical classification of tauopathies by immunoblot, protein sequence and mass spectrometric analyses of sarkosyl-insoluble and trypsin-resistant tau. Acta Neuropathol. 131, 267–280 (2016).
21. Ksiezak-Reding, H. et al. Ultrastructural instability of paired helical filaments from corticobasal degeneration as examined by scanning transmission electron microscopy. Am. J. Pathol. 149, 639–651 (1996).
22. Robinson, J. L. et al. Neurodegenerative disease concomitant proteinopathies are prevalent, age-related and APOE4-associated. Brain 141, 2181–2193 (2018).
23. Uryu, K. et al. Concomitant TAR-DNA-binding protein 43 pathology is present in Alzheimer disease and corticobasal degeneration but not in other tauopathies. J. Neuropathol. Exp. Neurol. 67, 555–564 (2008).
24. Cali, C. P. et al. C9orf72 intermediate repeats are associated with corticobasal degeneration, increased C9orf72 expression and disruption of autophagy. Acta Neuropathol. 138, 795–811 (2019).
25. He, S. & Scheres, S. H. W. Helical reconstruction in RELION. J. Struct. Biol. 198, 163–176 (2017).
26. Ling, H. et al. Astrogliopathy predominates the earliest stage of corticobasal degeneration pathology. Brain 139, 3237–3252 (2016).
27. Shibuya, K., Yagishita, S., Nakamura, A. & Uchihara, T. Perivascular orientation of astrocytic plaques and tuft-shaped astrocytes. Brain Res. 1404, 50–54 (2011).
28. Goedert, M., Spillantini, M. G., Jakes, R., Rutherford, D. & Crowther, R. A. Multiple isoforms of human microtubule-associated protein tau: sequences and localization in neurofibrillary tangles of Alzheimer’s disease. Neuron 3, 519–526 (1989).
29. Clavaguera, F. et al. Brain homogenates from human tauopathies induce tau inclusions in mouse brain. Proc. Natl Acad. Sci. USA 110, 9535–9540 (2013).
30. Sanders, D. W. et al. Distinct tau prion strains propagate in cells and mice and define different tauopathies. Neuron 82, 1271–1288 (2014).
31. Narasimhan, S. et al. Pathological tau strains from human brains recapitulate the diversity of tauopathies in nontransgenic mouse brain. J. Neurosci. 37, 11406–11423 (2017).
32. von Bergen, M. et al. Assembly of τ protein into Alzheimer paired helical filaments depends on a local sequence motif (306VQIVYK311) forming β structure. Proc. Natl Acad. Sci. USA 97, 5129–5134 (2000).
33. von Bergen, M. et al. Mutations of tau protein in frontotemporal dementia promote aggregation of paired helical filaments by enhancing local β-structure. J. Biol. Chem. 276, 48165–48174 (2001).
34. Falcon, B. et al. Conformation determines the seeding potencies of native and recombinant Tau aggregates. J. Biol. Chem. 290, 1049–1065 (2015).
35. Macdonald, J. A. et al. Assembly of transgenic human P301S Tau is necessary for neurodegeneration in murine spinal cord. Acta Neuropathol. Commun. 7, 44 (2019).
36. Gustke, N., Trinczek, B., Biernat, J., Mandelkow, E. M. & Mandelkow, E. Domains of tau protein and interactions with microtubules. Biochemistry 33, 9511–9522 (1994).
37. Zhang, W. et al. Heparin-induced tau filaments are polymorphic and differ from those in Alzheimer’s and Pick’s diseases. eLife 8, e43584 (2019).
38. Dan, A. et al. Extensive deamidation at asparagine residue 279 accounts for weak immunoreactivity of tau with RD4 antibody in Alzheimer’s disease brain. Acta Neuropathol. Commun. 1, 54 (2013).
39. Kara, E. et al. The MAPT p.A152T variant is a risk factor associated with tauopathies with atypical clinical and neuropathological features. Neurobiol. Aging 33, 2231.e7–2231.e14 (2012).
40. Coppola, G. et al. Evidence for a role of the rare p.A152T variant in MAPT in increasing the risk for FTD-spectrum and Alzheimer’s diseases. Hum. Mol. Genet. 21, 3500–3512 (2012).
41. Conrad, C. et al. Differences in a dinucleotide repeat polymorphism in the tau gene between Caucasian and Japanese populations: implication for progressive supranuclear palsy. Neurosci. Lett. 250, 135–137 (1998).
42. Evans, W. et al. The tau H2 haplotype is almost exclusively Caucasian in origin. Neurosci. Lett. 369, 183–185 (2004).
43. Farlow, J. L. et al. Whole-exome sequencing in familial Parkinson disease. JAMA Neurol. 73, 68–75 (2016).
44. Wang, K., Li, M. & Hakonarson, H. ANNOVAR: functional annotation of genetic variants from high-throughput sequencing data. Nucleic Acids Res. 38, e164 (2010).
45. Goedert, M., Spillantini, M. G., Cairns, N. J. & Crowther, R. A. Tau proteins of Alzheimer paired helical filaments: abnormal phosphorylation of all six brain isoforms. Neuron 8, 159–168 (1992).
46. de Silva, R. et al. Pathological inclusion bodies in tauopathies contain distinct complements of tau with three or four microtubule-binding repeat domains as demonstrated by new specific monoclonal antibodies. Neuropathol. Appl. Neurobiol. 29, 288–302 (2003).
47. Mercken, M. et al. Monoclonal antibodies with selective specificity for Alzheimer Tau are directed against phosphatase-sensitive epitopes. Acta Neuropathol. 84, 265–272 (1992).
48. Hasegawa, M. et al. Phosphorylated TDP-43 in frontotemporal lobar degeneration and amyotrophic lateral sclerosis. Ann. Neurol. 64, 60–70 (2008).
49. Inukai, Y. et al. Abnormal phosphorylation of Ser409/410 of TDP-43 in FTLD-U and ALS. FEBS Lett. 582, 2899–2904 (2008).
50. Ebashi, M. et al. Detection of AD-specific four repeat tau with deamidated asparagine residue 279-specific fraction purified from 4R tau polyclonal antibody. Acta Neuropathol. 138, 163–166 (2019).
51. Spina, S. et al. The tauopathy associated with mutation +3 in intron 10 of Tau: characterization of the MSTD family. Brain 131, 72–89 (2008).
52. Gallyas, F. Silver staining of Alzheimer’s neurofibrillary changes by means of physical development. Acta Morphol. Acad. Sci. Hung. 19, 1–8 (1971).
53. Braak, H., Braak, E., Ohm, T. & Bohl, J. Silver impregnation of Alzheimer’s neurofibrillary changes counterstained for basophilic material and lipofuscin pigment. Stain Technol. 63, 197–200 (1988).
54. Nonaka, T., Watanabe, S. T., Iwatsubo, T. & Hasegawa, M. Seeded aggregation and toxicity of α-synuclein and tau: cellular models of neurodegenerative diseases. J. Biol. Chem. 285, 34885–34898 (2010).
55. Zheng, S. Q. et al. MotionCor2: anisotropic correction of beam-induced motion for improved cryo-electron microscopy. Nat. Methods 14, 331–332 (2017).
56. Zhang, K. Gctf: real-time CTF determination and correction. J. Struct. Biol. 193, 1–12 (2016).
57. Scheres, S. H. W. RELION: implementation of a Bayesian approach to cryo-EM structure determination. J. Struct. Biol. 180, 519–530 (2012).
58. Zivanov, J. et al. New tools for automated high-resolution cryo-EM structure determination in RELION-3. eLife 7, e42166 (2018).
59. Scheres, S. H. W. Amyloid structure determination in RELION-3.1. Acta Crystallogr. D 76, 94–101 (2020).
60. Chen, S. et al. High-resolution noise substitution to measure overfitting and validate resolution in 3D structure determination by single particle electron cryomicroscopy. Ultramicroscopy 135, 24–35 (2013).
61. Zivanov, J., Nakane, T. & Scheres, S. H. W. A Bayesian approach to beam-induced motion correction in cryo-EM single-particle analysis. IUCrJ 6, 5–17 (2019).
62. Emsley, P., Lohkamp, B., Scott, W. G. & Cowtan, K. Features and development of Coot. Acta Crystallogr. D 66, 486–501 (2010).
63. Chen, V. B. et al. MolProbity: all-atom structure validation for macromolecular crystallography. Acta Crystallogr. D 66, 12–21 (2010).
64. Murshudov, G. N., Vagin, A. A. & Dodson, E. J. Refinement of macromolecular structures by the maximum-likelihood method. Acta Crystallogr. D 53, 240–255 (1997). |
Only 1 species of bacteria in the genus *Coxiella* is officially recognized: *Coxiella burnetii* ([@R1]). However, in recent decades, many genetically related bacteria have been found in hard and soft ticks ([@R2]). These *Coxiella*-like bacteria genetically cluster with *C. burnetii* and share some degree of identity with these bacteria but not enough to be considered the same species ([@R2],[@R3]). Genotypes of *Coxiella*-like bacteria vary among ticks of different species ([@R3]); however, bacteria with different genotypes have not been isolated, and whether there is a tick reservoir is not known. *Coxiella*-like bacteria have been associated with infection in birds ([@R4],[@R5]). To explore pathogenicity to humans, we used molecular techniques targeting *Coxiella-*like bacteria to retrospectively analyze skin biopsy samples and ticks collected from patients with eschars. We also evaluated serologic tests for *Candidatus* Coxiella massiliensis diagnosis.
The Study
=========
During 2011--2014, we identified patients in hospitals throughout France, who had eschars after tick bite. We retrospectively tested skin biopsy or swab samples of the eschars, serum samples when possible, and ticks from the patients. Ticks were identified by matrix-assisted laser desorption/ionization time-of-flight mass spectrometry (Bruker Daltonics, Billerica, USA) ([@R6]). All human samples and ticks were tested for *Rickettsia*, *Borrelia*, *Bartonella*, and *Ehrlichia* spp.; *Francisella tularensis*; *Staphylococcus aureus*; and *Coxiella burnetii* by quantitative PCR (qPCR) ([@R2],[@R7]). On the basis of the aligned *rrs* gene sequences of *Coxiella*-like bacteria, we developed a specific qPCR to detect the DNA of all *Coxiella* species and degenerated primers aimed to amplify a 659-bps long portion of the *groEL* gene of *Coxiella* spp. ([Technical Appendix](#SD1){ref-type="local-data"} Table 1). Skin biopsy samples were also tested by universal eubacteria 16S rRNA gene amplification and sequencing ([@R7]).
Five spawns of *Rhipicephalus sanguineus* ticks infected with *Candidatus* C. massiliensis were used for antigen production ([@R8]). Molecular assays indicated that these spawns were negative for *Rickettsia*, *Borrelia*, *Bartonella*, *Ehrlichia* spp.; *F. tularensis*; *S. aureus*; and *C. burnetii*. We used spawns of *R. sanguineus* ticks without *Candidatus* C. massiliensis infection as negative controls to confirm that their antigens did not react with serum from the patients. To confirm the presence of *Candidatus* C. massiliensis, we used qPCR and transmission electron microscopy to visualize the bacteria ([Technical Appendix](#SD1){ref-type="local-data"} Figure). To determine the specificity of our immunofluorescence assay (IFA), we used healthy blood donors as negative controls; to determine if there was cross-reactivity with *C. burnetii*, we used serum from patients with Q fever.
Patients were considered infected with *Coxiella*-like bacteria when a skin biopsy sample was positive by qPCR and there was no evidence of infection with another agent. Patients were considered possibly infected if they had clinical signs (fever, skin eschar, local lymph node enlargement) and if a removed tick was positive for *Coxiella*-like bacteria according to qPCR but no skin biopsy was sampled or when serologic results were positive. For data comparison, we used Epi Info 6.0 (<https://wwwn.cdc.gov/epiinfo/html/ei6_downloads.htm>). We considered a p value of 0.05 to be significant.
Phylogenetic analysis based on *groEL* confirmed that *Coxiella* spp. from ticks of different species are genetically very distant ([@R9]). On the basis of phylogenetic clustering, epidemiologic role, and the fact that we used its antigens for the diagnostic of human infection, we propose the name for the *Coxiella*-like bacteria associated with *R. sanguineus*, *R. turanicus*, and *H. pusillus* ticks to be *Candidatus* C. massiliensis ([Figure 1](#F1){ref-type="fig"}).
{ref-type="local-data"} Table 2) were aligned by using ClustalW (<http://www.ebi.ac.uk/Tools/msa/>), and phylogenetic inferences were obtained by using Bayesian phylogenetic analysis with TOPALi 2.5 software (<http://www.topali.org/>) and the integrated MrBayes (<http://mrbayes.sourceforge.net/>) application with the HKY+Г (Hasegawa-Kishino-Yano plus gamma) substitution model for the first and third codons and the JC model for the second codon. GenBank accession numbers are indicated first, followed by the tick host. Numbers at nodes are bootstrap values obtained by repeating the analysis 100 times to generate a majority consensus tree. The final dataset contained 576 positions. Scale bar indicates 10% nucleotide sequence divergence.](15-0106-F1){#F1}
A total of 57 ticks removed from 55 patients were available for testing. Of these, 20 (35%) ticks from 19 patients were infected with *Coxiella*-like bacteria only: 11 (55%) *Dermacentor marginatus*, 7 (35%) *R. sanguineus*, 1 (5%) *R. bursa*, and 1 (5%) *Ixodes ricinus* ticks. *Coxiella-*like bacteria were found significantly less commonly in *I. ricinus* ticks (p = 0.002, relative risk = 0.5).
We tested convalescent-phase serum from 5 patients. Total immunoglobulin titers of 1:400 against *Candidatus* C. massiliensis were detected for 1 patient and \>1:800 for 2 patients ([Figure 2](#F2){ref-type="fig"}). All IgG titers obtained were identical. These results indicated an infection caused by *Candidatus* C. massiliensis. IFA results indicated that all patients were negative for *Rickettsia* spp., *C. burnetii*, *F. tularensis*, and *Bartonella* spp. Among serum samples from 40 blood donors, total immunoglobulins titer was 1:200 for 6 donors and IgG titer was 1:400 for 1. Receiver operating characteristic curves, defined by the true-positive rate (serum from patients infected with *Candidatus* C. massiliensis) as a function of the false-positive rate (serum from blood donors) demonstrated that for a total immunoglobulin cutoff of \>1:400, sensitivity was 60% and specificity was 100%, and for an IgG cutoff of \>1:400, sensitivity was 60% and specificity was 98%. Moreover, among 13 patients with acute Q fever, 12 with Q fever endocarditis, and 5 who had had Q fever in the past, serum was positive for *Candidatus* C. massiliensis, indicating the cross-reactivity of our IFA with *C. burnetii*.
{#F2}
Of 465 skin biopsy samples from 465 patients, cell culture results ([@R10]) were negative for all. However, samples from 8 (2%) patients were positive for *Candidatus* C. massiliensis, and a possible infection was considered for another 7. Of these 15 patients, 8 (53%) were female, 8 had recently participated in outdoor activities in France, and 2 had recently traveled to Algeria and Israel. Three cases occurred during winter, 9 during spring, and 4 during summer. All patients had an eschar, regardless whether they had lymphadenopathy ([Table](#T1){ref-type="table"}). A scalp eschar with cervical lymphadenopathy was common (40%). Other common findings were fever (40%), increased C-reactive protein (60%), and thrombocytopenia (40%). Most patients received oral doxycycline, 2 with macrolides and 2 with a β-lactam. Symptoms resolved for all patients.
###### Characteristics of *Candidatus* C. massiliensis--infected patients, France, 2011--2014
Characteristic No. (%) cases
------------------------------------- ---------------
Male sex 7 (47)
Tick species collected from patient
*Dermacentor marginatus* 6 (55)
*Rhipicephalus sanguineus* 3 (27)
*Ixodes ricinus* 1 (9)
*Rhipicephalus bursa* 1 (9)
Not collected 4
Eschar location
Scalp 8 (53)
Leg 3 (20)
Shoulder 2 (13)
Back 1 (7)
Ear 1 (7)
Fever 6 (40)
Lymphadenopathy
Cervical 6 (55)
Axillary 1 (9)
Inguinal 2 (18)
Thrombocytopenia 6 (40)
Increased liver enzyme levels 2 (13)
Increased C-reactive protein level 9 (60)
Treatment
Doxycycline 11 (73)
Oher 4 (27)
Conclusions
===========
We determined that *Candidatus* C. massiliensis is an etiologic agent of human infections. For our molecular assay, we routinely included large numbers of negative controls that were processed identically to the test samples. Only *Coxiella*-like bacteria DNA was present in the samples, indicating that these bacteria were the only infectious agents. Supplementary serologic testing was used to confirm the molecular results, and results were validated with samples from blood donors; specificity was good but sensitivity was low. The fact that all serum tested demonstrated IgG only does not eliminate the possibility of previous exposure (patients and blood donors) because these bacteria are common in ticks ([@R9]). Although *Candidatus* C. massiliensis IFA results were cross-reactive with *C. burnetii*, all patients were negative for *C. burnetii*.
A study limitation was that our assays were specific for *Candidatus* C. massiliensis only. In addition, many of the ticks that bit the patients were not available for examination, and the level of serologic cross-reactivity among *Candidatus* C. massiliensis and other *Coxiella*-like bacteria is unknown. Thus, the patients reported here may have been infected not exclusively with *Candidatus* C. massiliensis but also with another *Coxiella* species associated with ticks.
Most patients had a scalp eschar and cervical lymphadenopathy, reminiscent of a recently proposed clinical entity named SENLAT (scalp eschar and neck lymphadenopathy after tick bite) ([@R11]). All symptoms arising from *Candidatus* C. massiliensis infection can be easily attributed to other infectious agents transmitted by ticks ([@R12],[@R13]) and can easily go unrecognized because of the absence of systematic research on these bacteria and the nonspecific clinical manifestations of diseases caused by them. Most patients in our study were empirically prescribed doxycycline, the treatment of choice for many tick-transmitted infections ([@R14]). We illustrated the value of systematically testing for *Candidatus* C. massiliensis in skin biopsy samples. *Candidatus* C. massiliensis may be a common agent of SENLAT, which may go unrecognized or misdiagnosed as a sign of another tick-transmitted infection.
######
**Online Technical Appendix.** Phylogentic tree of *Coxiella* spp., immunofluorescence assays of persons with and without *Candidatus* Coxiella massiliensis infection, and transmission electron micrograph of *Candidatus* C. massiliensis.
*Suggested citation for this article*: Angelakis E, Mediannikov O, Jos SL, Berenger JM, Parola P, Raoult D. *Candidatus* Coxiella massiliensis infection. Emerg Infect Dis. 2016 Feb \[*date cited*\]. <http://dx.doi.org/10.3201/eid2202.150106>
Dr. Angelakis is a medical microbiologist and researcher at the Unité de Recherche sur les Maladies Infectieuses et Tropicales Emergentes, Centre National de la Recherche Scientifique, Unité Mixte de Recherche 6236, Institut de Recherche pour le Développement, in Marseille. His research interests are zoonotic pathogens.
|
Andrew Yang has waded into the hot waters comedian Shane Gillis found himself in after making racist remarks about Chinese people in newly-unearthed video clips.
Gillis, who was announced as one of three new cast members for the 45th season of “Saturday Night Live,” referred to Chinese people as “f***ing c***ks,” mocked Chinese restaurants and declared “I love to be f***ing racist” in a September 2018 podcast with Matt McCusker.
today SNL announced the hiring of its first cast member of East Asian descent, and also this guy pic.twitter.com/0FAGJZJUkK — Seth Simons (@sasimons) September 12, 2019
this, again, is from September 2018 pic.twitter.com/inYFT22zjl — Seth Simons (@sasimons) September 12, 2019
The clips, which emerged after the announcement of his casting, have drawn a massive backlash on social media, with users calling out NBC to fire him.
Good Good Comedy Theatre, where Gillis had worked, told Vulture that it “stopped working with him within the past few years because of racist, homophobic, and sexist things he’s said on and offstage.”
In response to the uproar, Gillis claimed that he has made “bad misses” in his 10 years as a comedian and that he is happy to apologize to anyone “actually offended by anything” he has said.
“I’m a comedian who pushes boundaries. I sometimes miss. If you go through my 10 years of comedy, most of it bad, you’re going to find a lot of bad misses. I’m happy to apologize to anyone who’s actually offended by anything I’ve said. My intention is never to hurt anyone but I am trying to be the best comedian I can be and sometimes that requires risks.”
However, his “apology” fell flat to many.
“Calling people c***ks and saying it’s annoying when they try to learn English isn’t a risk, its racist,” “Wu Assassins” star Lewis Tan replied. “My family damn near died to be here. You were racist. It’s only a risk if you talk this way around me, then it is a risk as my intention will be different than yours.”
Calling people chinks and saying it’s annoying when they try to learn English isn’t a risk, its racist. My family damn near died to be here. You were racist. It’s only a risk if you talk this way around me, then it is a risk as my intention will be different than yours. — Lewis Tan (@TheLewisTan) September 13, 2019
“Shang-Chi” actor Simu Liu demanded a “more genuine” apology.
“Don’t make yourself some sort of martyr of comedy dude. You don’t get to hide behind that. Own up, face the music and make a more genuine apology.”
Don’t make yourself some sort of martyr of comedy dude. You don’t get to hide behind that. Own up, face the music and make a more genuine apology. — Simu Liu (@SimuLiu) September 14, 2019
Gillis’s past continued to haunt him Saturday, when an audio of himself calling Andrew Yang a “Jew ch*nk” surfaced online.
According to Vice News, his remark comes from a May episode of “Real Ass Podcast,” hosted by comedians Luis Gomez and Zac Amico, which was previously accessible as a video.
“Actually, they are running a Jew c***k,” Gillis told the hosts as the Memorial Day episode tackled the 2020 Democratic presidential field.
“Chang, dude. Yang? Or Chang?” he struggled saying.
Yang responded in a Twitter thread expressing his preference for comedy that “makes people think,” as well as his openness to engage in conversation.
“Shane — I prefer comedy that makes people think and doesn’t take cheap shots. But I’m happy to sit down and talk with you if you’d like.”
He added that Gillis should not lose his job.
“For the record, I do not think he should lose his job. We would benefit from being more forgiving rather than punitive. We are all human.”
For the record, I do not think he should lose his job. We would benefit from being more forgiving rather than punitive. We are all human. — Andrew Yang (@AndrewYang) September 14, 2019
The Democratic presidential candidate went on to share his own experience with racism.
“I’ve been called c***k and g**k any number of times in my life. It can be extraordinarily hurtful to feel like you are somehow not part of the only country you have ever known. I have certainly felt that — the churning sense of alienation, anger and marginalization.
“It’s also the case that anti-Asian racism is particularly virulent because it’s somehow considered more acceptable. If Shane had used the N-word the treatment would likely be immediate and clear.”
I’ve been called chink and gook any number of times in my life. It can be extraordinarily hurtful to feel like you are somehow not part of the only country you have ever known. I have certainly felt that – the churning sense of alienation, anger and marginalization. — Andrew Yang (@AndrewYang) September 15, 2019
However, Yang pointed out that he does not see Gillis as “malignant” or “evil,” but rather a “still-forming comedian” who “made some terrible and insensitive jokes and comments.”
“But I took the time to watch and listen to Shane’s work. He does not strike me as malignant or evil. He strikes me as a still-forming comedian from central Pennsylvania who made some terrible and insensitive jokes and comments.”
But I took the time to watch and listen to Shane’s work. He does not strike me as malignant or evil. He strikes me as a still-forming comedian from central Pennsylvania who made some terrible and insensitive jokes and comments. — Andrew Yang (@AndrewYang) September 15, 2019
He hopes others can forgive Gillis as he does, but the comedian should also be open to learning.
“I think we have, as a society, become excessively punitive and vindictive concerning people’s statements and expressions we disagree with or find offensive. I don’t think people should be losing jobs unless it’s truly beyond the pale and egregious.
“I understand those who have another point of view on this. Obviously the folks at NBC are the real decision-makers. But if I can forgive Shane, as the guy he called a slur, I hope others can as well. I also hope Shane is open to learning. We are all human, we’re all fallible.”
I understand those who have another point of view on this. Obviously the folks at NBC are the real decision-makers. But if I can forgive Shane, as the guy he called a slur, I hope others can as well. I also hope Shane is open to learning. We are all human, we’re all fallible. 👍 — Andrew Yang (@AndrewYang) September 15, 2019
Featured Images via YouTube / Comedy Central Stand-Up (Left) and Instagram / @andrewyang2020 (Right) |
Just as our elected officials create convenient areas of privilege which absolve them from obeying laws which are so enthusiastically applied to the rest of us, so Muslims are seeking to become a privileged class with the exclusive right to decide what offends their religious sensibilities and what level of punishment must be meted out for the particular affront.
It seems all this United States-inspired, freedom-motivated nonsense about protecting First Amendment rights gets in the way of what is really important, that being the ability of followers of Islam to impose Sharia restrictions on a foolishly audacious American people… |
Thursday, October 8, 2015
SO YOU WANNA BE A BUSKER: DECISIONS, DECISIONS.
According to
Jeff Shinabarger, there are seven styles of decision making (Yes or No:How Everyday Decisions Will Forever Shape
Your Life).
1. COLLECTIVE
REASONING … the gathering of group decisions and then deciding … Hmmm … if they
can be buskers, then so can I.If you
could witness my competition in Regina, Canada, you would surely agree that
anyone can be a busker.In front of any
liquor store in this city, generally you’ll find beggars strumming guitar who
can’t play a note and dregs blowing stinky discords into harmonicas.Saying thus, of course there are
counter-patterns, university music majors thrumming in summer, and real guitar-slinging buskers
who are just passing through town, usually heading west, who can really shred a
guitar.Going elsewhere to buske, however, say to
Victoria on the west coast of Canada, or to Halifax on the east coast of
Canada, buskers such as I would really have to step up their game. Busking is
not living in Lotusland.
2. DATA DRIVEN
… to formulate a decision based on hard core data, especially numbers.Hmmm … do the math.Usually when I busk I make 35 to 50 dollars
an hour, but that is only at the peak hours.For example, busking over a noon or supper hour my take is high;
whereas, busking mid-morning or mid-afternoon, my take is low.If I were to busk for five or six hours per
day, including those peak hours, my take would be between 75 and 100
dollars.To calculate on the conservative
side, five days at 75 dollars would be 375 dollars per week, multiplied by four
makes 1500 dollars per month.Methinks
if I decide to sell EVERYTHING I own, ditch driving my Acura and quit buying my black and white shirts, and rent a broom closet to live in, I could make it work.And it would be work because … if
you’ve ever been busking, you know it ain’t easy.
3. GUT REACTION
… relying on your feelings to make quick decisions.Hmmm … generally speaking, this is a bad
idea.The romantic notion of busking is
always (for me) the draw of busking.I
love it, love it, love it. I love to mess my hair, don my shades, pull on a tight
white T, faded jeans and work boots, and stand and strum and thrum whilst
blowing into my C or Am harp.In my
busker beginnings I had hair-brained ideas.I can remember dressing like a cowboy; I can remember having a karaoke
invite (complete with sign) for my potential consumers; I can remember choosing
out of the way perfect (looking) buskspots that appealed to me, but not to my
consumers.All of these mentioned
actions were based upon gut reactions and spontaneous and desperate attempts to be a busker. In the beginning my busking was capricious.Now my busking, upon reflection (and I
reflect often), is putting lots of thought into my attire and locations.
4. LIST
APPROACH … listing the pros and cons again and again on paper.Hmmm … I’d rather be busking.In contrary to what I’ve written just above
(GUT REACTION), baptism by fire is the only way to learn how to busk and to
improve your busking.There is little
comparison to hitting the sidewalks with real busking to those theoretical what
if’s you write on a list.And those lists are most certainly biased, for if they were not, nobody would decide to be a
busker based upon this method of decision.Let us
imagine the pros … romance, adventure, wanderlust, compared to the cons … demeaning,
bad weather, little money … but … lists are for pedagogues, not buskers.
5. SPIRITUALLY
GUIDED … that is waiting for a voice or looking for a sign to determine your
destiny.Hmmm … this what-would-Jesus-do
style of decision making only works if you can stretch your phenomenological
thinking to the money lending practices in the market place, an economic
epiphany so to speak.
6. STORY LIVING
… is making the decision based upon the imaginary stories you plan on telling of your buskapades.Hmmm … I
remember Christine, the bag lady with the shopping cart, her beer breath on my
folk songs, because she stood so close with her sing-alongs.Then there was this drunk who took a swing at
me, twice.And the guy who tried to
steal my buskmate’s bongos.I've lots of great
stories from lived bad experiences.See
my blog entry, THREE CITIES, THREE GUITARS (August, 2014), a storied adventure of my European
buskation.Such story living is really
quite Aesopian in nature, in the sense that all the consumers and players that participate
in my world of busking do not know that they could become main characters in my
stories.
7. PASSIVE
UNDECIDED … is when you creatively procrastinate and simply really on destiny.
Hmmm … if you were a busker having such an abulia, not to choose is really a
choice that will lead you to the nearest soup kitchen.
The hardest thing about the road not taken is that you'll never know where it might have led (sort of Lisa Windgate). I travel on that busking road approximately 60 days a year and it always leads to fun and adventure.
We all make choices -- but in the end our choices make us (sort of Ken Levine). Truly, we can become whom we want to become.
If you always make the safe decision -- you will always be the same as everyone else (sort of Jan Arden). Yes, living a middle-class life is a safe and secure misadventure.
When your values are clear -- your decisions are easy (sort of Roy Disney). Based upon action and reflection and introspection, there finally comes a time in everyone's life when we know what is good for us. Knowing, however, is easier than doing.
About Me
I imagine myself to be a real cowboy. I've roots in Clay County,
Missouri (next to Jesse James); I've been shot off a horse while
crossing Notekeu Creek; I've ridden across 27 sections of Turkey Track
Ranch to meet a girl at a rodeo in Herbert, Saskatchewan.
I imagine myself to be a scholar. I've a Master's Degree in Educational
Psychology; I've a private HYPNOTHERAPY and PSYCHOLOGY CONSULTING
practice in downtown Regina SK
(PHONE 306-591-7131);
I'm a part-time university Psychology instructor and full-time high
school guidance counsellor.
In a line ... I'm an Americana fair-weather faux busker and a
self-proclaimed certified ... Buskologist! |
################################################################################
#
# Copyright 2014-2016 Eric Lacombe <eric.lacombe@security-labs.org>
#
################################################################################
#
# This file is part of fuddly.
#
# fuddly is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# fuddly is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with fuddly. If not, see <http://www.gnu.org/licenses/>
#
################################################################################
from __future__ import print_function
import os
import sys
import subprocess
import re
import inspect
import uuid
class Term(object):
def __init__(self, name=None, keepterm=False, xterm_args=None, xterm_prg_name='x-terminal-emulator'):
self.name = name
self.keepterm = keepterm
self.xterm_args = xterm_args
self.xterm_prg_name = xterm_prg_name
def start(self):
self.pipe_path = os.sep + os.path.join('tmp', 'fuddly_term_'+str(uuid.uuid4()))
if not os.path.exists(self.pipe_path):
os.mkfifo(self.pipe_path)
self.cmd = [self.xterm_prg_name]
if self.name is not None:
self.cmd.extend(['-title',self.name])
if self.xterm_args:
self.cmd.extend(self.xterm_args)
if self.keepterm:
self.cmd.append('--hold')
self.cmd.extend(['-e', 'tail -f {:s}'.format(self.pipe_path)])
self._p = None
def _launch_term(self):
self._p = subprocess.Popen(self.cmd)
def stop(self):
if not self.keepterm and self._p is not None and self._p.poll() is None:
self._p.kill()
self._p = None
try:
os.remove(self.pipe_path)
except FileNotFoundError:
pass
def print(self, s, newline=False):
s += '\n' if newline else ''
if self._p is None or self._p.poll() is not None:
self._launch_term()
with open(self.pipe_path, "w") as input_desc:
input_desc.write(s)
def print_nl(self, s):
self.print(s, newline=True)
def ensure_dir(f):
d = os.path.dirname(f)
if not os.path.exists(d):
os.makedirs(d)
def ensure_file(f):
if not os.path.isfile(f):
open(f, 'a').close()
def chunk_lines(string, length):
l = string.split(' ')
chk_list = []
full_line = ''
for wd in l:
full_line += wd + ' '
if len(full_line) > (length - 1):
chk_list.append(full_line)
full_line = ''
if full_line:
chk_list.append(full_line)
# remove last space char
if chk_list:
chk_list[-1] = (chk_list[-1])[:-1]
return chk_list
def find_file(filename, root_path):
for (dirpath, dirnames, filenames) in os.walk(root_path):
if filename in filenames:
return dirpath + os.sep + filename
else:
return None
def retrieve_app_handler(filename):
mimetype = subprocess.check_output(['xdg-mime', 'query', 'filetype', filename])[:-1]
desktop_file = subprocess.check_output(['xdg-mime', 'query', 'default', mimetype])[:-1]
file_path = find_file(desktop_file.decode(), root_path='~/.local/share/applications/')
if file_path is None:
file_path = find_file(desktop_file.decode(), root_path='/usr/share/applications/')
if file_path is None:
return None
with open(file_path, 'r') as f:
buff = f.read()
result = re.search("Exec=(.*)", buff)
app_name = result.group(1).split()[0]
return app_name
if sys.version_info[0] > 2:
def get_caller_object(stack_frame=2):
caller_frame_record = inspect.stack()[stack_frame]
return caller_frame_record.frame.f_locals['self']
else:
def get_caller_object(stack_frame=2):
caller_frame_record = inspect.stack()[stack_frame]
return caller_frame_record[0].f_locals['self']
|
feel good food that's good for you
Uncategorized
With Thanksgiving tantalisingly close I thought I would share a very easy but practically perfect mashed butternut squash side dish for your Thanksgiving Day menu. With the tiniest nod to the sweet potato soufflé trope, this recipe is for you if you want something a little sweet, but not full-on marshmallow-sweet. This comforting and nutritious …
Perhaps Korean food is not the first thing you think of when you crave a bowl of comfort food. This recipe, for a vegetable-packed vegan version of the classic Bulgogi Korean barbecue, might just change your mind. With its savoury-sweet and only gently spicy kick (or no kick if you wish), this is a one-pan …
This quick, Mexican-inspired breakfast vegetable quesadilla is loaded with fibre and colour. An easy way to eat towards your 10-a-day. Do you want an easy way to eat veg in the morning, before you’re even out the door? With no juicing, smoothie-ing, or heating up leftover dinner? Let me introduce you to the breakfast vegetable quesadilla. …
Halloween is sneaking up fast, and I’m afraid that I have very few Halloween specific recipes to point you to. But, with its blood-red sauce, I do think my easy Korean BBQ Tofu might just about pass muster as scary food – certainly if you are as messy as me. I plan on eating this …
Salted Caramel Apple Nachos are your new favourite quick snack or dessert for the family – or just you. Sprinkle and drizzle them with tasty toppings and be crunching away in no time. Plate licking is positively encouraged. Apple nachos are not a new thing, but if you are someone who occasionally craves something sweet …
This healthy, colour-packed recipe scoops up some key anti-inflammatory ingredients and simmers them in a silky autumnal broth. Whether you are fighting a cold, feeling low in energy or just fancy a nourishing bowl of something tasty, be sure to make time for this intensely flavoured and easily made soup. I bet you already have …
Note: Due to a “plug-in” issue this is being reposted from earlier this autumn. Apologies if you have already read it. 🙂 Mother Nature has picked my plums for me. And apples. Earlier in the week Storm Ali blew through on winds of 80 miles per hour, tossing my garden around like a salad. A …
NOTE: I’ve had issues with a blog “plug-in”, so most of you have not been getting updates from me for quite awhile. As the recipes were just hanging around in the ether I will be re-posting most of these late summer/early autumn recipes. Apologies if you have managed to see these by coming straight to my …
NOTE: I’ve had issues with a “buggy” plug-in, so most of you have not been getting updates from me for quite awhile. As the recipes were just hanging around in the ether I will be re-posting most of these late summer/early autumn recipes. Apologies if you have managed to see these by coming straight …
This healthy, colour-packed recipe scoops up some key anti-inflammatory ingredients and simmers them in a silky autumnal broth. Whether you are fighting a cold, feeling low in energy or just fancy a nourishing bowl of something tasty, be sure to make time for this intensely flavoured and easily made soup. I bet you already have …
Like this:
I'm Kellie, an ex-pat American cancer health educator with a taste for global food - and big flavours - made with fresh, seasonal British ingredients. Food To Glow is mainly 'plant-based', but you will find the occasional decadent treat - usually with a healthy tweak. Although I'm an omnivore, I speak fluent vegan: most of my non-vegan recipes will have vegan alternatives, as well as gluten-free and soft food diet options where appropriate. All recipes are tested out on family, friends and/or my cancer nutrition classes at the Maggies Cancer Caring Centres. You are very welcome to read, comment and share!
Follow Food To Glow by Email
Pop in your email address to follow Food To Glow and receive notifications of new posts by email. |
Risk of insulin-dependent diabetes mellitus in patients undergoing carotid endarterectomy.
There is conflicting evidence regarding the association of diabetes mellitus (DM) and insulin use with outcomes after carotid endarterectomy (CEA). Therefore, we sought to evaluate the risk of insulin-dependent DM (IDDM) and noninsulin-dependent DM (NIDDM) on 30-day outcomes after CEA. We identified patients undergoing CEA from the Targeted Vascular module of the National Surgical Quality Improvement Program (2011-2015) and stratified patients on the basis of their preprocedural symptom status. We compared 30-day outcomes between nondiabetics and patients with NIDDM or IDDM, with 30-day stroke/death as the primary end point. Of 16,739 CEA patients, 9784 (58%) were asymptomatic, of whom 6720 (69%) had no diagnosis of DM, 1109 (11%) had IDDM, and 1955 (20%) had NIDDM. Of the 6955 symptomatic patients, 4982 (72%) had no diagnosis of DM, 810 (12%) had IDDM, and 1163 (17%) had NIDDM. Among asymptomatic patients, patients with IDDM experienced higher rates of 30-day stroke/death compared with those without DM (3.4% vs 1.5%; P < .001), whereas those with NIDDM experienced rates similar to those of patients without DM (2.1% vs 1.5%; P = .1). Moreover, asymptomatic patients with IDDM and an anatomic high-risk criterion experienced a 30-day stroke/death rate of 6.6%. After adjustment, IDDM was associated with 30-day stroke/death in asymptomatic patients compared with patients without DM (odds ratio, 2.3; 95% confidence interval, 1.5-3.4; P < .001), but NIDDM was not (odds ratio, 1.4; 95% confidence interval, 1.0-2.1; P = .1). In comparison, among symptomatic patients, those with IDDM and NIDDM experienced similar rates of 30-day stroke/death as patients without DM (4.9% vs 3.6% and 4.0% vs 3.6%; both P > .1). After adjustment, neither IDDM nor NIDDM was associated with 30-day stroke/death in symptomatic patients compared with symptomatic patients without DM. Rates of 30-day stroke/death after CEA in asymptomatic patients with IDDM exceed international vascular societies' guideline thresholds for acceptable outcomes in asymptomatic patients, especially those with anatomic high-risk criteria. Thus, asymptomatic patients with IDDM may not benefit from CEA, although more data are needed about the natural history of carotid disease in this population. |
# Please don't modify this file.
# To contribute on translations, go to https://www.transifex.com/3liz-1/lizmap-locales/.
file.unknown=(510)Fichier de définition de DAO (%s) introuvable ou invalide
namespace.wrong=(511)Le document "%s" n'est pas un dao ou l'espace de nom xml est invalide (%s)
missing.attr=(512)DAO %1$s, attribut "%3$s" obligatoire dans une balise "%4$s" (fichier %2$s)
tag.duplicate=(513)DAO %1$s, une seule balise %3$s est permise dans la méthode %4$s (fichier %2$s)
forbidden.attr=(514)DAO %1$s, l'attribut "%3$s" n'est pas autorisé sur la balise "%4$s" (fichier %2$s)
forbidden.attr.context=(515)DAO %1$s, l'attribut "%3$s" n'est pas autorisé dans ce context sur la balise "%4$s" (fichier %2$s)
wrong.attr=(516)DAO %1$s, la valeur "%3$s" de l'attribut "%4$s" sur la balise "%5$s" n'est pas valide (fichier %2$s)
unknown.attr=(517)DAO %1$s, attribut "%3$s" inconnu dans la balise "%4$s" (fichier %2$s)
datasource.missing=(520)DAO %1$s, une table doit être indiquée (fichier %2$s)
table.two.many=(521)DAO %1$s, trop de tables définies (fichier %2$s)
table.name=(522)DAO %1$s, nom de table manquant (fichier %2$s)
primarykey.missing=(523)DAO %1$s, nom de clé primaire manquant (fichier %2$s)
foreignkey.missing=(524)DAO %1$s, nom de clé étrangère manquant sur une jointure (fichier %2$s)
properties.missing=(530)DAO %1$s, il n'y a pas de propriétés definies (fichier %2$s)
property.unknown.table=(531)DAO %1$s, nom de table inconnue pour la propriété %3$s (fichier %2$s)
property.invalid.name=(532)DAO %1$s, le nom de propriété "%3$s" est syntaxiquement invalide, il doit être conforme à la syntaxe PHP (fichier %2$s)
property.already.defined=(533)DAO %1$s, propriété %3$s déjà definie (fichier %2$s)
property.imported.unknown.table=(534)DAO %1$s, nom de table inconnue pour la propriété importée %3$s (fichier %2$s)
method.parameter.unknowname=(540)DAO %1$s, méthode $3$s, nom du paramètre manquant (fichier %2$s)
method.procstock.name.missing=(541)DAO %1$s, nom de la procédure stockée manquante pour la méthode $3$s (fichier %2$s)
method.body.missing=(542)DAO %1$s, corps de la méthode PHP $3$s manquant (fichier %2$s)
method.values.undefine=(543)DAO %1$s, la méthode %3$s de type update doit contenir la liste des proprietés à mettre à jour (fichier %2$s)
method.limit.forbidden=(544)DAO %1$s, méthode %3$s, la balise limit n'est permise que pour les méthodes de type select (fichier %2$s)
method.duplicate=(545)DAO %1$s, la méthode %3$s est déjà définie (fichier %2$s)
method.condition.unknown=(546)DAO %1$s, méthode %3$s, la condition %4$s n'est pas reconnu (fichier %2$s)
method.property.unknown=(547)DAO %1$s, la méthode %3$s utilise une propriété (%4$s) qui n'existe pas dans la DAO (fichier %2$s)
method.property.forbidden=(548)DAO %1$s, la méthode %3$s de ce type ne doit pas contenir de condition sur des propriétés étrangères (fichier %2$s)
method.condition.valueexpr.together=(549)DAO %1$s, méthode %3$s, condition %4$s : il n'est pas possible de spécifier une valeur et une expression en même temps (fichier %2$s)
method.condition.valueexpr.notallowed=(550)DAO %1$s, méthode %3$s, il n'est pas possible de spécifier une valeur ou une expression pour la condition %4$s (fichier %2$s)
method.condition.valueexpr.missing=(551)DAO %1$s, méthode %3$s, une valeur ou une expression est requise pour la condition %4$s (fichier %2$s)
method.orderitem.bad=(552)DAO %1$s, la propriété de l'élement d'ordre %3$s pour la méthode %4$s est inconnue ou absente (fichier %2$s)
method.orderitem.property.missing=(553)DAO %1$s, méthode %3$s, il faut indiquer une propriété sur une balise orderitem (fichier %2$s)
method.values.property.unknown=(554)DAO %1$s, la méthode %3$s contient une propriété inconnue parmi les balises <values> (fichier %2$s)
method.values.property.bad=(555)DAO %1$s, la méthode %3$s indique une propriété qui n'est pas de la table primaire (fichier %2$s)
method.values.property.pkforbidden=(556)DAO %1$s, les propriétés de type PK sont interdites dans les valeurs pour la méthode %3$s (fichier %2$s)
method.values.valueexpr=(557)DAO %1$s, méthode %3$s, une valeur ou une expression est requise dans une balise value (fichier %2$s)
method.limit.parameter.unknown=(558)DAO %1$s, nom de paramètre %4$s inconnu dans la balise limit de la méthode %3$s (fichier %2$s)
method.limit.badvalue=(559)DAO %1$s, mauvaise valeur de limite ( %4$s ) dans la méthode %3$s (fichier %2$s)
method.condition.innotin.bad.expr=(560)DAO %1$s, méthode %3$s, condition %4$s, l'expression pour un operateur in/notin doit être un simple nom de paramètre (fichier %2$s)
method.condition.driver.notallowed=(561)DAO %1$s, méthode %3$, le driver de base de données utilisé n'est pas autorisé d'après la définition de la condition (fichier %2$s)
method.orderitem.parameter.unknown=(563)DAO %1$s, nom de paramètre %4$s inconnu dans la balise orderitem de la méthode %3$s (fichier %2$s)
method.update.forbidden=(564)DAO %1$s, la méthode %3$s de type update est interdite car la table principale ne contient que des clés primaires (fichier %2$s)
method.parameter.invalidname=(565) DAO, dans la méthode %1$s, le signe $ dans le NOM du paramètre %4$s est interdit
|
This invention relates to typewriters and more particularly relates to a device used in conjunction with a typewriter to aid in precisely locating a character space among other typewriter characters.
In many cases after a letter has been typed and proofread an error is found, after the paper is taken from the typewriter. To avoid completely retyping the page, the letter is reinserted into the typewriter, erasure made where necessary, and then an attempt is made to place the correct character in the erased space.
This is a very difficult procedure. Once the paper has been removed from the typewriter it is quite difficult to realign a given line correctly and also to locate the space in relation to the type hammer bearing the character to be inserted.
In some cases the foregoing problem arises even if the paper is not removed from the typewriter due to slippage of the paper as it is rolled in the typewriter, and/or the paper nearing the bottom.
The present invention overcomes these difficulties in alignment by providing a new and improved device which permits the typist to make a sample strike of the character to be inserted, which device is attached to the paper bar of the typewriter and may easily be moved between an operative and an inoperative position.
Briefly stated, the invention, in one form thereof, comprises a member which is slidable along the paper bar to a position where it is out of the way and does not interfere with typing. The device is also rotatable on the paper bar and has a transparent sheet which will extend behind the card holder or line guide. The transparent sheet is preferably curved, so as to be complimentary to the curvature of the roller or platen of the typewriter.
An object of this invention is to provide a new and improved device for enabling a typist to add a character in the proper spacing on a typewritten sheet of paper.
Another object of this invention is to provide such a device which is located on the typewriter and may be easily moved into and out of an operative position. |
World’s most popular cryptocurrency has escaped the feared fall below $6k as the day’s range so far has been moving between $6,026 and $6,261.7. The Bitcoin has been pretty volatile in the past seven days and, as the chart reveals, on 18th of June the cryptocurrency price per coin dropped to scary $5,845.
Top news today seems to be related to the US government’s plan to confiscate $24 million in Dark Web Bitcoin and the various ways this cryptocurrency has been called by experts and millionaires. All of these affect the Bitcoin price in different ways and cannot be ignored.
Nobel Prize Winner Considers the Bitcoin an “Epidemic of Enthusiasm”
Jack Ma or widely known as Alibaba’s founder and chairman highlighted the company’s support for blockchain; nonetheless, he advised against investing money in the Bitcoin, calling the cryptocurrency “a bubble” during a speech at a launch event. Naturally, when a successful person like Jack Ma makes this kind of comments, the Bitcoin is bound to suffer price drops. Especially when the news is featured across all reputable media like The Wall Street Journal.
Unlike Jack Ma, who has slammed the Bitcoin, Nobel prize winner Robert Shiller has called the cryptocurrency an “epidemic of enthusiasm” and a remarkable social phenomenon. In an interview given to Bloomberg, Shiller explained how everything related to Bitcoin was not a “rational response to new information” as the cryptocurrency keeps going up and down, but Silicon Valley remains into it.
The Yale University professor went on claiming that the Bitcoin was “a social movement” and a “speculative bubble” but highlighted that none of this meant the cryptocurrency would go to zero.
Aside from who said what about the Bitcoin, what got a lot of attention was the announced confiscation of 4,000 Bitcoins by the US government. Namely, these coins were seized during a crackdown on dark web marketplaces and their current worth is more than $24 million. Reportedly, two men from Maryland allegedly manufactured and distributed drugs via these marketplaces. As part of the incitement, the government wants to confiscate 4,000 coins that are believed to be proceeds of the illegal activities by the accused.
Technical Indicators Advise Traders to Sell
With the current price at $6,093.07 and volatility of 60.21%, most of the technical indicators and moving averages indicate a strong sell signal. The volume is high 19,771 and the day’s range goes between $6,026 and $6,261.7; yet, all indicators consider selling to be the best options.
For example, let’s take a look at the technical indicators. The RSI has a value of 34.392 and the Williams %R is in the negative 69.234. The ultimate oscillator is set at 44.775, while the ROC is in the negative too with a value of -3.226. With 11 out of 11 sending a sell signal, traders should proceed with caution if they plan to buy Bitcoin.
Similar situation can be seen among the moving averages as well. Namely, 12 out of 12 are advising traders to sell. A few values to note are the 5-day SMA and the 50-day SMA; namely, the first has a low value of 6143.4, whereas the later is much higher 7398.8. |
<?php
declare(strict_types=1);
/*
* This file is part of the your app package.
*
* The PHP Application For Code Poem For You.
* (c) 2018-2099 http://yourdomian.com All rights reserved.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\App\Controller\Timer;
use function Common\Infra\Helper\message_with_time;
/**
* 使用 Swoole 原生每隔一段时间执行同一任务.
*
* @codeCoverageIgnore
*/
class Index
{
/**
* 执行入口.
*/
public function handle(): string
{
$this->message('Start timer');
// 每隔 1 秒触发一次
$n = 1;
$timerId = swoole_timer_tick(1000, function () use (&$n) {
$this->message(sprintf('Try `%d`', $n));
$n++;
});
$this->message(sprintf('Timer id is `%d`', $timerId));
// 运行 3 秒后删除定时器
swoole_timer_after(3000, function () use ($timerId) {
$this->message('Clear timer');
swoole_timer_clear($timerId);
});
return 'Timer done';
}
/**
* 输出消息.
*/
private function message(string $message): void
{
dump(func(fn () => message_with_time($message)));
}
}
|
Description
Monsters prey on the innocent. He preys on the monsters.
They call him the Heretic. Five years ago, Cade Williams was just an ordinary cop, until the night he and his wife were savagely attacked by a fallen angel known as the Adversary.
Cade survived. His wife did not.
Now he commands the Echo Team, an elite squad of monster-hunting modern Templar knights. When the supernatural rears its head and threatens humanity, it's up to Cade and his men to smash it back down again.
But protecting mankind isn’t the only reason Cade became a Templar. He hasn’t forgotten the events of that summer night and he fully intends to even the score.
Targeting Cade’s family was the Adversary's first mistake.
Leaving Cade alive will be its last.
Discover the series urban fantasy fans are raving about! Read this action-packed, monster-hunting thrill ride and answer the age-old question, what happened to the Templars? |
@import '../../../style/_variables';
:host {
display: block;
width: 650px;
}
.service-offering-selector {
padding-top: 10px;
display: block;
}
.warning {
color: red;
}
.message {
text-align: right;
margin-top: 10px;
}
:host .mat-dialog-content {
overflow: hidden;
}
.mat-dialog-actions {
flex-direction: column;
align-items: flex-end;
}
.error-message {
color: $error-message-color;
font-size: 13px;
}
|
Stanford marshmallow experiment
This article or section may contain misleading parts. Please help clarify this article according to any suggestions provided on the talk page.(August 2016)
This article needs attention from an expert in Psychology. See the talk page for details. WikiProject Psychology may be able to help recruit an expert.(August 2016)
The Stanford marshmallow experiment was a series of studies on delayed gratification in the late 1960s and early 1970s led by psychologist Walter Mischel, then a professor at Stanford University.[1] In these studies, a child was offered a choice between one small reward provided immediately or two small rewards if they waited for a short period, approximately 15 minutes, during which the tester left the room and then returned. (The reward was sometimes a marshmallow, but often a cookie or a pretzel.) In follow-up studies, the researchers found that children who were able to wait longer for the preferred rewards tended to have better life outcomes, as measured by SAT scores,[2] educational attainment,[3] body mass index (BMI),[4] and other life measures.[5] A replication attempt with a more diverse sample population over 10 times larger than the original study failed to support the original study's conclusions and suggested that economic background rather than willpower explained the results.[6]
Contents
The experiment has its roots in an earlier one performed in Trinidad, where Mischel noticed that the different ethnic groups living on the island had contrasting stereotypes about one another, in terms of the other's perceived recklessness, self-control, and ability to have fun.[7] This study focused on male and female children aged seven to nine (35 Black and 18 East Indian) in a rural Trinidad school. The children were required to indicate a choice between receiving a 1¢ candy immediately, or having a 10¢ candy given to them in one week's time. Mischel reported a significant ethnic difference, with Indian children showing far more ability to delay gratification as compared to African students, as well as large age differences, and that "Comparison of the 'high' versus 'low' socioeconomic groups on the experimental choice did not yield a significant difference".[7] Absence of the father was prevalent in the African-descent group but occurred only once in the East Indian group, and this variable showed the strongest link to delay of gratification, with children from intact families showing superior ability to delay.
The first "Marshmallow Test" was a study conducted by Walter Mischel and Ebbe B. Ebbesen at Stanford University in 1960.[8]
The purpose of the original study was to understand when the control of delayed gratification, the ability to wait to obtain something that one wants, develops in children. The original experiment took place at the Bing Nursery School located at Stanford University, using children of ages four to six as subjects. The children were led into a room, empty of distractions, where a treat of their choice (Oreo cookie, marshmallow, or pretzel stick) was placed on a table.[1] The children could eat the treat, the researchers said, but if they waited for fifteen minutes without giving in to the temptation, they would be rewarded with a second treat.[1] Mischel observed that some would "cover their eyes with their hands or turn around so that they can't see the tray, others start kicking the desk, or tug on their pigtails, or stroke the marshmallow as if it were a tiny stuffed animal," while others would simply eat the marshmallow as soon as the researchers left.[1]
In over 600 children who took part in the experiment, a minority ate the marshmallow immediately. Of those who attempted to delay, one third deferred gratification long enough to get the second marshmallow.[1] Age was a major determinant of deferred gratification.
Test subjects were 16 boys and 16 girls attending the Bing Nursery School of Stanford University. Three other subjects were run, but eliminated because of their failure to comprehend the instructions. The children ranged in age from 3 years, 6 months to 5 years, 8 months (with a median age of 4 years, 6 months). The procedures were conducted by two male experimenters. Eight subjects (four male and four female) were assigned randomly to each of the four experimental conditions. In each condition each experimenter ran two boys and two girls in order to avoid systematic biasing effects from sex or experimenters.[8]
On the table in the experimental room there were five pretzels and an opaquecake tin. Under the cake tin were five pretzels and two animal cookies. There were two chairs in front of the table; on one chair was an empty cardboard box. On the floor near the chair with the cardboard box on it were four battery operated toys. The experimenter pointed out the four toys; before the child could play with the toys, the experimenter asked the child to sit in the chair and then demonstrated each toy briefly and in a friendly manner, saying that they would play with the toys later on. Then the experimenter placed each toy in the cardboard box and out of sight of the child. The experimenter explained to the child that the experimenter sometimes has to go out of the room but if the child eats a pretzel the experimenter will come back into the room. These instructions were repeated until the child seemed to understand them completely. The experimenter left the room and waited for the child to eat a pretzel – they did this four times.
Next, the experimenter opened the cake tin to reveal two sets of reward objects to the child: five pretzels and two animal crackers. The experimenter asked which of the two the child liked better, and after the child chose, the experimenter explained that the child could either continue waiting for the more preferred reward until the experimenter returned, or the child could stop waiting by bringing the experimenter back. If the child stopped waiting, then the child would receive the less favored reward and forgo the more preferred one.
Depending on the condition and the child's choice of preferred reward, the experimenter picked up the cake tin and along with it either nothing, one of the rewards, or both. The experimenter returned either as soon as the child signaled him to do so or after 15 minutes.[8]
In follow-up studies, Mischel found unexpected correlations between the results of the marshmallow test and the success of the children many years later.[5] The first follow-up study, in 1988, showed that "preschool children who delayed gratification longer in the self-imposed delay paradigm, were described more than 10 years later by their parents as adolescents who were significantly more competent."[citation needed]
A second follow-up study, in 1990, showed that the ability to delay gratification also correlated with higher SAT scores.[5]
A 2006 paper to which Mischel contributed reports a similar experiment, this time relating ability to delay in order to receive a cookie (at age 4) and reaction time on a go/no go task.[9]
A 2011 brain imaging study of a sample from the original Stanford participants when they reached mid-life showed key differences between those with high delay times and those with low delay times in two areas: the prefrontal cortex (more active in high delayers) and the ventral striatum, (more active in low delayers) when they were trying to control their responses to alluring temptations.[10][11]
A 2012 study at the University of Rochester (with a smaller N= 28) altered the experiment by dividing children into two groups: one group was given a broken promise before the marshmallow test was conducted (the unreliable tester group), and the second group had a fulfilled promise before their marshmallow test (the reliable tester group). The reliable tester group waited up to four times longer (12 min) than the unreliable tester group for the second marshmallow to appear.[12][13] The authors argue that this calls into question the original interpretation of self-control as the critical factor in children's performance, since self-control should predict ability to wait, not strategic waiting when it makes sense. Prior to the Marshmallow Studies at Stanford, Walter Mischel had shown that the child's belief that the promised delayed rewards would actually be delivered is an important determinant of the choice to delay, but his later experiments did not take this factor into account or control for individual variation in beliefs about reliability when reporting correlations with life successes.[14][15][16][17]
In the studies Mischel and colleagues conducted at Stanford University,[1][8] in order to establish trust that the experimenter would return, at the beginning of the "marshmallow test" children first engaged in a game in which they summoned the experimenter back by ringing a bell; the actual waiting portion of the experiment did not start until after the children clearly understood that the experimenter would keep the promise. Participants of the original studies at the Bing School at Stanford University appeared to have no doubt that they would receive a reward after waiting and chose to wait for the more desirable reward. However, Mischel's earlier studies showed there are many other situations in which children cannot be certain that they would receive the delayed outcome.[14][15][16][17] In such situations, waiting for delayed rewards may not be an adaptive response.
Watts, Duncan and Quan's 2018 conceptual replication [18] yielded mostly statistically insignificant correlations with behavioral problems but a significant correlation with achievement tests at age 15. These effects were lower than in the original experiment and reduced further when controlling for early cognitive ability and behavior, family background, and home environment. |
The world’s largest banks plan on forcing citizens into receiving the Mark of the Beast via microchip.
Also, French President Emmanuel Macron and other European leaders have called for a European army and for Europe to “become an empire.”
The Emergency Election Sale is now live! Get 30% to 60% off our most popular products today! |
<!-- list-map-fn.mldoc -->
<!-- Entities.sgml entry
<!ENTITY list_map_g SDATA "list-map-g.pkg">
-->
<!DOCTYPE ML-DOC SYSTEM>
<COPYRIGHT OWNER="Bell Labs, Lucent Technologies" YEAR=1998>
<VERSION VERID="1.0" YEAR=1998 MONTH=6 DAY=10>
<TITLE>The list_map_g generic package</TITLE>
<INTERFACE>
<HEAD>The <CD/list_map_g/ generic package</HEAD>
<SEEALSO>
<SIGREF/Key/
<SIGREF/Ordered_Key_Map/
<FCTREF/binary_map_g/
<FCTREF/splay_map_g/
<SIGREF/Set/
</SEEALSO>
<PP>
The <FCTREF NOLINK/list_map_g/ generic package implements applicative maps on
an ordered type. It uses a sorted list representation.
<GENERIC FCTID="list_map_g"><ID>K<ID>Key</ID>
<ID>Ordered_Key_Map
</GENERIC>
<PP>
Note that inserting a pair into a map that already contains a pair using
the same key (in the sense that both keys are considered equal by the comparison
function) causes the current pair to be replaced by the new one.
</INTERFACE>
|
Q:
Linq Newbie. Can I write this Linq query more concise?
Dim entName = "Some Auto Dealer"
Dim whereEntity As Expression(Of Func(Of Entity, Boolean)) = Function(en) en.ENTY_Name = entName
Dim login = Repository(Of Entity).Create().FindSingle(whereEntity)
Dim whereDealer As Expression(Of Func(Of Dealer, Boolean)) = Function(dlr) dlr.Entity.Equals(login)
Dim dealer = Repository(Of Dealer).Create().FindSingle(whereDealer)
Dim whereContract As Expression(Of Func(Of MBI_Contract, Boolean)) = Function(c) c.Dealer.Equals(dealer) AndAlso c.Vehicle.Make.Equals(ford)
Dim fordContractsFromPSAuto = Repository(Of MBI_Contract).Create().FindAll(whereContract).ToList()
How can I write this better? It works and it's pretty fast, but it seems kind of overkill to me. The FindSingle and FindAll take Expression(Of Func(Of T, Boolean)) as an arg for the Where clause. This is my first dabble at writing Lambda expression so please forgive me if it looks bad.
Note Repository is a generic class and Create is a factory method that returns a DataContext object. This application is using LinqToSql.
Thanks for any advice.
Cheers,
~ck in San Diego
A:
I'm a C# programmer, so I'm sorry if this suggestion doesn't really apply; In C#, I would typically use one line that contains the lambda and the method call; eg:
var login = Repository<Entity>.Create().Single(en => en.ENTY_Name == entName);
I think you could do something similar in VB like:
Dim login = Repository(Of Entity).Create().FindSingle( _
Function(en) en.ENTY_Name = entName)
This probably comes down to personal preference though...
As an alternative, you could rewrite the whole thing using the query-like syntax; I don't use it very often so I can't convert your very quickly, but it'd be more like:
Dim contract = From c in Repository(Of MBI_Contract) _
join d in Repository(Of Dealer) on c.Dealer equals d _
where d.Entity.ENTY_Name = entName _
select c
|
/**
* Copyright (c) 2017-present, Facebook, Inc. and its affiliates.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree.
*/
/* can be included multiple times */
#ifndef RSM_TYPE
#error RSM_TYPE() macro not defined
#define RSM_TYPE(...)
#endif
// Args: enum_name, string_name
RSM_TYPE(KEY_VALUE_STORE_STATE_MACHINE, "keyvaluestore")
RSM_TYPE(EVENT_LOG_STATE_MACHINE, "eventlog")
RSM_TYPE(LOGS_CONFIG_STATE_MACHINE, "logsconfig")
RSM_TYPE(MAINTENANCE_LOG_STATE_MACHINE, "maintenancelog")
#undef RSM_TYPE
|
Cooke Plains, South Australia
Cooke Plains is a settlement in South Australia. It is adjacent to the Dukes Highway on the Adelaide–Melbourne railway about halfway between Tailem Bend and Coomandook, however trains no longer stop there. The town has several businesses and a Soldier's Memorial Hall (emblazoned with the possessive "Cooke's Plains" in the stonework).
Cooke Plains township was originally a private subdivision, named after the pastoralists James and Archie Cooke.
Cooke Plains boundaries now also include the former government town of Bedford which was surveyed in August 1871 and declared ceased to exist on 28 April 1960.
References
Category:Towns in South Australia |
Castle Fraser
Castle Fraser is the most elaborate Z-plan castle in Scotland and one of the grandest 'Castles of Mar'. It is located near Kemnay in the Aberdeenshire region of Scotland. The castle stands in over of landscaped grounds, woodland and farmland which includes a walled kitchen garden of the 19th century. There is archaeological evidence of an older square tower dating from around 1400 or 1500 within the current construction.
Construction
Originally known as Muchall-in-Mar, construction of the elaborate, five-storey Z-plan castle was begun in 1575 by the 6th Laird of Fraser, Michael Fraser, on the basis of an earlier tower, and was completed in 1636. A panel on the northern side of the castle is signed "I Bel", believed to be the mark of the master mason John Bell of Midmar, the castle is a joint creation over several decades with another master mason of this period, Thomas Leiper.
Castle Fraser is contemporary with other nearby castles: Craigievar Castle, Crathes Castle and Midmar Castle which are also believed to have been designed by the Bell family of master masons.
The castle was modernised in a classical style in the late 18th century, with a new entrance inserted in the south side and sash windows throughout. This work was supervised by Elyza Fraser, the lady laird, assisted by Mary Bristow. Elyza was also responsible for the landscaping of the grounds, sweeping away the remains of the original formal gardens and orchards, and for the construction of the impressive octagonal stable block.
The interiors of the building were entirely reconstructed again between 1820 and 1850, by Charles Fraser, using the architects John Smith and William Burn. The Library is a fine example of John Smith's regency style with Tudor detailing. Many of William Burn's more extravagant gothic designs for the most important rooms were not carried out, although a gothic style pipe organ was installed (now removed to Kemnay Church).
External works during this period included the construction of the twin gatehouses (still extant), and a grand domed stair and access corridors with loggias in the courtyard (removed).
The castle was partially restored by the new owners around 1950. The architect and antiquary Dr William Kelly supervised the removal of much 19th-century work to reveal the earlier fabric.
Castle Fraser retains the atmosphere of a family home and still contains the original contents, including Fraser family portraits, furniture and collections. The evocative interiors represent all periods of the castle's history, from the Medieval stone vaulted Great Hall to the Regency Dining Room.
Ownership
Castle Fraser was built as the home of the Frasers of Muchalls, later Frasers of Castle Fraser. The castle was passed down through the Lords Fraser, the Frasers of Inverallochy and then the Mackenzie family who took the name Mackenzie Fraser. In 1897 the last male Fraser of the direct line, Frederick Mackenzie Fraser, died childless. In 1921 his widow, Theodora, sold the castle due to the lack of a suitable heir and mounting financial difficulties. The buyer was Weetman Pearson, 1st Viscount Cowdray. The Pearson family restored the castle as a shooting lodge and gave it to the National Trust for Scotland in 1976. The Trust opens the castle to visitors from Easter to October. The grounds and walled gardens are open year round. It can be hired for weddings, dinners, conferences and corporate events.
In film
Some scenes in the 2006 film The Queen, starring Dame Helen Mirren, featured Castle Fraser as a backdrop.
See also
Miranda, Countess of Iveagh
References
Secondary sources
External links
NTS Castle Fraser Webpage
Fraser
Category:Category A listed buildings in Aberdeenshire
Category:Listed castles in Scotland
Category:National Trust for Scotland properties
Castle Fraser
Category:Inventory of Gardens and Designed Landscapes
Category:Gardens in Aberdeenshire
Category:Historic house museums in Aberdeenshire
Category:Tower houses in Scotland |
All relevant data are within the paper and its Supporting Information files.
Introduction {#sec001}
============
Disease resistance genes (*R* genes) are essential components of plant immune systems. Amongst five diverse classes of disease resistance genes \[[@pone.0121893.ref001]\], the largest class of *R* genes includes genes that encode proteins with a nucleotide-binding site (NBS) domain and a Leucine-Rich Repeat (LRR) domain. The NBS domain is highly sequence constrained and is typically used to identify and characterize plant *R* genes. The LRR domains in *R* genes that mediate direct or indirect interactions \[[@pone.0121893.ref002], [@pone.0121893.ref003]\] with pathogen molecules are usually rapidly evolving to adapt to the change of pathogen ligands \[[@pone.0121893.ref004]\]. NBS domain-containing *R* genes were classified into two major types based on their domain structures in N terminus: proteins with a Toll-Interleukin receptor (TIR) domain and proteins without TIR domains, which usually contain a Coiled Coil (CC) domain. While the TIR domain is usually well defined, the CC domain has higher sequence variation and is less well characterized.
Genome-wide analyses of NBS genes in many genomes have shown that NBS *R* genes are diverse in number, structure and organization \[[@pone.0121893.ref005]--[@pone.0121893.ref010]\]. For example, grass genomes studied to date do not have TIR NBS genes; on the other hand, dicot genomes usually contain more TIR NBS genes than non-TIR NBS genes \[[@pone.0121893.ref011]\]. Comparison of NBS *R* genes in multiple genomes indicated that *R* genes are shaped by dynamic birth-and-death processes \[[@pone.0121893.ref012]\]. Comparative analyses of NBS genes in two *Arabidopsis* genomes (*A*. *thaliana* and *A*. *lyrata*) indicate that mating system shift from outcrossing to inbreeding has had a limited impact on the numbers of NBS genes, at least in the time since *A*. *lyrata* and *A*. *thaliana* diverged from their common ancestor approximately 5 million years ago \[[@pone.0121893.ref013]\]. Comparative analyses of NBS genes of diploid *Phaseolus* and tetraploid *Glycine* species concluded that whole genome duplication did not result in NBS *R* gene number increasing. Recently, comparison of *R* genes in diverse grass genomes by Yang *et al*. showed that rapid evolution in *R* genes in *Zea*, *Sorghum*, and *Brachypodium* is associated with rice blast disease resistance \[[@pone.0121893.ref014]\].
*Citrus* species are amongst the most important fruit trees and have been cultivated for more than 4000 years \[[@pone.0121893.ref015], [@pone.0121893.ref016]\]. Phylogenetic analyses using molecular markers showed that cultivated *Citrus* species (sweet orange, grapefruit, and lemon) are derived from three original cultivated *Citrus* species: *C*. *medica* (citron), *C*. *reticulata* (mandarin) and *C*. *maxima* (pomelo) \[[@pone.0121893.ref017], [@pone.0121893.ref018]\]. For example, the *C*. *sinensis* (sweet orange) is suggested to be the backcross hybrid of *C*. *maxima* (pomelo) and *C*. *reticulata* (mandarin) \[[@pone.0121893.ref017]--[@pone.0121893.ref019]\]. Phylogenetic analyses of partial NBS genes of *Poncirus trifoliata* (trifoliate orange), *C*. *reticulata* (tangerine) and their F1 progeny showed that NBS genes of *Poncirus trifoliata* (trifoliate orange), *C*. *reticulata* formed genus-specific clades. Additionally, NBS genes of their F1 progeny had sister relationships to only one of the parents \[[@pone.0121893.ref020]\]. This suggests that NBS genes in crossing hybrid *Citrus* species are also different from those in original *Citrus* species.
Recently available draft whole genome sequences of three *Citrus* species: *C*. *clementina* \[[@pone.0121893.ref021]\], *C*. *sinensis* from USA and *C*. *sinensis* from China \[[@pone.0121893.ref019]\], have made it possible to scan and identify all NBS genes in those genomes. In this study, we performed a genome-wide comparative analysis of NBS genes in three *Citrus* genomes (*C*. *clementina*, *C*. *sinensis* from China and *C*. *sinensis* from USA) to address the following questions: (1) What are the features of NBS genes in *Citrus*, such as numbers, physical locations, within-gene domain structures, and evolutionary dynamics of NBS genes?; (2) Do NBS genes differ between hybrid and non-hybrid *Citrus* species?; and (3) Do *Citrus* NBS genes differ from NBS genes in other plant genomes?
Materials and Methods {#sec002}
=====================
Sequences Used {#sec003}
--------------
We downloaded the draft genome sequences and the original gene annotations of *C*. *clementina* (clementine) \[[@pone.0121893.ref021]\] and *C*. *sinensis* USA (sweet orange from USA) from the *Citrus* Genome Database (<http://www.citrusgenomedb.org/>) and those of *C*. *sinensis* China (Chinese sweet orange \[[@pone.0121893.ref019]\]) from the *C*. *sinensis* annotation project (<http://citrus.hzau.edu.cn/orange/>). The sizes of assembled genomes of *C*. *clementina*, *C*. *sinensis* China and *C*. *sinensis* USA are 301, 328 and 319 million base pairs, respectively. The *C*. *clementina* genomes assembled into nine major scaffolds and 95.8% of the sequences were assigned to those nine scaffolds. About 72.9% of the *C*. *sinensis* China genome assigned to nine chromosomes. The genome of *C*. *sinensis* USA only assembled to 12,574 scaffolds and the N50 of scaffolds is 250 kb. The original gene annotations of *C*. *clementina*, *C*. *sinensis* China and *C*. *sinensis* USA have 24,533, 29,385 and 25,397 genes respectively. We also downloaded the re-sequence data of three mandarin and three pomelo genomes from the *C*. *sinensis* annotation project (<http://citrus.hzau.edu.cn/orange/download/data.php>). The re-sequence data is single end Illumina reads with length of 101 bp.
Identification of NBS Genes in *Citrus* Genomes {#sec004}
-----------------------------------------------
We first screened the original predicted *Citrus* open reading frames (ORFs) using hmmsearch \[[@pone.0121893.ref022]\] with the hidden Markov models (HMM) of Pfam \[[@pone.0121893.ref023]\] for NBS domain presence (NB-ARC, PF00931) using an e-value cut-off of 0.1 for the **hmmsearch**. Then, the proteins selected by the HMM were searched against the Swiss protein database \[[@pone.0121893.ref024]\] using BLASTP \[[@pone.0121893.ref025]\]. Only the proteins that have a significant match (e-value \< 1E-5 in **BLASTP** search) with the NBS proteins or resistant proteins in the Swiss protein database were identified as potential NBS-containing proteins. To recover possible NBS genes that may be missed in the original gene annotations, we mapped the identified NBS genes to the draft genome using **TBLASTN**. The matched sequences with e-value \< 1E-5 were then predicted using **Genewise** \[[@pone.0121893.ref026]\]. The new potential NBS genes predicted by Genewise were also confirmed by **BLASTP** searching through the Swiss protein database. Finally, we scanned all potential NBS genes for NBS domain using **hmmsearch** \[[@pone.0121893.ref022]\] and only keep the NBS genes with e value lower than more stringent cutoff of 1E-5.
Identification of Orthologous NBS genes in *C*. *clementina* and *C*. *sinensis* {#sec005}
--------------------------------------------------------------------------------
Orthologous NBS genes of *C*. *clementina* and *C*. *sinensis* were identified using the reciprocal best blast method \[[@pone.0121893.ref027]\]. We used NBS genes of *C*. *clementina* as query sequences to search against the NBS genes of *C*. *sinensis* and *vice versa*. Protein pairs with reciprocal best hits of e-value \< 1E-20 were defined as orthologs.
To calculate the rates of nonsynonymous, synonymous and their rate ratio (dN, dS and dN/dS) of orthologous pairs, we first aligned orthologous protein sequence pairs using **mafft**, and then converted the protein alignments to codon-based alignments using **PAL2NAL** \[[@pone.0121893.ref028]\]. We calculated the dN, dS and dN/dS rate ratios using the **codeml** program in **PAML** version 4.7 \[[@pone.0121893.ref029]\].
Phylogenetic Analysis {#sec006}
---------------------
We constructed the best fit phylogenetic tree of NBS genes of the three *Citrus* genomes using only the conserved NBS domain. Only 1,099 NBS domain sequences that have both the P-loop and the MHDV motifs and were longer than 70% (200 amino acids) of the full-length NBS domain were included. Next, NBS domain sequences were aligned in **mafft** \[[@pone.0121893.ref030]\] using an auto alignment model and a best fit maximum likelihood phylogenetic tree of NBS genes was constructed using **FastTree** \[[@pone.0121893.ref031]\] with default parameters (JTT+CAT). The resultant best fit phylogenetic tree was divided into 3 main groups based upon clade support. For each group, we constructed a new ML tree with *Streptomyces coelicolor* protein P25941 as the outgroup using **FastTree** \[[@pone.0121893.ref031]\]. The average identity of each group was calculated using alistat implemented in **SQUID** (<http://selab.janelia.org/software.html>).
To evaluate the confidence level of the phylogenetic tree, we resampled the alignments 1000 times using **SEQBOOT** \[[@pone.0121893.ref032]\]. Then, we constructed the phylogenetic tree from each resampled alignments using **FastTree** \[[@pone.0121893.ref031]\]. The bootstrap values were calculated by comparing resampled phylogenetic trees to the original tree using **CompareToBootstrap** program in the **FastTree** \[[@pone.0121893.ref031]\].
We further partitioned the NBS gene tree into clades using the depth-first phylogeny partition method in **PhyloPart** \[[@pone.0121893.ref033]\] with distance threshold 0.025. This clustered the NBS genes into 114 clades, which contain more than 2 genes, and 8 orphan genes.
Domain and Motif Annotation {#sec007}
---------------------------
The Toll-Interleukin receptor (TIR) domains in *Citrus* NBS-containing proteins were identified using **hmmsearch** \[[@pone.0121893.ref022]\] with the HMM model of Pfam domain PF01582 and a 0.1 e-value cut-off. The Leucine-Rich Repeat (LRR) domains in *Citrus* NBS containing proteins were identified using the HMM models of Pfam LRR domains with e-value cut-off of 0.1. As long as there is a significant hit to one of LRR domain models (e-value \< 0.1), it was define as an LRR-containing protein. We used **MARCOIL** \[[@pone.0121893.ref034]\] with a threshold probability of 90 and **COILS** \[[@pone.0121893.ref035]\] with a threshold of 0.9 to search for Coiled Coil (CC) domains in the N-terminal region of *Citrus* NBS-containing protein. We considered a protein as a CC-containing protein if either **MARCOI**L or **COILS** reported a CC domain in it.
We identified 20 motifs amongst the NBS genes in each of the three main phylogenetic groups separately using **MEME SUITE** \[[@pone.0121893.ref036]\]. The motif width was set to between 6 and 50 for **MEME**. Then, we searched the motif structure of all genes in each group using **MAST** with default parameters (-ev 10---mt 0.0001).
Pseudogene Identification {#sec008}
-------------------------
We identified possible pseudogenes using **PseudoPipe** \[[@pone.0121893.ref037]\] with default parameters (-e 0.1). The **PseudoPipe** algorithm identifies pseudo genes by integrating sequence similarity, intron-exon structure, plus presence of stop codons and frame-shifts. We used all *Citrus* NBS genes to search *Citrus* genomes for potential NGS pseudo genes.
Transposon Identification {#sec009}
-------------------------
All long terminal repeat (LTR) retrotransponsons in each *Citrus* genome were identified using LTR finder \[[@pone.0121893.ref038]\] with default parameters (-o 3-t 1---e 1-m 2-u -2). Then, we used a script program to match the location of the LTR transposons to the NBS-LRR genes in each *Citrus* genome.
NBS Gene Synteny Identification {#sec010}
-------------------------------
Gene synteny was identified and defined using **MCScanX** \[[@pone.0121893.ref039]\] with default parameters (-A-u 5000). First, NBS genes between two genomes were aligned using **BLASTP** and matches with E-value \< 1e-5 were sorted according to their chromosome positions. Synteny scores were then calculated for each block based upon gene position. Two genes were considered in the same block if there were fewer than 25 genes separating them. **MCScanX** reported blocks with at least 5 collinear gene pairs.
Gene Cluster Analysis {#sec011}
---------------------
We grouped the NBS genes in each *Citrus* genome into the same cluster if the genome location between two genes was within 200 kb. We also identified the conserved gene clusters between the *C*. *clementina* and *C*. *sinensis*. If all genes in a cluster of *C*. *clementina* have orthologs in the corresponding cluster of *C*. *sinensis* and vice versa, then these two clusters were called completely conserved clusters. If only part of genes in the clusters have orthologs, we called these two clusters partially conserved.
Gene Conversion Detection {#sec012}
-------------------------
We first aligned the sequences of NBS genes in the same cluster using **mafft** \[[@pone.0121893.ref030]\]. Then, we used **GENECONV** \[[@pone.0121893.ref040]\] version 1.81a with default settings (N = 10,000) to detect gene conversions. **GENECONV** identifies gene conversions by finding identical fragments between pairs of sequences in a nucleotide alignment. A global *P* value ≤ 0.05 was used to assess the statistical significance of the observed conversions. **GENECONV** requires at least three sequences for analyses in order to account for shared ancestral states. Thus, we only detected conversions in clusters containing three or more genes.
Tests for Sites under Positive Selection {#sec013}
----------------------------------------
The amino acid sequences of NBS genes from the same clade were aligned with **mafft** \[[@pone.0121893.ref030]\]. Then we converted the protein alignments to codon-based alignment using **PAL2NAL** \[[@pone.0121893.ref028]\]. The positively selected sites were statistically identified using the Bayesian approach implemented in **codeml** within **PAML** \[[@pone.0121893.ref029]\]. We also further examined sites in the ω \> 1 class with \>90% posterior probability.
Mapping of Re-sequencing Data of Mandarin and Pomelo {#sec014}
----------------------------------------------------
We mapped the raw reads of each re-sequenced sample to the draft genome of *C*. *sinensis* China using **BWA** \[[@pone.0121893.ref041]\] with default parameters (-k 19-d 100-A 1-B 4-O 6). Then, the mapped reads of NBS genes regions were extracted using **BEDtools** \[[@pone.0121893.ref042]\]. Two types of coverage of each NBS gene in *C*. *sinensis* were calculated. One coverage type divides the length of mapped sequences by the whole gene sequence length and the other type divides the length of mapped sequences by the length of exon sequence only.
*Citrus* DNA Extraction and PCR Amplication {#sec015}
-------------------------------------------
*Citrus* leaf samples were collected from the six *Citrus* plants in USHRL\'s (USDA Horticultural Research Laboratory, Fort Pierce, Florida): *C*. *sinensis* (sweet, navel orange), *C*. *aurantium* (karum jamir, sour orange), *C*. *reticulata* (mandarin orange), *C*. *clementina* (clementina), *C*. *aurantiifolia* (sweet lime), *C*. *japonica* (Yuzu, kumquat), and *C*. *maxima* (pomelo). Total DNA was extracted from leaf midribs following the Plant Mini Kit standard protocol from Qiagen Inc. (Valencia, CA), followed by DNA quantity and quality evaluation with Nanodrop. We chose the NBS gene, Cs1g09350, which was conserved in *C*. *clementina* and *C*. *sinensis* for validating the conservation of NBS gene among different *Citrus* genomes. Primers used in this study were designed using Oligo 7.23 (Molecular Biology Insights, Inc., Cascade, CO, USA). DNA Polymerase (Invitrogen, Carlsbad, CA, USA) was used to amplify the NBS-LRR genes from *Citrus* DNA. For PCR, 20 μL reactions using standard conditions provided by the manufacturer for DNA Polymerase. PCR was performed using an initial denaturation at 95°C for 3 minutes, 35 cycles of 94°C for 20 seconds, 50--52°C for 20 seconds (specified by different primer sets) and 68°C for 3 minutes, follow by final extension at 68°C for 10 minutes. The cloning and sequencing analysis of amplified PCR products were conducted as previously described \[[@pone.0121893.ref043]\]
Results {#sec016}
=======
Identification and classification of *Citrus* NBS Genes {#sec017}
-------------------------------------------------------
We searched the *C*. *clementina*, *C*. *sinensis* China and *C*. *sinensis* USA genomes for genes containing the NBS domain using **hmmsearch**. Then, the NBS-containing genes were confirmed through homology searches against the Swiss protein database (see "[Materials and Methods](#sec002){ref-type="sec"}"). We identified similar numbers of NBS domain-containing genes amongst these three genomes. We found 618, 650 and 508 NBS genes from *C*. *clementina*, *C*. *sinensis* China and *C*. *sinensis* USA genomes respectively ([Table 1](#pone.0121893.t001){ref-type="table"}). Among them, 413, 499 and 484 NBS genes were predicted in the original gene annotations and 205, 151 and 24 NBS genes in *C*. *clementina*, *C*. *sinensis* China and *C*. *sinensis* USA respectively were newly predicted in this project ([S1 Table](#pone.0121893.s012){ref-type="supplementary-material"}).
10.1371/journal.pone.0121893.t001
###### Classification of *Citrus* NBS genes.
{#pone.0121893.t001g}
Class *C*. *clementina* *C*. *sinensis* China *C*. *sinensis* USA
-------- ------------------- ----------------------- ---------------------
CNL 117 113 60
TNL 82 77 30
NL 68 62 85
Others 351 398 333
Total 618 650 508
The CNL class of NBS genes contains three domains: Coiled Coil (CC), nucleotide-binding sites (NBS) and Leucine-Rich Repeat (LRR). The TNL class of NBS genes contains three domains: Toll-Interleukin receptor (TIR), nucleotide-binding sites (NBS) and Leucine-Rich Repeat (LRR). The NL class of NBS genes contains two domains: nucleotide-binding sites (NBS) and Leucine-Rich Repeat (LRR). The other NBS genes contain no LRR domain.
NBS genes could be classified into different classes based on their domain structures \[[@pone.0121893.ref006]\]. We searched the Toll-Interleukin receptor (TIR) and Coiled Coil (CC) domains in the N-terminal region and the Leucine-Rich Repeat (LRR) domains in the C-terminal of NBS genes. We identified 117 NBS genes with CC-NBS-LRR (CNL) domains, 82 NBS genes with TIR-NBS-LRR (TNL) domains, 68 NBS genes with NBS-LRR (NL) and 351 others NBS genes without LRR domains (N, CN and TN) from *C*. *clementina* ([Table 1](#pone.0121893.t001){ref-type="table"}). We also identified 113 CNL, 77 TNL, 62 NL and 398 others NBS genes from *C*. *sinensis* China and 60 CNL, 30 TNL, 85 NL and 333 others NBS genes from *C*. *sinensis* USA ([Table 1](#pone.0121893.t001){ref-type="table"}). In comparison to other genomes, there are many more *Citrus* NBS genes without the LRR domain. There are only 43.2%, 38.8% and 34.4% NBS genes with existing LRR domains in *C*. *clementina*, *C*. *sinensis* China and *C*. *sinensis* USA, respectively, while 72% NBS genes in *Arabidopsis thaliana* \[[@pone.0121893.ref006]\] and 78% NBS genes in *Populus trichocarpa* \[[@pone.0121893.ref044]\] have LRR domain.
The structures of TNL and CNL NBS genes are significantly different. The TNL NBS genes tend to have more introns than that of CNL NBS genes as previously found in *Arabidopsis* \[[@pone.0121893.ref006]\] and *Populus* \[[@pone.0121893.ref044]\]. The average numbers of introns in TNL NBS genes are 4.39, 4.70 and 4.47, while the numbers of introns in CNL NBS genes are 0.89, 1.15 and 1.38 in *C*. *clementina*, *C*. *sinensis* China and *C*. *sinensis* USA respectively ([S1 Fig](#pone.0121893.s001){ref-type="supplementary-material"}.). The median numbers of introns of different types of NBS genes in the three *Citrus* genomes are similar: four in TNL NBS genes and one in CNL NBS genes.
The NBS genes were unevenly distributed in the *Citrus* scaffolds/chromosomes. There were 158, 217 and 110 NBS genes, totaling 78.3% of 618 NGS genes, distributed in scaffolds_3, \_5 and \_7 of *C*. *clementina*, respectively. There were 125, 121 and 75 NBS genes distributed in chromosomes 1, 3 and 5 of *C*. *sinensis* China. The majority (95 out of 107) of NBS genes with TIR domain in *C*. *clementina* was distributed in scaffold 3. There were 33 and 51 (out of 102) NBS genes with TIR domain in *C*. *sinensis* China distributed on chromosome 5 and chromosome unknown, respectively.
Phylogenetic and Clade Analysis of the *Citrus* NBS Genes {#sec018}
---------------------------------------------------------
To avoid mutation saturation effects in nucleotide sequences over time which can lead to an underestimation of the number of mutation events due to higher substitution rates versus proteins, we used the protein sequences of NBS domains, which are the most conserved part of NBS genes, to construct a phylogenetic tree of NBS genes. We only selected NBS domain sequences longer than 200 amino acid residues and contain both P-loop and MHDV motifs. Finally, 442 *C*. *clementina*, 393 *C*. *sinensis* China, and 264 *C*. *sinensis* USA NBS domain sequences were used for phylogenetic analysis ([S2 Table](#pone.0121893.s013){ref-type="supplementary-material"}). A Maximum Likelihood (ML) phylogenetic tree of these 1,099 NBS genes was then constructed using **FastTree** \[[@pone.0121893.ref031]\]. As shown in [Fig. 1](#pone.0121893.g001){ref-type="fig"}, the un-rooted phylogenetic tree can be divided into three main groups. Most NBS genes containing the TIR domain are in one branch and the non-TIR NBS genes comprise the other two branches ([Fig. 1](#pone.0121893.g001){ref-type="fig"}), in which most of them contain a CC domain. Therefore, we denoted the three branches as TIR, CC1 and CC2.
{#pone.0121893.g001}
There were 452, 382 and 265 *Citrus* NBS genes in CC1, CC2 and TIR groups, respectively. [S2 Table](#pone.0121893.s013){ref-type="supplementary-material"} lists the group classification of 1,099 *Citrus* NBS genes. For each sub-group, we constructed a new ML phylogenetic tree rooted by *Streptomyces coelicolor* protein P25941 ([S2 Fig](#pone.0121893.s002){ref-type="supplementary-material"}.). The NBS domains in CC groups, especially in the CC1 group, were relatively more diverged in sequence versus those in TIR group. The average Poisson corrected distances between sequence pairs within each group were 0.947, 0.827 and 0.663 for CC1, CC2 and TIR groups, respectively. We aligned the NBS domains sequences in each group using mafft with default parameters (---auto). The average percentages of identities for NBS domain sequences were 40%, 44% and 52% for CC1, CC2 and TIR groups, respectively.
The number of LRR domains varied amongst the three classes of *Citrus* NBS genes. The number of LRR domains in the TIR group is significantly higher than the numbers of LRR domains in the CC1 and CC2 groups ([S3 Fig](#pone.0121893.s003){ref-type="supplementary-material"}.). The majority of CC1 NBS genes have only one LRR domain. On other hand, the TIR NBS genes have 2.4 LRR domains on average. The most frequent type of LRR domain in the CC1 group is LRR_8 (PF13855), but LRR_1 (PF00560) is the most frequent domain in both the CC2 group and the TIR group ([S3 Table](#pone.0121893.s014){ref-type="supplementary-material"}).
NBS genes in the three *Citrus* genomes are polyphyletic amongst branches of phylogenetic tree as shown in the [Fig. 1](#pone.0121893.g001){ref-type="fig"}. We partitioned the NBS gene tree into clades based on NBS domain sequence distance using PhyloPart with distance threshold of 0.025. This resulted in 114 clades (with at least two genes) and eight orphan genes ([S2 Table](#pone.0121893.s013){ref-type="supplementary-material"}). The numbers of clades in each NBS gene group are similar. There are 39, 42, 32 clades in CC1, CC2 and TIR groups, respectively. We calculated average sequence similarities between NBS domains in each clade using **alistat** in **SQUID** (<http://selab.janelia.org/software.html>). The minimum average sequence similarity of NBS domains in each clade was 70%. The largest clade included 90 NBS genes. On average, there were 9.56 genes per clade. There were seven clades with more than 40 genes. Among these clades, four clades were in CC1; two clades were in CC2 and one clade was in the TIR group. Most of the clades contain NBS genes from the three *Citrus* genomes ([Fig. 1](#pone.0121893.g001){ref-type="fig"}, [Table 2](#pone.0121893.t002){ref-type="table"}). There are 89 clades with at least three NBS genes and 87 of these clades contain members from each of the three *Citrus* genomes. Together, these results imply that three *Citrus* genomes may have similar types of NBS genes.
10.1371/journal.pone.0121893.t002
###### Types of *Citrus* NBS gene clades.
{#pone.0121893.t002g}
NBS genes from Citrus genomes Number of Clade
--------------------------------------------------------------- -----------------
*C*. *clementina*, *C*. *sinensis* China, *C*. *sinensis* USA 87
*C*. *clementina*, *C*. *sinensis* China 13
*C*. *clementina*, *C*. *sinensis* USA 7
*C*. *sinensis* China, *C*. *sinensis* USA 5
*C*. *clementina*, 1
*C*. *sinensis* China, 0
*C*. *sinensis* USA 1
To understand the evolutionary dynamics maintaining functional constraint while maintaining so many gene family members, we tested for evidence of accelerated sequence evolution (positive selection) by searching for positively-selected sites within each clade. We detected positively selected sites in 53.5% (61) of clades. There were 18, 24 and 19 clades with sites under positive selection in CC1, CC2 and TIR groups, respectively. In total, we detected 541 positively selected sites. Consistent with previous reports \[[@pone.0121893.ref006]\], there are more positively selected sites in the C-terminal region of NBS genes (LRR domains) than those in the N-terminal and NBS domains ([S4 Table](#pone.0121893.s015){ref-type="supplementary-material"}). Approximately 56.4% (305 out of 541) of the positively selected sites were located in the C-terminal region (LRR domain). While most clades have positively selected sites in the LRR domain, there were clades with a greater number of positively selected sites within the NBS domain. For example, there were 46 positively selected sites in Clade_1260 that are located in NBS domain while there are only two positively selected sites in LRR domain ([S4 Fig](#pone.0121893.s004){ref-type="supplementary-material"}.).
Mapping Re-sequencing Reads Showed the Conservation of NBS Genes in *Citrus* Genomes {#sec019}
------------------------------------------------------------------------------------
To verify that *C*. *sinensis* (sweet orange) is a backcross hybrid of *C*. *maxima* (pomelo) and *C*. *reticulata* (mandarin) \[[@pone.0121893.ref019]\], Xu *et al*. previously re-sequenced three pomelo cultivars and three mandarin cultivars and showed that SSR and SNP markers in the *C*. *sinensis* genome derive from the pomelo and mandarin genomes at an approximately ratio of 1:3 \[[@pone.0121893.ref019]\]. Since our comparison of *C*. *sinensis* and *C*. *clementina* genomes showed that most of their NBS genes are very similar in sequence, we investigated the relationships amongst the NBS genes of *C*. *sinensis* (sweet orange), *C*. *maxima* (pomelo), and *C*. *reticulata* (mandarin) to compare and contrast how mutations accumulated and determine if there are differences in sequence, and hence potentially functional, constraints amongst NBS gene types in *Citrus* genomes.
We mapped the re-sequenced reads of three *C*. *maxima* (pomelo) genomes and three *C*. *reticulata* (mandarin) genomes to hybridized genome of *C*. *sinensis* (sweet orange) China using BWA with mem method \[[@pone.0121893.ref041]\] and calculated the coverage of each NBS gene in *C*. *sinensis* China. We detected 524 of 650 *C*. *sinensis* China NBS genes with more than 50% coverage in all of the six re-sequenced genomes. Additionally, 249 of 650 *C*. *sinensis* China NBS genes with more than 85% coverage in all six resequenced genomes and 592 (91%) of *C*. *sinensis* China NBS genes with coverage over 85% in at least one of the re-sequenced *Citrus* genomes. Using a cutoff of 15% coverage as missing calls over the entire length of the gene, only 25 (\<4%) of *C*. *sinensis* China NBS genes seem to be deleted in at least one of the six re-sequenced genomes. No NBS genes were lost amongst all of the six re-sequenced genomes.
Re-sequenced reads tended to map to exons rather than to introns ([S5 Table](#pone.0121893.s016){ref-type="supplementary-material"}). For example, the entire coding region of NBS gene Cs9g13310 was 3,693 bp in length and covered by all reads from the re-sequenced samples. However, the 16 kb introns were not consistently present in all of the re-sequenced reads. When we used exon presence instead of whole gene coverage, 403 out of 650 (62%) *C*. *sinensis* China NBS genes have more than 85% coverage in all six re-sequenced *Citrus* genomes and 645 (99%) *C*. *sinensis* China NBS genes have more than 85% coverage in at least one of the resequenced *Citrus* genomes. Most *C*. *sinensis* China NBS genes have high exon coverage on both the *C*. *maxima* (pomelo) and *C*. *reticulata* (mandarin) genomes ([S5 Fig](#pone.0121893.s005){ref-type="supplementary-material"}.). There were only three *C*. *sinensis* China NBS genes, Cs1g02140.1, Cs6g02120.1 and Cs7g02220.1, with low (\<40%) exon coverage in all three *C*. *maxima* genomes, but high coverage was achieved in at least two of the three *C*. *reticulata* genomes ([S5 Fig](#pone.0121893.s005){ref-type="supplementary-material"}.). Our mapping results showed that most NBS genes of *C*. *sinensis* (sweet orange) have a corresponding copy in the re-sequenced *C*. *maxima* (pomelo) and *C*. *reticulata* (mandarin) genomes.
Motif Patterns in *Citrus* NBS Genes {#sec020}
------------------------------------
To further examine the gene structures of three *Citrus* NBS gene groups, we searched the motifs in the sequences of each group using **MEME**. [Fig. 2](#pone.0121893.g002){ref-type="fig"} lists consensus sequences of the top 20 motifs identified by MEME from the CC1, CC2 and TIR *Citrus* NBS gene groups.
{#pone.0121893.g002}
The motifs in the N-terminal of CC1 and CC2 groups showed little similarity to each other. The MEME found two motifs from CC1 group. One of them, EEQQQMRRLNQVQGWLSRVEA, was present in 356 of 452 CC1 NBS genes. The other motif, GSQEIDKLCLGGYCSKNCKSSYKFGKKVA, was present in 189 of 452 CC1 NBS genes. Both motifs have high level of sequence similarities with the CC NBS genes of *Arabidopsis* ([S6 Fig](#pone.0121893.s006){ref-type="supplementary-material"}. A). The MEME found three motifs from CC2 group. Two of the motifs, KKLTNMLEMIKAVLDDAEEKQ and AVKLWLGKLKDAAYDVEDVLDEFQTEALR were identified in 325 and 340 of 382 CC2 NBS genes, respectively. The motif AVKLWLGKLKDAAYDVEDVLDEFQTEALR has high levels of similarity with the motif identified from the CC NBS genes of *Oryza sativa japonica* (Japonica rice) \[[@pone.0121893.ref045]\] ([S6 Fig](#pone.0121893.s006){ref-type="supplementary-material"}. B). The different motifs in CC1 and CC2 NBS genes implied that they may be from different evolutionary origins.
For the TIR group, the MEME identified five motifs in the N-terminal. They can be found in 76% to 90% of 265 TIR *Citrus* NBS genes. The first four motifs YDVFLSFRGEDTRDNFTSHLY, AIEASAISVIIFSEGYASSRWCLDELVKI, GQIVIPVFYRVDPSDVRKQTG, and ENPEKVQKWRDALKEA were very similar to the TIR1-4 motifs identified from TIR NBS genes in *Arabidopsis* \[[@pone.0121893.ref006]\] and *Populus trichocarpa* \[[@pone.0121893.ref044]\] ([S6 Fig](#pone.0121893.s006){ref-type="supplementary-material"}. C).
The MEME algorithm identified nine motifs from NBS domains of CC2 and TIR groups, which are similar to the motif structures of NBS domains in *Arabidopsis thaliana* \[[@pone.0121893.ref006]\] and *Populus trichocarpa* NBS genes \[[@pone.0121893.ref044]\]. MEME results also showed that the motif structure of NBS domain of CC1 groups is slightly different from those of CC2 and TIR groups. Eleven motifs were identified from NBS domains of CC1 group with two extra RNBS motifs (RNBS-F, RNBS-G) between GLPL and MHDV motifs. Five motifs: P-loop, Kinase-2, RNBS-B, GLPL and MHDV, showed high levels of sequence similarity amongst NBS genes of three groups, which were also similar to those motifs from *Arabidopsis* \[[@pone.0121893.ref006]\] and *Populus trichocarpa* NBS genes \[[@pone.0121893.ref044]\]. The MHDV motif in *Citrus* was often slightly modified to MHDL, as found in *Arabidopsis* and *Populus* previously. Meanwhile, the motifs RNBS-A, RNBS-C, and RNBS-D were quite dissimilar to each other amongst three groups.
The LRR domains in the C-terminal of NBS genes usually have high sequence diversity as they play a role in recognizing pathogen virulence proteins. The MEME algorithm identified five, six, and four motifs from LRR domains of CC1, CC2 and TIR NBS genes, respectively. Most of the motifs contained LxxL repeats. The LRR motifs from different groups were highly variable in sequence, which implied that the three groups of NBS genes play different roles in the *Citrus* immune system. Some LRR motifs had repeated several times in the same gene. Examples include: motif APNLKSLEVSSCxxMEEIISV found in 367 of 452 CC1 group with an average 4.8 motifs per gene; motif IKTLPESVCELYNLQTLDLEGCRRLKKLP found in 332 of 382 CC2 group with an average 2.8 times per gene and motifs CKRLKSLPSSLCKLKSLGxLNLSGCSNLE and GNISELFLDGTAIEELPSSIE found in 208 and 209 of 265 TIR group with 2.5 and 2.1 times per gene, respectively.
Analysis of NBS Gene Clusters in *Citrus* Genomes {#sec021}
-------------------------------------------------
The majority of *Citrus* NBS genes were physically clustered in genome ([Table 3](#pone.0121893.t003){ref-type="table"}). 525 of 618 NBS genes in *C*. *clementina* were found in 108 clusters and 500 of 650 NBS genes in *C*. *sinensis* China were found in 126 clusters ([S2 Table](#pone.0121893.s013){ref-type="supplementary-material"}). Although the assembly of *C*. *sinensis* USA is more fragmented, there still are 207 of 508 NBS genes present in 72 clusters. The largest number of gene clusters in C. *clementina*, *C*. *sinensis* China and *C*. *sinensis* USA contain 55, 37 and 13 NBS genes, respectively.
10.1371/journal.pone.0121893.t003
###### *Citrus* NBS genes in clusters.
{#pone.0121893.t003g}
Citrus species Total NBS genes Number of NBS genes in cluster Number of clusters Percent of NBS genes in cluster (%)
----------------------- ----------------- -------------------------------- -------------------- -------------------------------------
*C*. *clementina* 618 525 108 84.9
*C*. *sinensis* China 650 500 126 76.9
*C*. *sinensis* USA 508 207 72 40.7
Most clusters contain NBS genes from the same group. In *C*. *clementina*, there were 38 clusters with NBS genes of CC1 group, 40 clusters with NBS genes of CC2 group and 23 clusters with NBS genes of TIR group. Only seven out of 108 clusters contain the NBS genes from two or three groups. In *C*. *sinensis* China, there were 41 clusters with NBS genes of CC1 group, 44 clusters with NBS genes of CC2 group and 26 clusters with NBS genes of TIR group. There were 15 clusters containing NBS genes from two or three groups in *C*. *sinensis* China. In *C*. *sinensis* USA, there were 27 clusters with NBS genes of CC1 group, 25 clusters with NBS genes of CC2 group and 15 clusters with NBS genes of TIR group. Only five clusters contain NBS genes from different groups in *C*. *sinensis* USA. The lower number of clusters in *C*. *sinensis* USA may due to its fragmented assembly.
The sequences of NBS genes within clusters are much more similar to each other than those between clusters (T-test p value \< 2.2e-16). The mean identities between genes within and between clusters were 0.628 and 0.393 respectively ([Fig. 3](#pone.0121893.g003){ref-type="fig"}). Furthermore, NBS genes in the same cluster tend to be in the same strand, which indicates that the NBS genes in the clusters are due to tandem duplication. We detected 204 pairs of tandem duplications in *C*. *clementina* and 217 pairs of tandem duplications in *C*. *sinensis* China using MCScanX \[[@pone.0121893.ref039]\]. The numbers of tandem duplications within CC1 and CC2 groups are much greater than that within the TIR group. Among 204 pairs in *C*. *clementina*, 90 and 85 pairs were present in the CC1 and CC2 groups and only 29 pairs from TIR group. Among 217 tandem gene pairs in *C*. *sinensis* China, 88 and 87 pairs were present in the CC1 and CC2 groups and only 42 pairs in the TIR group. The fewer tandem duplications of NBS genes in the TIR group may be the reason that there are fewer clusters of TIR groups in *Citrus* genomes.
{#pone.0121893.g003}
We identified 254 and 246 gene conversion events from 116 NBS gene clusters in *C*. *clementina* and 144 NBS gene clusters in *C*. *sinensis* China, respectively ([Table 4](#pone.0121893.t004){ref-type="table"}). The gene conversion events in *C*. *sinensis* USA is much less due to fragmented assembly. It is interesting that most of the conversion events (483 out of 520) were identified from the relatively small clusters with less than 10 NBS genes. Among these conversions, 119 events located in N-terminal, 178 in NBS domains and 223 in C-terminal, which indicating that there was no significantly bias in the location of conversion. Most gene conversions were between genes from the same group. We identified 101, 184 and 229 conversion events from NBS genes in TIR, CC1 and CC2 groups respectively and only four conversion events were identified between NBS genes of TIR and CC2 groups. While we could identify similar total numbers of conversion events in *C*. *clementina* and *C*. *sinensis* China, we found almost double such events in *C*. *sinensis* China TIR clusters versus in *C*. *clementina* TIR clusters. Meanwhile, we also found many more conversion events in *C*. *clementina* CC2 clusters than that in *C*. *sinensis* China CC2 clusters ([Table 4](#pone.0121893.t004){ref-type="table"}).
10.1371/journal.pone.0121893.t004
###### Gene conversion events found in *C*. *clementina* and *C*. *sinensis* China.
{#pone.0121893.t004g}
Citrus species Cluster type Number of clusters (with conversion events) Number of conversion events Affected genes Mean size of conversion tracts
----------------------- -------------- --------------------------------------------- ----------------------------- ---------------- --------------------------------
*C*. *clementina* TIR 27 35 32 111
CC1 43 86 67 137
CC2 46 133 83 146
*C*. *sinensis* China TIR 36 69 42 137
CC1 51 89 48 162
CC2 57 92 75 116
Analysis of NBS Orthologs {#sec022}
-------------------------
We identified 719 *Citrus* NBS gene pairs of orthologs amongst *C*. *clementina*, *C*. *sinensis* China and *C*. *sinensis* USA. 270 orthologs were shared between *C*. *clementina* and *C*. *sinensis* China ([S7 Fig](#pone.0121893.s007){ref-type="supplementary-material"}.); 227 orthologous gene pairs were shared between *C*. *clementina* and *C*. *sinensis* USA and 222 orthologous gene pairs were shared between *C*. *sinensis* China and *C*. *sinensis* USA. The percentages of identities between orthologous genes range from 53.8% to 100% (mean of 93.6%, median of 96.8%). The percentages of identities between orthologous genes from TIR group (TNL and TN, 88.42 ± 10.04) were significantly (T-test: P\<2.6e-6) lower than those from CC groups (CNL and CN, 92.92 ± 7.03). The nonsynonymous divergence (dN) values of the 719 orthologs ranged from 1.46e-6 to 0.31 (mean of 0.03, median of 0.08) and the synonymous divergence (dS) values ranged from 1.14e-5 to 0.75 (mean of 0.05, median of 0.019) ([Fig. 4A, B](#pone.0121893.g004){ref-type="fig"}). The dN/dS rate ratios ranged from 0.001 to 50 with a median of 0.62. Similar to *Arabidopsis*, the dN and dS of orthologs from TIR group (TNL and TN) were higher than those from CC groups (CNL and CN). The dN values of orthologs from TIR group ranged from 0.001 to 0.24 (mean of 0.038, median of 0.017) while those of orthologs from CC group ranged from 1.4e-6 to 0.23 (mean of 0.025, median of 0.007). The dS rate of orthologs from TIR group ranged from 3.27e-5 to 0.76 (mean of 0.078, median of 0.029) while those of orthologs from CC group ranged from 1e-5 to 0.67 (mean of 0.04, median of 0.016). However, the dN/dS rate ratios of orthologs from TIR group were relatively lower than that of orthologs from CC group ([Fig. 4C](#pone.0121893.g004){ref-type="fig"}).
{#pone.0121893.g004}
The dN and dS rates as well as dN/dS rate ratios of ortholog residues in clusters are generally greater than those of orthologous singletons ([Fig. 4D-F](#pone.0121893.g004){ref-type="fig"}). The median dN/dS rate ratio of 148 orthologous singletons was 0.55 while that of 361 orthologs in clusters was 0.63. There were 124 orthologs with dN/dS rate ratios above 1. Variation in these orthologs may be shaped by positive selection pressure. Most of the positive selected orthologs (87.9%, 109 out of 124) belonged to CC groups (49 orthologs from CC1 group and 50 from CC2 group).
We also detected 38 NBS gene syntenic blocks between *C*. *clementina* and *C*. *sinensis* China using MCScanX \[[@pone.0121893.ref039]\]. Totally, there are 416 syntenic orthologs of NBS genes between *C*. *clementina* and *C*. *sinensis* China ([S8 Fig](#pone.0121893.s008){ref-type="supplementary-material"}.). On average, there are 11 genes per block. The biggest block contains 45 NBS genes and was located in scaffold_5 of *C*. *clementina* and chromosome 3 of *C*. *sinensis* China. There were 80, 77 and 71 syntenic NBS genes in scaffold_5 of *C*. *clementina*/chromosome 5 of *C*. *sinensis* China, scaffold_3 of *C*. *clementina*/chromosome 5 of *C*. *sinensis* China and scaffold_7 of *C*. *clementina*/chromosome 1 of *C*. *sinensis* China. Furthermore, there were 68, 66 and 8 syntenic NBS genes in the unknown chromosome of *C*. *sinensis* China corresponding to NBS genes in scaffold_3, \_5 and \_7 of *C*. *clementina*, respectively.
Analysis of Conserved NBS Gene Clusters {#sec023}
---------------------------------------
We identified 118 pairs of conserved NBS gene clusters between *C*. *clementina* and *C*. *sinensis* China ([S9 Fig](#pone.0121893.s009){ref-type="supplementary-material"}.). There were 19 NBS gene clusters completely conserved in *C*. *clementina* and *C*. *sinensis* China. For example, all 14 NBS genes in cluster CL225 of *C*. *sinensis* China have orthologs in the cluster CL168 *C*. *clementina* which contains nine NBS genes and vice versa. Some clusters (in both *C*. *clementina* and *C*. *sinensis* China) have several corresponding conserved clusters. This may due to either the genome arrangement or the incomplete assembly of genomes. Furthermore, there were 19 clusters of *C*. *clementina* with no conserved clusters in *C*. *sinensis* China and 18 clusters of *C*. *sinensis* China with no conserved clusters in *C*. *clementina*.
The conserved clusters provided additional insights into NBS gene evolution within and between *Citrus* genomes. For example, cluster CL142 (9 NBS genes) in *C*. *clementina* and cluster CL282 (7 NBS genes) in *C*. *sinensis* China were highly conserved. The phylogenetic tree of these 16 genes suggested division into two subgroups (depicted in blue and orange color in [Fig. 5A](#pone.0121893.g005){ref-type="fig"}). This division suggests two ancestral genes for this conserved cluster. Using the phylogenetic tree as a framework, we reconstructed the evolutionary history of these two clusters. There were several tandem duplication events in the evolutionary history of the conserved clusters, and extra tandem duplication was observed in *C*. *clementina* after it separated from *C*. *sinensis* ([Fig. 5B](#pone.0121893.g005){ref-type="fig"}). Two NBS genes were lost in *C*. *sinensis* and one NBS gene was lost in *C*. *clementina*. Furthermore, there was a recombination event within *C*. *clementina*.
{#pone.0121893.g005}
Mutations and Transposons in *Citrus* NBS Genes {#sec024}
-----------------------------------------------
Plant NBS genes are continuously evolving. Sequence variation and structural constraints are shaped by gene birth-and-death processes \[[@pone.0121893.ref046]\]. Besides possible interallelic recombination and gene conversion, gene mutations and transposable elements appear to play important roles in NBS gene evolution.
We compared the DNA sequences of NBS genes from different *Citrus* genomes to identify mutations. Approximately half of *Citrus* NBS genes have mutations maintained amongst corresponding orthologs. When a mutation took place in an exon and resulted in stop-codon gaining or frame-shift, the target gene often became a pseudogene. For example, Cs1g18610.1_cc_32, Cs1g18610.1 and orange1.1g003367m are orthologs of *C*. *clementina*, *C*. *sinensis* China and *C*. *sinensis* USA. There were 2 stop-codon gaining mutations in Cs1g18610.1 ([S10 Fig](#pone.0121893.s010){ref-type="supplementary-material"}. A), which means that Cs1g18610.1 might become a pseudo (nonfunctional) gene after gaining these mutations.
LTR retrotransposons are widespread in eukaryotic genomes, especially plant genomes. We predicted 19014, 6296 and 1479 LTR retrotransponsons with typical LTR characters in the draft genomes of *C*. *clementina*, *C*. *sinensis* China and *C*. *sinensis* USA, respectively. Then, we filtered out LTR retrotransponsons with low similarity with known TE proteins using BLASTX with e-value greater than 1e-5. Finally, 4920, 3726 and 1240 LTR retrotransponsons remained in *C*. *clementina*, *C*. *sinensis* China and *C*. *sinensis* USA, respectively. We identified 33, 32 and 4 NBS genes that were inserted with LTR retrotransposons in *C*. *clementina*, *C*. *sinensis* China and *C*. *sinensis* USA respectively ([S6 Table](#pone.0121893.s017){ref-type="supplementary-material"}). Most of these genes will likely become pseudogenes due to these insertions. For an instance, orange1.1g043039m, orange1.1g043039m_cc_116 and orange1.1g043039m_csc_123 were orthologs of *C*. *sinensis* USA, *C*. *clementina* and *C*. *sinensis* China respectively ([S10 Fig](#pone.0121893.s010){ref-type="supplementary-material"}. B). The results of gene structure analysis showed that structure in orange1.1g043039m in *C*. *sinensis* USA seems relatively well maintained. But there is an about 10 kb fragment of LTR-retrotransposons in the corresponding homologous gene in *C*. *clementina* and *C*. *sinensis* China ([S10 Fig](#pone.0121893.s010){ref-type="supplementary-material"}. B). We identified both orange1.1g043039m_cc_116 and orange1.1g043039m_csc_123 as pseudogenes using PseudoPipe \[[@pone.0121893.ref037]\].
Experimental Validation of One NBS Gene in *Citrus* Genomes {#sec025}
-----------------------------------------------------------
We validated the orthologs of a conserved NB gene, Cs1g09350.1, in a wide range of *Citrus* species. Cs1g09350.1 conserved in the 3 sequenced *Citrus* genomes. It is a CNL NBS gene and has 5 exons with about 4 kb in length. We designed the primers targeting about 3.5 kb fragment and could amplify a 3.5 kb fragment using PCR in different *Citrus* species, including *C*. *sinensis* (sweet orange), *C*. *clementina* (clementine), *C*. *japonica* (kumquat), *C*. *sinensis* Navelina (navel orange), *C*. *maxima* (pomelo), *C*. *aurantiifolia* (lime), and *C*. *aurantium* (sour orange). The orthologs from *C*. *sinensis* and *C*. *clementina* were identical as expected. There are a few mutations in the orthologs of *C*. *japonica*, *C*. *sinensis* Navelina, and *C*. *maxima*, but the orthologs of *C*. *aurantiifolia* and *C*. *aurantium* should be undergoing a pseudogenization process. There was a deletion plus several mutations in the NBS domain in *C*. *aurantiifolia*. There was an eight-base deletion in the LRR domain in *C*. *aurantiifolia* and *C*. *aurantium*. Most *C*. *aurantiifolia* mutations were shared with *C*. *aurantium* ([S11 Fig](#pone.0121893.s011){ref-type="supplementary-material"}.), and these mutations were not shared with other species. The results suggest that in *C*. *aurantiifolia* and *C*. *aurantium*, this gene is likely derived from the same common ancestor and was inherited as a pseudogene.
Discussion {#sec026}
==========
Similar NBS Genes in Hybrid *Citrus sinensis* and Original *Citrus clementina* Genome {#sec027}
-------------------------------------------------------------------------------------
After carefully reannotating the *Citrus* genome sequences, we found similar numbers of NBS genes in *C*. *clementina* and *C*. *sinensis* China. There are slightly fewer NBS genes in *C*. *sinensis* USA, possibly due to the more fragmented assembly of this genome. In phylogenetic tree using NBS domains, the NBS genes from three different *Citrus* genomes are spread across clades. After partitioning NBS genes on the tree into clades, we found that 97.7% of the clades containing at least three genes had members from each of three *Citrus* genomes. This pattern suggests that these three *Citrus* genomes have similar types of NBS genes derived from common ancestors. Because *C*. *sinensis* is the hybrid of *C*. *reticulata* (mandarin) and *C*. *maxima* (pomelo), it should be heterozygous and some of NBS genes in *C*. *sinensis* are expected have different genetic distances from NBS genes in *C*. *clementina*. This would support previous observations of NBS genes in F1 progeny of *Poncirus trifoliata* (trifoliate orange) and *Citrus reticulata* (tangerine). However, this is clearly not the case.
Furthermore, we mapped the re-sequenced reads of three *C*. *maxima* (pomelo) genomes and three *C*. *reticulata* (Mandarin orange) genomes onto the genome of *C*. *sinensis* China. In this case, 62% of *C*. *sinensis* China NBS genes have a copy present in all six resequenced genomes and 99% of *C*. *sinensis* China NBS genes have a copy in at least one of the re-sequenced genomes. The mapping results confirmed that a significant percentage of NBS genes of hybrid *C*. *sinensis* genomes have corresponding homologous genes in both the *C*. *maxima* and the *C*. *reticulata* genomes. Because the reference genome sequence of *C*. *maxima* is not yet available, the total number of NBS genes in *C*. *maxima* genomes is still unknown. However, we can at least conclude from the mapping of re-sequenced genomes that the *C*. *maxima* genome has homologous copies of NBS genes in *C*. *reticulata* and *C*. *sinensis* genomes. The homologous NBS genes in *C*. *maxima* and *C*. *reticulata* may be the reason that NBS genes in their hybrid *C*. *sinensis* are similar to those in *C*. *clementina* in this study.
Three Groups of *Citrus* NBS Genes {#sec028}
----------------------------------
We identified 442, 393 and 264 genes with full length NBS domains from *C*. *clementina*, *C*. *sinensis* China and *C*. *sinensis* USA reference genomes, respectively. There are also many genes with short NBS domains in three *Citrus* genomes. The *Citrus* NBS genes can be divided into three groups according to the phylogenetic tree of NBS domains: two of them without TIR domain (CC1 and CC2 groups) and the other group with TIR domain (TIR group). The number of non-TIR NBS genes is three times of the number of TIR NBS genes. In most of the TIR NBS genes, we can find the LRR domains defined in Pfam database \[[@pone.0121893.ref047]\]. We only can identify LRR domains in small part of non-TIR NBS genes using Pfam LRR domain definition. However, we can find the LxxLs repeats in most of the non-TIR NBS genes as shown in motifs from MEME. This implied that there may be other types of LRR domain in *Citrus* non-TIR NBS genes.
Our motif analyses also showed that motifs of TIR domains in *Citrus* TIR NBS genes are similar to those of TIR domains in *Arabidopsis* \[[@pone.0121893.ref006]\] and *Populus trichocarpa* \[[@pone.0121893.ref044]\] TIR NBS genes. Furthermore, the motifs of *Citrus* CC domains in CC1 NBS genes are similar to those motifs of CC domains in *Arabidopsis* CC NBS genes and the motifs of *Citrus* CC domains in *Citrus* CC2 NBS genes are similar to those motifs of CC domains in japonica rice CC NBS genes \[[@pone.0121893.ref045]\]. The different structure of motifs in NBS domain and CC domain between *Citrus* CC1 NBS genes and *Citrus* CC2 NBS genes suggested that they are likely from separate evolutionary origins.
To further confirm the three groups of NBS genes, we identified the NBS genes from *Arabidopsis*, *Populus*, *Oryza sativa* and grape. We used the same criteria to select the NBS domains from NBS genes of these genomes. Finally, we selected 152, 216, 209, 126 NBS domains from *Arabidopsis*, *Populus*, *Oryza sativa* and grape, respectively. Then, together with 442 NBS domains selected from *C*. *clementina*, we constructed a phylogenetic tree of those 1145 NBS domain sequences from five genomes. As shown in [Fig. 6](#pone.0121893.g006){ref-type="fig"}, the un-rooted phylogenetic tree was divided into three main branches. The *Populus*, grape and *Citrus* genomes have significant amount of NBS genes in all three branches. However, the NBS genes of *Oryza sativa* dominated in CC2 branch and most of *Arabidopsis* NBS genes located in CC1 and TIR branches. Our study showed that the NBS genes can be divided into three major groups as the non-TIR NBS genes are separated into two groups. The three groups of NBS genes underwent divergent evolution in different genomes. Further comparison of NBS genes of more genomes may help to understand the evolution of NBS genes and will help elucidate how plants maintain and adapt their defense system against pathogens.
{#pone.0121893.g006}
Highly Clustering of *Citrus* NBS Genes {#sec029}
---------------------------------------
The *Citrus* NBS genes are highly clustered in the genome. 84.9% of NBS genes in *C*. *clementina* and 76.9% of NBS genes in *C*. *sinensis* China were found in clusters. Previous studies showed 76% of rice \[[@pone.0121893.ref048]\], 64% of *A*. *lyrata* and 71% *A*. *thaliana* \[[@pone.0121893.ref013]\], 83.2% of grapevine and 67.5% of poplar \[[@pone.0121893.ref009]\] NBS genes are found in clusters. The percentage of *Citrus* NBS genes in clusters is in the high level comparing to other genomes. The average number of genes per clusters is 4.86 in *C*. *clementina* and 3.97 in *C*. *sinensis* China. These numbers are similar to those in other genomes \[[@pone.0121893.ref009]\]. Furthermore, most *Citrus* NBS genes in the same cluster belong to the same phylogenetic group, suggesting that tandem duplication is the primary mechanism for the expansion of NBS genes in the *Citrus* genus.
Molecular Evolution of *Citrus* NBS Genes {#sec030}
-----------------------------------------
Similar to NBS genes in other genomes, *Citrus* NBS genes are highly dynamic and are shaped by several evolutionary processes leading to several differences amongst NBS genes, including domain presence and mutation constraints and genome organization. Our results revealed multiple molecular evolution events amongst *Citrus* NBS genes including gene duplications, gene conversions, mutation constraint changes, recombination and transposable element insertions. Likely these events support a birth-and-death process leading to the origins of new NBS genes as well as nonfunctionalization and total loss of other NBS genes \[[@pone.0121893.ref012]\]. We found more than 200 tandem duplications in both *C*. *clementina* and *C*. *sinensis* China genomes alone. We also found that NBS genes become pseudogenes following original frame-shift mutations leading to mutation accumulations plus disruption of gene constraint leading to loss of function through transposable element insertions.
Most molecular evolutionary events occurred within NBS gene groups, suggesting that gene birth-death processes have been occurring since divergence from a common ancestral gene copy. Interestingly, the molecular evolution processes occurred differently amongst NBS gene groups and differently within each *Citrus* genome. For example, the number of gene conversion events in *C*. *sinensis* China TIR clusters is almost double than that in *C*. *clementina* TIR clusters, while there are many more conversion events in *C*. *clementina* CC2 clusters than in *C*. *sinensis* China CC2 clusters ([Table 4](#pone.0121893.t004){ref-type="table"}). Numbers of tandem duplications in CC1 and CC2 groups are much greater than that from the TIR group.
Conclusions {#sec031}
===========
Our comparative analyses yield valuable insight into the understanding of the structure, evolution and organization of NBS genes in *Citrus* genomes. *Citrus* NBS genes are structurally highly clustered. The hybrid *C*. *sinensis* genomes have similar types of NBS genes as those progenitor *C*. *clementina* genomes have. Furthermore, our comprehensive analysis also showed that there are three groups of plant NBS genes while non-TIR NBS genes can be divided into two groups. The distributions of three groups of NBS genes among genomes are different implied that the three groups of NBS genes underwent divergent evolution in different genomes.
Supporting Information {#sec032}
======================
###### Average intron number of CNL and TNL.
Cc: *C*. *clementina*, CsCN: *C*. *sinensis* China and CsUSA: *C*. *sinensis* USA.
(PDF)
######
Click here for additional data file.
###### Phylogenetic trees of three groups of *Citrus* NBS gene with P25941 as outgroup.
**A.** CC1 group; **B.** CC2 group; and **C.** TIR group. Nodes with bootstrap support of 100 are indicated with grey circles on the tree.
(PDF)
######
Click here for additional data file.
###### Structure of *Citrus* NBS gene domains.
The red rectangles indicate NBS domains, the green ellipses indicate CC domains, the left pointing pentagons indicate TIR domains and the left pointing triangles indicate LRR domains.
(PDF)
######
Click here for additional data file.
###### Positively selection sites of Clade_1260.
The grey box indicate the NBS domain.
(PDF)
######
Click here for additional data file.
###### The exon coverage of NBS-encoding genes in the resequences of *Citrus* genome (3 mandarin and 3 pomelo).
(PDF)
######
Click here for additional data file.
###### Multiple alignments of motifs from CC1 domain (A), CC2 domain (B) and TIR domain (C).
(PDF)
######
Click here for additional data file.
###### Orthologs of *Citrus* NBS-encoding genes of *C*. *clementina* and *C*. *sinensis* and their genome locations.
The outer blue circles indicate the nine largest scaffolds of Cc and orange circles indicate nine chromosomes plus a non-localized pseudo-chromosome. The NBS-encoding genes were arranged by their chromosomal positions. The NBS genes in the TIR group are indicated with orange links, CC1 in blue links and CC2 in light blue links. The NBS-encoding orthologs of *C*. *clementina* and *C*. *sinensis* are indicated by link lines.
(PDF)
######
Click here for additional data file.
###### Dot plots of syntenic orthologs of the NBS genes between *C*. *clementina* (Cc) and *C*. *sinensis* China (CsCN) produced by MCScanX.
The numbers in the grids indicate the number of syntenic ortholog pairs in the corresponding scaffolds. The scaffolds of *C*. *clementina* (Cc) are arranged along the x-axis and that of *C*. *sinensis* China (CsCN) are arranged on the y-axis.
(PDF)
######
Click here for additional data file.
###### Diagram of conserved cluster between *C*. *clementina* and *C*. *sinensis*.
The nodes in orange color indicate clusters of *C*. *clementina*, the blue nodes indicate clusters of *C*. *sinensis*, and the sizes of the nodes are shown relative to cluster size. The numbers on the edges indicate the number of orthologs identified in other species.
(PDF)
######
Click here for additional data file.
###### Pseudogenization of NBS-encoding genes of *Citrus* due to mutation (A) and retrotransposon insertion (B).
A: Sequences alignment of Cs1g18610.1, Cs1g18610.1_cc_32 and orange1.1g003367m. The bases indicated the variation bases in each *Citrus* species. The star in red color represented stop-codon gaining mutation and may result in pseudogene of Cs1g18610.1. B: LTR retrotransposon insertion in NBS-encoding genes orange1.1g043039m_cc_116 and orange1.1g043039m_csc_123 from *C*. *clementina* and *C*. *sinensis* respectively, and the multiple sequences alignment of the orthologs. LTR, Long terminal repeats; TSR, Target site repeats.
(PDF)
######
Click here for additional data file.
###### Validation and phylogenetic analysis of NBS-LRR gene, Cs1g09350.1, in different *Citrus* species.
A\) multiple sequence alignment, with blue bars along exons and thin lines along introns. The vertical lines in each alignment blocks indicate mutations that differ from the reference sequences of *C*. *sinensis*. **B)** neighbor-joining phylogenetic tree of the orthologs of Cs1g09350.1 in different *Citrus* species and bootstrap support displayed on the branches.
(PDF)
######
Click here for additional data file.
###### The NBS genes in three *Citrus* genomes.
(DOCX)
######
Click here for additional data file.
###### Classification, cluster and clade of *Citrus* NBS genes.
(XLSX)
######
Click here for additional data file.
###### LRR domain distribution of *Citrus* NBS gene.
(XLSX)
######
Click here for additional data file.
###### Positively selection sites distribution.
(XLSX)
######
Click here for additional data file.
###### The exome coverage of NBS genes from the 3 mandarin and 3 pomelo resequenced genomes.
(XLSX)
######
Click here for additional data file.
###### *Citrus* NBS gene interrupted with LTR transposons.
(XLSX)
######
Click here for additional data file.
[^1]: **Competing Interests:**The authors have declared that no competing interests exist.
[^2]: Conceived and designed the experiments: FL YD PS LD. Performed the experiments: LZ. Analyzed the data: YW DL ALR FL. Wrote the paper: ALR PS LD YD FL.
|
Comparison of lobe-specific mediastinal lymphadenectomy versus systematic mediastinal lymphadenectomy for clinical stage T₁a N₀ M₀ non-small cell lung cancer.
This study was to explore the appropriate extent of mediastinal lymph node dissection for clinical stage T₁a N₀ M₀ non-small cell lung cancer (NSCLC) by comparison between two modes of mediastinal lymph node dissection. A total of 96 clinical stage T₁a N₀ M₀ NSCLC cases received radical surgery were randomly divided to lobe-specific mediastinal lymphadenectomy (LL) group and systematic mediastinal lymphadenectomy (SL) group from the year 2004 to 2008. The effects of SL and LL on morbidity, N staging, overall survival (OS) and disease-free survival (DFS) were investigated. Meanwhile, associations between clinicopathological parameters and metastasis of lymph nodes were analyzed. The mean operating time and blood loss in LL group were significantly less than that in the SL group (135.48 ± 25.44 min vs. 180.85 ± 39.36 min, 155.11 ± 25.17 ml vs. 161.32 ± 28.20 ml, P < 0.05), the mean numbers of dissected lymph nodes of the SL group was significantly greater than that in the LL group (17.1 ± 3.7 vs. 9.4 ± 2.1, P < 0.05). The post-operative overall morbidity rate was higher in the SL group than that in the LL group (P < 0.05). There were no significant difference in migration of N staging, OS and DFS between two groups. The post-operative N staging, the tumor cells differentiation and the ratio of ground glass opacity (GGO) in tumor were the independent factors influencing long-term survival. Moreover, the significant correlation was seen between the metastasis of lymph nodes and clinicopathological parameters including tumor location and the GGO ratio. The LL group had similar efficacy as the SL group in the clinical stage T₁a N₀ M₀ NSCLC and there was unnecessary to perform systematic lymphadenectomy in such patients with a high ratio of GGO. |
Sign in
Barbara Stanwyck’s Best
“Steel-True,” the massive new biography of Barbara Stanwyck by Victoria Wilson, is volume one of two, and it only takes us through 1940. (Stanwyck lived until 1990.) But Stanwyck was an actress who hit her stride early. The qualities that made her great, that made her, as the film critic Nell Minow says, the most eternally modern of Golden Age actresses, were evident from the beginning. Stanwyck believed in being as natural on screen as the Hollywood glamour machine allowed, and it extended to her appearance: as Wilson makes clear, the actress was not vain. She described herself as just “average nice-looking”—no Greta Garbo or Carole Lombard or Hedy Lamar—and felt it was “a good thing” that she could “crack through with honesty.” She excelled at playing women with their own best interests in mind, tough women with hard shells, but she was also gifted at playing on the edge, where anger and defensiveness part to reveal a glinting vulnerability.
Stanwyck was one of Hollywood’s hard-working pros—a trouper who always knew her own lines, and often everybody else’s as well, was always on time, who learned the names of all the crew. She probably wouldn’t have appreciated a lot of psychologizing about her work, but it seems clear that she drew on her own rough upbringing to play many of her finest roles. Born Ruby Stevens in Brooklyn in 1907, she was four when her pregnant mother was killed by a drunk who pushed her off a streetcar. Her bricklayer father soon ran off to Panama, abandoning the family. Young Ruby was raised by a shifting cast of relatives, and supported herself from the age of fourteen as a switchboard operator, a pattern cutter, and a chorus girl. “I’ve known women who plodded through life,” Wilson quotes her saying, “but the women I knew did their plodding on the pavement, not the soil. I know very little about the simple life. I’m a product of crowded places and jammed-up emotions, where right and wrong weren’t always clearly defined and life wasn’t always sweet, but it was life.” That life, with all its ambiguity, is what you always see in a Stanwyck performance, flickering across her uncommonly intelligent face like light dancing on water.
“Steel-True” has inspired several Stanwyck retrospectives, including one at Film Forum, in New York, playing through December 31st. It inspired me to make a list of my favorite Stanwyck performances, all of them available on DVD. Here they are, in chronological order:
1. “The Miracle Woman” (1931). A twenty-three-year-old Stanwyck plays a young evangelist in the mold of Aimee Semple McPherson in this spare and somber Frank Capra film. She’s a razzle-dazzle type who preaches to excitable crowds with lions circling around her. (“Religion is like everything else,” the huckster who manages her says. “Great if you can sell it. No good if you give it away.”) Capra was in love with his leading lady, and you can see it. Stanwyck is fierce and girlish in the scenes where she preaches; tender and remorseful when she falls in love with a man blinded in the Great War, and begins to regret her deceitful career. The ending could have been treacly but it’s not; it’s saved by a dark strangeness and the unfussy realism of Stanwyck’s performance.
2. “Ladies They Talk About” (1933). An “Orange is the New Black” of the Depression years. As a depiction of life in a woman’s prison it has some foolish bits (the cells look an awful lot like dormitories at a posh boarding school), but also some sharp treatment of both female camaraderie and competition. Watch it for Stanwyck’s pantherine saunter as she surveys her new cage, and for the sarcastic Brooklynese in which she delivers lines like this one, her character’s retort to a religious fanatic who tells her no punishment is too harsh for her: “Oh yeah? Well, being penned up here with a daffodil like you comes awful close.”
3. “Baby Face” (1933). The quintessential pre-code movie, with Stanwyck as Lily Powers, a much-pawed waitress in her father’s grimy steel-town speakeasy, who vows to use men, not be used by them. With the help of a Nietzsche-quoting old cobbler and a black maid who is more of a friend than we are used to seeing in movies from the thirties and forties, she succeeds, spectacularly. Stanwyck’s Lily Powers is crass, shameless, and full of life.
4. “Stella Dallas” (1937). One of the greatest “women’s pictures” ever made, this film is as heartbreaking on the subject of class as it is on the substance of maternal love; in King Vidor’s “Stella Dallas,” they are inseparable. “On the surface, Stella had to appear loud and flamboyant—with a touch of vulgarity,” Stanwyck said of the part. “Yet while showing her in all commonness, she had to be portrayed in a way that audiences would realize that beneath the surface her instincts were fine, heartwarming, and noble.” The slender, brunette Stanwyck wore padding that made her look thirty pounds heavier, agreed to have her hair bleached blonde, and stuffed cotton in her mouth so she’d look jowly. But her real trick was to play a slatternly character in glitter and plumes, without condescending or making her comical. Wilson quotes a co-star in “Stella Dallas” saying that Stanwyck “was an actress who worked from the inside out.” It was this “privacy” in her performances that made them last. Watch it and you’ll see what she meant.
5. “The Lady Eve” (1941). If I had to pick a single favorite Stanwyck performance, it would be this one, in this most effervescent and complex of Preston Sturges comedies. The pleasure of seeing Stanwyck’s Eve deliver Henry Fonda’s character a comeuppance for his straitlaced self-regard is only just outmatched by the inevitable pleasure of their reconciliation. Here Stanwyck’s tough dame becomes a worldlier version, but she’s still, in all the best sense of the word, a dame.
6. “Meet John Doe” (1941). It’s schmaltzy and preachy, but at the same this film is time more pointed than the other two in Capra’s patriotic, anti-corruption trilogy, “Mr. Smith Goes to Washington” and “Mr. Deeds Goes to Town,” because it deals with the spectre of home-grown Fascism. Stanwyck, as a reporter in wide-shouldered career-gal suits, manages to be as warm and as ardent as when she’s in her cynical mode, cooking up a threatened suicide by a fake Everyman to boost circulation, as she is when she’s in her chastened and soft-hearted mode. The long, fast-talking speeches she gets in “Meet John Doe” are a nice reminder that, even after all those years in Hollywood, Stanwyck never lost her Brooklyn accent. And her performance seems to elicit a special sweetness from Gary Cooper, as the hobo she makes over and falls for.
7. “Ball of Fire” (1941). The setup of Howard Hawks’s comedy is similar enough to “The Lady Eve”—Gary Cooper is a stuffy professor whose world is turned upside down by Stanwyck’s burlesque dancer—that you can’t help but compare, and I prefer “The Lady Eve,” which has many more layers to it. “The Lady Eve” plays with the Garden of Eden story and with Freudian ideas—and, as the critic Wendy Lesser notes, it does so, surprisingly, while taking the woman’s point of view. Still, if “Ball of Fire” is simpler, it does have a lot of fun with the conceit that brings the scholar and the shimmier together: Cooper’s character is collecting American slang, and Stanwyck’s is a fount of it. And Stanwyck’s confidence is charming; she’s like a cocky street urchin in spangles.
8. “Double Indemnity” (1944). If you’ve seen one film noir, it’s probably this one, and it should be. In Billy Wilder’s near-perfect film of the James M. Cain novel, Stanwyck is cold, glittering, gimlet-eyed, with a geologically deep vein of pathology. Most of the time, Stanwyck’s face is as mobile as the northern lights; as Phyllis in “Double Indemnity,” she has a glacial, eerie stillness.
9. “All I Desire” (1953). One of two movies Stanwyck made for the director Douglas Sirk, both black and white, both sudsy melodramas on the surface, and, just beneath, devastating critiques of societal smugness and conformity. Stanwyck plays an actress who split from her husband long ago and has returned home to their small town to see their daughter perform in a high-school play. She’s a woman who has to salvage her own feelings for her husband and children from the resentment and pride with which she protects herself from the town’s disapproval. What makes it harder is that her husband and one of her daughters hide their own pain behind the same disapproval: she was too stylish, too ambitious, too much, so it was just as well she left them. Stanwyck’s gift for playing ambiguous emotion never served her better than in this delicate, mature performance. (For more on “All I Desire,” see my colleague Richard Brody’s write-up of its DVD release last January.)
10. “There’s Always Tomorrow” (1956). Teamed with Fred MacMurray in this Sirk movie, Stanwyck plays another sophisticated outsider, polished and gleaming, but animated by contradictory feelings that can’t quite be labelled or confined. Here she’s an old flame of MacMurray’s toy manufacturer, a man who doesn’t know how desperately diminished he feels until she reappears in his life, reminding him of who he was before he married and settled into a somnolent, suburban existence with a placidly maternal wife and a couple of teen-agers who’ve invaded him like body snatchers.
Photograph: John Kobal Foundation/Getty
Margaret Talbot is a staff writer and the author of “The Entertainer.” |
The DMV has informed its employees it will shut down all 176 field offices starting Friday because of coronavirus concerns, the NBCLA I-Team has learned.
The announcement was made just hours after another DMV employee tested positive for novel coronavirus. Employees have said the decision to close down couldn't come soon enough.
Those workers will be expected to return to their offices on April 1, and will begin conducting “virtual transactions” with customers April 2.
The closures come after the Fullerton DMV closed down, after an employee was diagnosed with COVID-19. All day angry customers showed up, thinking they could renew licenses and vehicle registrations that were about to expire.
Hours after that Fullerton office was closed, the DMV sent a memo to its workers, saying it will "close its facilities" statewide starting Friday to "address employee health and safety concerns."
One DMV employee speaking anonymously said they were "ecstatic" and they've been stressed, and concerned about their health.
Joel Grover reports for the NBC4 News at 6 p.m. on Tuesday, March 24, 2020.
For more than a week, DMV employees across California have been sharing their fears with the I-Team about being required to work in close proximity with the public and their colleagues.
The DMV said while its offices are closed, they will undergo an "enhanced cleaning" so employees can return to work April 1 to learn how to conduct "virtual transactions" with members of the public.
Employees tell NBCLA they were told by their bosses that DMV offices will remain closed to the public beyond April 1. License and registration renewals can made virtually. NBCLA reached out to the DMV for more information on that but haven't yet heard back.
The DMV has limited hours and only allows customers in with an appointment after an NBC4 I-Team report showed that there were potential problems with exposure during the coronavirus pandemic. Joel Grover reports for the NBC4 News on Friday, March 20, 2020.
Employees at California DMV offices are possibly being exposed to the coronavirus by simply being at work. Joel Grover reported on NBC4 News at 7 p.m. on Wednesday, March 18, 2020.
Editor's note: An earlier version listed an incorrect number of field offices. |
For those who have searched for answers regarding the life of Jesus and His role as Messiah, this book is a treasure. Ann Ree Colton portrays the soul of Jesus as never before revealed. His birth, messianic preparation, miracles, ministry, passion, and crucifixion are spiritually illumined with beauty and depth. Through her ability to read the akasic records of Jesus’ life and times, Ann Ree Colton shares priceless knowledge regarding the disciples of Jesus, their apostolic ministries, and other precious insights into the family, friends, adversaries, and miracles of Jesus. The Jesus Story also explains the precincts of heaven where Jesus presently dwells, including the cloisters of the saints. Prayers to access the intercessory helps of the saints and angels are also included.
Table of Contents:
PART ONE - THE JESUS STORY
Initiation Through Jesus
The Birth of Jesus
Engedi Initiation
The Struggle With Satan
The Disciples of Jesus
James, John, Philip, Nathanael, and Judas
Matthew, Thomas, and Simon Zelotes
Jude Thaddaeus and James the Less
The Miracles of Healing
The Crucifixion
The Song of His Passion
PART TWO - KINGDOM ETERNAL
Kingdom Eternal
The Sin Body of the Earth
Three Heavens
The Second Heaven
The Third Heaven
PART THREE - THE SAINTS
Worship, Religion, and Prophecy
The Saints
Mantrams
Prayers for God's Altar
Index
Excerpts:
Excerpt #1. "The life of Jesus is the greatest of all parables. Jesus was a mystery to the world during His life. He was a mystery to His family, to His disciples. In the present age of materialism and egotism, He is a mystery and sometimes spoken of as a myth. However, there are persons who know Him and revere Him. The parable concealed in the life of Jesus may be opened and made plain to the illumined heart and mind."
Excerpt #2. "Jesus brought joy to the world, that man might be lifted, ascended, and resurrected - but He also brought a great disturbance to the world. He came to upset systems within systems. He came to upset man's selfishness, and to overthrow decaying conditions in the earth. Jesus knew that certain truths had come to the world; He knew that He would extend these truths, and that He would give the way through which truth-seeking men could extend them." |
package sa
import (
"context"
"crypto/rand"
"crypto/rsa"
"crypto/x509"
"database/sql"
"encoding/json"
"fmt"
"io/ioutil"
"math/big"
"math/bits"
"net"
"reflect"
"sync"
"testing"
"time"
"github.com/jmhodges/clock"
"github.com/letsencrypt/boulder/core"
corepb "github.com/letsencrypt/boulder/core/proto"
"github.com/letsencrypt/boulder/db"
berrors "github.com/letsencrypt/boulder/errors"
"github.com/letsencrypt/boulder/features"
bgrpc "github.com/letsencrypt/boulder/grpc"
"github.com/letsencrypt/boulder/identifier"
blog "github.com/letsencrypt/boulder/log"
"github.com/letsencrypt/boulder/metrics"
"github.com/letsencrypt/boulder/probs"
"github.com/letsencrypt/boulder/revocation"
sapb "github.com/letsencrypt/boulder/sa/proto"
"github.com/letsencrypt/boulder/sa/satest"
"github.com/letsencrypt/boulder/test"
"github.com/letsencrypt/boulder/test/vars"
jose "gopkg.in/square/go-jose.v2"
)
var log = blog.UseMock()
var ctx = context.Background()
// initSA constructs a SQLStorageAuthority and a clean up function
// that should be defer'ed to the end of the test.
func initSA(t *testing.T) (*SQLStorageAuthority, clock.FakeClock, func()) {
features.Reset()
dbMap, err := NewDbMap(vars.DBConnSA, 0)
if err != nil {
t.Fatalf("Failed to create dbMap: %s", err)
}
fc := clock.NewFake()
fc.Set(time.Date(2015, 3, 4, 5, 0, 0, 0, time.UTC))
sa, err := NewSQLStorageAuthority(dbMap, fc, log, metrics.NoopRegisterer, 1)
if err != nil {
t.Fatalf("Failed to create SA: %s", err)
}
cleanUp := test.ResetSATestDatabase(t)
return sa, fc, cleanUp
}
func createPendingAuthorization(t *testing.T, sa core.StorageAuthority, domain string, exp time.Time) int64 {
t.Helper()
authz := core.Authorization{
Identifier: identifier.DNSIdentifier(domain),
RegistrationID: 1,
Status: "pending",
Expires: &exp,
Challenges: []core.Challenge{
{
Token: core.NewToken(),
Type: core.ChallengeTypeHTTP01,
Status: core.StatusPending,
},
},
}
authzPB, err := bgrpc.AuthzToPB(authz)
test.AssertNotError(t, err, "AuthzToPB failed")
ids, err := sa.NewAuthorizations2(context.Background(), &sapb.AddPendingAuthorizationsRequest{
Authz: []*corepb.Authorization{authzPB},
})
test.AssertNotError(t, err, "sa.NewAuthorizations2 failed")
return ids.Ids[0]
}
func createFinalizedAuthorization(t *testing.T, sa core.StorageAuthority, domain string, exp time.Time, status string) int64 {
t.Helper()
pendingID := createPendingAuthorization(t, sa, domain, exp)
expInt := exp.UnixNano()
attempted := string(core.ChallengeTypeHTTP01)
err := sa.FinalizeAuthorization2(context.Background(), &sapb.FinalizeAuthorizationRequest{
Id: pendingID,
Status: status,
Expires: expInt,
Attempted: attempted,
})
test.AssertNotError(t, err, "sa.FinalizeAuthorizations2 failed")
return pendingID
}
var (
anotherKey = `{
"kty":"RSA",
"n": "vd7rZIoTLEe-z1_8G1FcXSw9CQFEJgV4g9V277sER7yx5Qjz_Pkf2YVth6wwwFJEmzc0hoKY-MMYFNwBE4hQHw",
"e":"AQAB"
}`
)
func TestAddRegistration(t *testing.T) {
sa, clk, cleanUp := initSA(t)
defer cleanUp()
jwk := satest.GoodJWK()
contact := "mailto:foo@example.com"
contacts := &[]string{contact}
reg, err := sa.NewRegistration(ctx, core.Registration{
Key: jwk,
Contact: contacts,
InitialIP: net.ParseIP("43.34.43.34"),
})
if err != nil {
t.Fatalf("Couldn't create new registration: %s", err)
}
test.Assert(t, reg.ID != 0, "ID shouldn't be 0")
test.AssertDeepEquals(t, reg.Contact, contacts)
_, err = sa.GetRegistration(ctx, 0)
test.AssertError(t, err, "Registration object for ID 0 was returned")
dbReg, err := sa.GetRegistration(ctx, reg.ID)
test.AssertNotError(t, err, fmt.Sprintf("Couldn't get registration with ID %v", reg.ID))
expectedReg := core.Registration{
ID: reg.ID,
Key: jwk,
InitialIP: net.ParseIP("43.34.43.34"),
CreatedAt: clk.Now(),
}
test.AssertEquals(t, dbReg.ID, expectedReg.ID)
test.Assert(t, core.KeyDigestEquals(dbReg.Key, expectedReg.Key), "Stored key != expected")
newReg := core.Registration{
ID: reg.ID,
Key: jwk,
Contact: &[]string{"test.com"},
InitialIP: net.ParseIP("72.72.72.72"),
Agreement: "yes",
}
err = sa.UpdateRegistration(ctx, newReg)
test.AssertNotError(t, err, fmt.Sprintf("Couldn't get registration with ID %v", reg.ID))
dbReg, err = sa.GetRegistrationByKey(ctx, jwk)
test.AssertNotError(t, err, "Couldn't get registration by key")
test.AssertEquals(t, dbReg.ID, newReg.ID)
test.AssertEquals(t, dbReg.Agreement, newReg.Agreement)
var anotherJWK jose.JSONWebKey
err = json.Unmarshal([]byte(anotherKey), &anotherJWK)
test.AssertNotError(t, err, "couldn't unmarshal anotherJWK")
_, err = sa.GetRegistrationByKey(ctx, &anotherJWK)
test.AssertError(t, err, "Registration object for invalid key was returned")
}
func TestNoSuchRegistrationErrors(t *testing.T) {
sa, _, cleanUp := initSA(t)
defer cleanUp()
_, err := sa.GetRegistration(ctx, 100)
if !berrors.Is(err, berrors.NotFound) {
t.Errorf("GetRegistration: expected a berrors.NotFound type error, got %T type error (%s)", err, err)
}
jwk := satest.GoodJWK()
_, err = sa.GetRegistrationByKey(ctx, jwk)
if !berrors.Is(err, berrors.NotFound) {
t.Errorf("GetRegistrationByKey: expected a berrors.NotFound type error, got %T type error (%s)", err, err)
}
err = sa.UpdateRegistration(ctx, core.Registration{ID: 100, Key: jwk})
if !berrors.Is(err, berrors.NotFound) {
t.Errorf("UpdateRegistration: expected a berrors.NotFound type error, got %T type error (%v)", err, err)
}
}
func TestAddCertificate(t *testing.T) {
sa, clk, cleanUp := initSA(t)
defer cleanUp()
reg := satest.CreateWorkingRegistration(t, sa)
// An example cert taken from EFF's website
certDER, err := ioutil.ReadFile("www.eff.org.der")
test.AssertNotError(t, err, "Couldn't read example cert DER")
// Calling AddCertificate with a non-nil issued should succeed
issued := sa.clk.Now()
digest, err := sa.AddCertificate(ctx, certDER, reg.ID, nil, &issued)
test.AssertNotError(t, err, "Couldn't add www.eff.org.der")
test.AssertEquals(t, digest, "qWoItDZmR4P9eFbeYgXXP3SR4ApnkQj8x4LsB_ORKBo")
retrievedCert, err := sa.GetCertificate(ctx, "000000000000000000000000000000021bd4")
test.AssertNotError(t, err, "Couldn't get www.eff.org.der by full serial")
test.AssertByteEquals(t, certDER, retrievedCert.DER)
// Because nil was provided as the Issued time we expect the cert was stored
// with an issued time equal to now
test.AssertEquals(t, retrievedCert.Issued, clk.Now())
// Test cert generated locally by Boulder / CFSSL, names [example.com,
// www.example.com, admin.example.com]
certDER2, err := ioutil.ReadFile("test-cert.der")
test.AssertNotError(t, err, "Couldn't read example cert DER")
serial := "ffdd9b8a82126d96f61d378d5ba99a0474f0"
// Add the certificate with a specific issued time instead of nil
issuedTime := time.Date(2018, 4, 1, 7, 0, 0, 0, time.UTC)
digest2, err := sa.AddCertificate(ctx, certDER2, reg.ID, nil, &issuedTime)
test.AssertNotError(t, err, "Couldn't add test-cert.der")
test.AssertEquals(t, digest2, "vrlPN5wIPME1D2PPsCy-fGnTWh8dMyyYQcXPRkjHAQI")
retrievedCert2, err := sa.GetCertificate(ctx, serial)
test.AssertNotError(t, err, "Couldn't get test-cert.der")
test.AssertByteEquals(t, certDER2, retrievedCert2.DER)
// The cert should have been added with the specific issued time we provided
// as the issued field.
test.AssertEquals(t, retrievedCert2.Issued, issuedTime)
// Test adding OCSP response with cert
certDER3, err := ioutil.ReadFile("test-cert2.der")
test.AssertNotError(t, err, "Couldn't read example cert DER")
ocspResp := []byte{0, 0, 1}
_, err = sa.AddCertificate(ctx, certDER3, reg.ID, ocspResp, &issuedTime)
test.AssertNotError(t, err, "Couldn't add test-cert2.der")
}
func TestCountCertificatesByNames(t *testing.T) {
sa, clk, cleanUp := initSA(t)
defer cleanUp()
// Test cert generated locally by Boulder / CFSSL, names [example.com,
// www.example.com, admin.example.com]
certDER, err := ioutil.ReadFile("test-cert.der")
test.AssertNotError(t, err, "Couldn't read example cert DER")
cert, err := x509.ParseCertificate(certDER)
test.AssertNotError(t, err, "Couldn't parse example cert DER")
// Set the test clock's time to the time from the test certificate, plus an
// hour to account for rounding.
clk.Add(time.Hour - clk.Now().Sub(cert.NotBefore))
now := clk.Now()
yesterday := clk.Now().Add(-24 * time.Hour)
twoDaysAgo := clk.Now().Add(-48 * time.Hour)
tomorrow := clk.Now().Add(24 * time.Hour)
// Count for a name that doesn't have any certs
counts, err := sa.CountCertificatesByNames(ctx, []string{"example.com"}, yesterday, now)
test.AssertNotError(t, err, "Error counting certs.")
test.AssertEquals(t, len(counts), 1)
test.AssertEquals(t, counts[0].Name, "example.com")
test.AssertEquals(t, counts[0].Count, int64(0))
// Add the test cert and query for its names.
reg := satest.CreateWorkingRegistration(t, sa)
issued := sa.clk.Now()
_, err = sa.AddCertificate(ctx, certDER, reg.ID, nil, &issued)
test.AssertNotError(t, err, "Couldn't add test-cert.der")
// Time range including now should find the cert
counts, err = sa.CountCertificatesByNames(ctx, []string{"example.com"}, yesterday, now)
test.AssertNotError(t, err, "sa.CountCertificatesByName failed")
test.AssertEquals(t, len(counts), 1)
test.AssertEquals(t, counts[0].Name, "example.com")
test.AssertEquals(t, counts[0].Count, int64(1))
// Time range between two days ago and yesterday should not.
counts, err = sa.CountCertificatesByNames(ctx, []string{"example.com"}, twoDaysAgo, yesterday)
test.AssertNotError(t, err, "Error counting certs.")
test.AssertEquals(t, len(counts), 1)
test.AssertEquals(t, counts[0].Name, "example.com")
test.AssertEquals(t, counts[0].Count, int64(0))
// Time range between now and tomorrow also should not (time ranges are
// inclusive at the tail end, but not the beginning end).
counts, err = sa.CountCertificatesByNames(ctx, []string{"example.com"}, now, tomorrow)
test.AssertNotError(t, err, "Error counting certs.")
test.AssertEquals(t, len(counts), 1)
test.AssertEquals(t, counts[0].Name, "example.com")
test.AssertEquals(t, counts[0].Count, int64(0))
// Add a second test cert (for example.co.bn) and query for multiple names.
names := []string{"example.com", "foo.com", "example.co.bn"}
// Override countCertificatesByName with an implementation of certCountFunc
// that will block forever if it's called in serial, but will succeed if
// called in parallel.
var interlocker sync.WaitGroup
interlocker.Add(len(names))
sa.parallelismPerRPC = len(names)
oldCertCountFunc := sa.countCertificatesByName
sa.countCertificatesByName = func(sel db.Selector, domain string, earliest, latest time.Time) (int, error) {
interlocker.Done()
interlocker.Wait()
return oldCertCountFunc(sel, domain, earliest, latest)
}
certDER2, err := ioutil.ReadFile("test-cert2.der")
test.AssertNotError(t, err, "Couldn't read test-cert2.der")
_, err = sa.AddCertificate(ctx, certDER2, reg.ID, nil, &issued)
test.AssertNotError(t, err, "Couldn't add test-cert2.der")
counts, err = sa.CountCertificatesByNames(ctx, names, yesterday, now.Add(10000*time.Hour))
test.AssertNotError(t, err, "Error counting certs.")
test.AssertEquals(t, len(counts), 3)
expected := map[string]int{
"example.co.bn": 1,
"foo.com": 0,
"example.com": 1,
}
for _, entry := range counts {
domain := entry.Name
actualCount := entry.Count
expectedCount := int64(expected[domain])
test.AssertEquals(t, actualCount, expectedCount)
}
}
func TestCountRegistrationsByIP(t *testing.T) {
sa, fc, cleanUp := initSA(t)
defer cleanUp()
contact := "mailto:foo@example.com"
// Create one IPv4 registration
_, err := sa.NewRegistration(ctx, core.Registration{
Key: &jose.JSONWebKey{Key: &rsa.PublicKey{N: big.NewInt(1), E: 1}},
Contact: &[]string{contact},
InitialIP: net.ParseIP("43.34.43.34"),
})
// Create two IPv6 registrations, both within the same /48
test.AssertNotError(t, err, "Couldn't insert registration")
_, err = sa.NewRegistration(ctx, core.Registration{
Key: &jose.JSONWebKey{Key: &rsa.PublicKey{N: big.NewInt(2), E: 1}},
Contact: &[]string{contact},
InitialIP: net.ParseIP("2001:cdba:1234:5678:9101:1121:3257:9652"),
})
test.AssertNotError(t, err, "Couldn't insert registration")
_, err = sa.NewRegistration(ctx, core.Registration{
Key: &jose.JSONWebKey{Key: &rsa.PublicKey{N: big.NewInt(3), E: 1}},
Contact: &[]string{contact},
InitialIP: net.ParseIP("2001:cdba:1234:5678:9101:1121:3257:9653"),
})
test.AssertNotError(t, err, "Couldn't insert registration")
earliest := fc.Now().Add(-time.Hour * 24)
latest := fc.Now()
// There should be 0 registrations for an IPv4 address we didn't add
// a registration for
count, err := sa.CountRegistrationsByIP(ctx, net.ParseIP("1.1.1.1"), earliest, latest)
test.AssertNotError(t, err, "Failed to count registrations")
test.AssertEquals(t, count, 0)
// There should be 1 registration for the IPv4 address we did add
// a registration for
count, err = sa.CountRegistrationsByIP(ctx, net.ParseIP("43.34.43.34"), earliest, latest)
test.AssertNotError(t, err, "Failed to count registrations")
test.AssertEquals(t, count, 1)
// There should be 1 registration for the first IPv6 address we added
// a registration for
count, err = sa.CountRegistrationsByIP(ctx, net.ParseIP("2001:cdba:1234:5678:9101:1121:3257:9652"), earliest, latest)
test.AssertNotError(t, err, "Failed to count registrations")
test.AssertEquals(t, count, 1)
// There should be 1 registration for the second IPv6 address we added
// a registration for as well
count, err = sa.CountRegistrationsByIP(ctx, net.ParseIP("2001:cdba:1234:5678:9101:1121:3257:9653"), earliest, latest)
test.AssertNotError(t, err, "Failed to count registrations")
test.AssertEquals(t, count, 1)
// There should be 0 registrations for an IPv6 address in the same /48 as the
// two IPv6 addresses with registrations
count, err = sa.CountRegistrationsByIP(ctx, net.ParseIP("2001:cdba:1234:0000:0000:0000:0000:0000"), earliest, latest)
test.AssertNotError(t, err, "Failed to count registrations")
test.AssertEquals(t, count, 0)
}
func TestCountRegistrationsByIPRange(t *testing.T) {
sa, fc, cleanUp := initSA(t)
defer cleanUp()
contact := "mailto:foo@example.com"
// Create one IPv4 registration
_, err := sa.NewRegistration(ctx, core.Registration{
Key: &jose.JSONWebKey{Key: &rsa.PublicKey{N: big.NewInt(1), E: 1}},
Contact: &[]string{contact},
InitialIP: net.ParseIP("43.34.43.34"),
})
// Create two IPv6 registrations, both within the same /48
test.AssertNotError(t, err, "Couldn't insert registration")
_, err = sa.NewRegistration(ctx, core.Registration{
Key: &jose.JSONWebKey{Key: &rsa.PublicKey{N: big.NewInt(2), E: 1}},
Contact: &[]string{contact},
InitialIP: net.ParseIP("2001:cdba:1234:5678:9101:1121:3257:9652"),
})
test.AssertNotError(t, err, "Couldn't insert registration")
_, err = sa.NewRegistration(ctx, core.Registration{
Key: &jose.JSONWebKey{Key: &rsa.PublicKey{N: big.NewInt(3), E: 1}},
Contact: &[]string{contact},
InitialIP: net.ParseIP("2001:cdba:1234:5678:9101:1121:3257:9653"),
})
test.AssertNotError(t, err, "Couldn't insert registration")
earliest := fc.Now().Add(-time.Hour * 24)
latest := fc.Now()
// There should be 0 registrations in the range for an IPv4 address we didn't
// add a registration for
count, err := sa.CountRegistrationsByIPRange(ctx, net.ParseIP("1.1.1.1"), earliest, latest)
test.AssertNotError(t, err, "Failed to count registrations")
test.AssertEquals(t, count, 0)
// There should be 1 registration in the range for the IPv4 address we did
// add a registration for
count, err = sa.CountRegistrationsByIPRange(ctx, net.ParseIP("43.34.43.34"), earliest, latest)
test.AssertNotError(t, err, "Failed to count registrations")
test.AssertEquals(t, count, 1)
// There should be 2 registrations in the range for the first IPv6 address we added
// a registration for because it's in the same /48
count, err = sa.CountRegistrationsByIPRange(ctx, net.ParseIP("2001:cdba:1234:5678:9101:1121:3257:9652"), earliest, latest)
test.AssertNotError(t, err, "Failed to count registrations")
test.AssertEquals(t, count, 2)
// There should be 2 registrations in the range for the second IPv6 address
// we added a registration for as well, because it too is in the same /48
count, err = sa.CountRegistrationsByIPRange(ctx, net.ParseIP("2001:cdba:1234:5678:9101:1121:3257:9653"), earliest, latest)
test.AssertNotError(t, err, "Failed to count registrations")
test.AssertEquals(t, count, 2)
// There should also be 2 registrations in the range for an arbitrary IPv6 address in
// the same /48 as the registrations we added
count, err = sa.CountRegistrationsByIPRange(ctx, net.ParseIP("2001:cdba:1234:0000:0000:0000:0000:0000"), earliest, latest)
test.AssertNotError(t, err, "Failed to count registrations")
test.AssertEquals(t, count, 2)
}
func TestFQDNSets(t *testing.T) {
sa, fc, cleanUp := initSA(t)
defer cleanUp()
tx, err := sa.dbMap.Begin()
test.AssertNotError(t, err, "Failed to open transaction")
names := []string{"a.example.com", "B.example.com"}
expires := fc.Now().Add(time.Hour * 2).UTC()
issued := fc.Now()
err = addFQDNSet(tx, names, "serial", issued, expires)
test.AssertNotError(t, err, "Failed to add name set")
test.AssertNotError(t, tx.Commit(), "Failed to commit transaction")
// only one valid
threeHours := time.Hour * 3
count, err := sa.CountFQDNSets(ctx, threeHours, names)
test.AssertNotError(t, err, "Failed to count name sets")
test.AssertEquals(t, count, int64(1))
// check hash isn't affected by changing name order/casing
count, err = sa.CountFQDNSets(ctx, threeHours, []string{"b.example.com", "A.example.COM"})
test.AssertNotError(t, err, "Failed to count name sets")
test.AssertEquals(t, count, int64(1))
// add another valid set
tx, err = sa.dbMap.Begin()
test.AssertNotError(t, err, "Failed to open transaction")
err = addFQDNSet(tx, names, "anotherSerial", issued, expires)
test.AssertNotError(t, err, "Failed to add name set")
test.AssertNotError(t, tx.Commit(), "Failed to commit transaction")
// only two valid
count, err = sa.CountFQDNSets(ctx, threeHours, names)
test.AssertNotError(t, err, "Failed to count name sets")
test.AssertEquals(t, count, int64(2))
// add an expired set
tx, err = sa.dbMap.Begin()
test.AssertNotError(t, err, "Failed to open transaction")
err = addFQDNSet(
tx,
names,
"yetAnotherSerial",
issued.Add(-threeHours),
expires.Add(-threeHours),
)
test.AssertNotError(t, err, "Failed to add name set")
test.AssertNotError(t, tx.Commit(), "Failed to commit transaction")
// only two valid
count, err = sa.CountFQDNSets(ctx, threeHours, names)
test.AssertNotError(t, err, "Failed to count name sets")
test.AssertEquals(t, count, int64(2))
}
func TestFQDNSetsExists(t *testing.T) {
sa, fc, cleanUp := initSA(t)
defer cleanUp()
names := []string{"a.example.com", "B.example.com"}
exists, err := sa.FQDNSetExists(ctx, names)
test.AssertNotError(t, err, "Failed to check FQDN set existence")
test.Assert(t, !exists, "FQDN set shouldn't exist")
tx, err := sa.dbMap.Begin()
test.AssertNotError(t, err, "Failed to open transaction")
expires := fc.Now().Add(time.Hour * 2).UTC()
issued := fc.Now()
err = addFQDNSet(tx, names, "serial", issued, expires)
test.AssertNotError(t, err, "Failed to add name set")
test.AssertNotError(t, tx.Commit(), "Failed to commit transaction")
exists, err = sa.FQDNSetExists(ctx, names)
test.AssertNotError(t, err, "Failed to check FQDN set existence")
test.Assert(t, exists, "FQDN set does exist")
}
type execRecorder struct {
query string
args []interface{}
}
func (e *execRecorder) Exec(query string, args ...interface{}) (sql.Result, error) {
e.query = query
e.args = args
return nil, nil
}
func TestAddIssuedNames(t *testing.T) {
serial := big.NewInt(1)
expectedSerial := "000000000000000000000000000000000001"
notBefore := time.Date(2018, 2, 14, 12, 0, 0, 0, time.UTC)
placeholdersPerName := "(?, ?, ?, ?)"
baseQuery := "INSERT INTO issuedNames (reversedName, serial, notBefore, renewal) VALUES"
testCases := []struct {
Name string
IssuedNames []string
SerialNumber *big.Int
NotBefore time.Time
Renewal bool
ExpectedArgs []interface{}
}{
{
Name: "One domain, not a renewal",
IssuedNames: []string{"example.co.uk"},
SerialNumber: serial,
NotBefore: notBefore,
Renewal: false,
ExpectedArgs: []interface{}{
"uk.co.example",
expectedSerial,
notBefore,
false,
},
},
{
Name: "Two domains, not a renewal",
IssuedNames: []string{"example.co.uk", "example.xyz"},
SerialNumber: serial,
NotBefore: notBefore,
Renewal: false,
ExpectedArgs: []interface{}{
"uk.co.example",
expectedSerial,
notBefore,
false,
"xyz.example",
expectedSerial,
notBefore,
false,
},
},
{
Name: "One domain, renewal",
IssuedNames: []string{"example.co.uk"},
SerialNumber: serial,
NotBefore: notBefore,
Renewal: true,
ExpectedArgs: []interface{}{
"uk.co.example",
expectedSerial,
notBefore,
true,
},
},
{
Name: "Two domains, renewal",
IssuedNames: []string{"example.co.uk", "example.xyz"},
SerialNumber: serial,
NotBefore: notBefore,
Renewal: true,
ExpectedArgs: []interface{}{
"uk.co.example",
expectedSerial,
notBefore,
true,
"xyz.example",
expectedSerial,
notBefore,
true,
},
},
}
for _, tc := range testCases {
t.Run(tc.Name, func(t *testing.T) {
var e execRecorder
err := addIssuedNames(
&e,
&x509.Certificate{
DNSNames: tc.IssuedNames,
SerialNumber: tc.SerialNumber,
NotBefore: tc.NotBefore,
},
tc.Renewal)
test.AssertNotError(t, err, "addIssuedNames failed")
expectedPlaceholders := placeholdersPerName
for i := 0; i < len(tc.IssuedNames)-1; i++ {
expectedPlaceholders = fmt.Sprintf("%s, %s", expectedPlaceholders, placeholdersPerName)
}
expectedQuery := fmt.Sprintf("%s %s;", baseQuery, expectedPlaceholders)
test.AssertEquals(t, e.query, expectedQuery)
if !reflect.DeepEqual(e.args, tc.ExpectedArgs) {
t.Errorf("Wrong args: got\n%#v, expected\n%#v", e.args, tc.ExpectedArgs)
}
})
}
}
func TestPreviousCertificateExists(t *testing.T) {
sa, _, cleanUp := initSA(t)
defer cleanUp()
reg := satest.CreateWorkingRegistration(t, sa)
// An example cert taken from EFF's website
certDER, err := ioutil.ReadFile("www.eff.org.der")
test.AssertNotError(t, err, "reading cert DER")
issued := sa.clk.Now()
_, err = sa.AddPrecertificate(ctx, &sapb.AddCertificateRequest{
Der: certDER,
Issued: issued.UnixNano(),
RegID: reg.ID,
IssuerID: 1,
})
test.AssertNotError(t, err, "Failed to add precertificate")
_, err = sa.AddCertificate(ctx, certDER, reg.ID, nil, &issued)
test.AssertNotError(t, err, "calling AddCertificate")
cases := []struct {
name string
domain string
regID int64
expected bool
}{
{"matches", "www.eff.org", reg.ID, true},
{"wrongDomain", "wwoof.org", reg.ID, false},
{"wrongAccount", "www.eff.org", 3333, false},
}
for _, testCase := range cases {
t.Run(testCase.name, func(t *testing.T) {
exists, err := sa.PreviousCertificateExists(context.Background(),
&sapb.PreviousCertificateExistsRequest{
Domain: testCase.domain,
RegID: testCase.regID,
})
test.AssertNotError(t, err, "calling PreviousCertificateExists")
if exists.Exists != testCase.expected {
t.Errorf("wanted %v got %v", testCase.expected, exists.Exists)
}
})
}
}
func TestDeactivateAuthorization2(t *testing.T) {
sa, fc, cleanUp := initSA(t)
defer cleanUp()
// deactivate a pending authorization
expires := fc.Now().Add(time.Hour).UTC()
authzID := createPendingAuthorization(t, sa, "example.com", expires)
_, err := sa.DeactivateAuthorization2(context.Background(), &sapb.AuthorizationID2{Id: authzID})
test.AssertNotError(t, err, "sa.DeactivateAuthorization2 failed")
// deactivate a valid authorization"
authzID = createFinalizedAuthorization(t, sa, "example.com", expires, "valid")
_, err = sa.DeactivateAuthorization2(context.Background(), &sapb.AuthorizationID2{Id: authzID})
test.AssertNotError(t, err, "sa.DeactivateAuthorization2 failed")
}
func TestDeactivateAccount(t *testing.T) {
sa, _, cleanUp := initSA(t)
defer cleanUp()
reg := satest.CreateWorkingRegistration(t, sa)
err := sa.DeactivateRegistration(context.Background(), reg.ID)
test.AssertNotError(t, err, "DeactivateRegistration failed")
dbReg, err := sa.GetRegistration(context.Background(), reg.ID)
test.AssertNotError(t, err, "GetRegistration failed")
test.AssertEquals(t, dbReg.Status, core.StatusDeactivated)
}
func TestReverseName(t *testing.T) {
testCases := []struct {
inputDomain string
inputReversed string
}{
{"", ""},
{"...", "..."},
{"com", "com"},
{"example.com", "com.example"},
{"www.example.com", "com.example.www"},
{"world.wide.web.example.com", "com.example.web.wide.world"},
}
for _, tc := range testCases {
output := ReverseName(tc.inputDomain)
test.AssertEquals(t, output, tc.inputReversed)
}
}
type fqdnTestcase struct {
Serial string
Names []string
ExpectedHash setHash
Issued time.Time
Expires time.Time
}
func setupFQDNSets(t *testing.T, db *db.WrappedMap, fc clock.FakeClock) map[string]fqdnTestcase {
namesA := []string{"a.example.com", "B.example.com"}
namesB := []string{"example.org"}
namesC := []string{"letsencrypt.org"}
expectedHashA := setHash{0x92, 0xc7, 0xf2, 0x47, 0xbd, 0x1e, 0xea, 0x8d, 0x52, 0x7f, 0xb0, 0x59, 0x19, 0xe9, 0xbe, 0x81, 0x78, 0x88, 0xe6, 0xf7, 0x55, 0xf0, 0x1c, 0xc9, 0x63, 0x15, 0x5f, 0x8e, 0x52, 0xae, 0x95, 0xc1}
expectedHashB := setHash{0xbf, 0xab, 0xc3, 0x74, 0x32, 0x95, 0x8b, 0x6, 0x33, 0x60, 0xd3, 0xad, 0x64, 0x61, 0xc9, 0xc4, 0x73, 0x5a, 0xe7, 0xf8, 0xed, 0xd4, 0x65, 0x92, 0xa5, 0xe0, 0xf0, 0x14, 0x52, 0xb2, 0xe4, 0xb5}
expectedHashC := setHash{0xf2, 0xbb, 0x7b, 0xab, 0x8, 0x2c, 0x18, 0xee, 0x8, 0x97, 0x17, 0xbe, 0x67, 0xd7, 0x12, 0x14, 0xaa, 0x4, 0xac, 0xe2, 0x29, 0x2a, 0x67, 0x2c, 0x37, 0x2c, 0xf3, 0x33, 0xe1, 0xb0, 0xd8, 0xe7}
now := fc.Now()
testcases := map[string]fqdnTestcase{
// One test case with serial "a" issued now and expiring in two hours for
// namesA
"a": {
Serial: "a",
Names: namesA,
ExpectedHash: expectedHashA,
Issued: now,
Expires: now.Add(time.Hour * 2).UTC(),
},
// One test case with serial "b", issued one hour from now and expiring in
// two hours, also for namesA
"b": {
Serial: "b",
Names: namesA,
ExpectedHash: expectedHashA,
Issued: now.Add(time.Hour),
Expires: now.Add(time.Hour * 2).UTC(),
},
// One test case with serial "c", issued one hour from now and expiring in
// two hours, for namesB
"c": {
Serial: "c",
Names: namesB,
ExpectedHash: expectedHashB,
Issued: now.Add(time.Hour),
Expires: now.Add(time.Hour * 2).UTC(),
},
// One test case with serial "d", issued five hours in the past and expiring
// in two hours from now, with namesC
"d": {
Serial: "d",
Names: namesC,
ExpectedHash: expectedHashC,
Issued: now.Add(-5 * time.Hour),
Expires: now.Add(time.Hour * 2).UTC(),
},
}
for _, tc := range testcases {
tx, err := db.Begin()
test.AssertNotError(t, err, "Failed to open transaction")
err = addFQDNSet(tx, tc.Names, tc.Serial, tc.Issued, tc.Expires)
test.AssertNotError(t, err, fmt.Sprintf("Failed to add fqdnSet for %#v", tc))
test.AssertNotError(t, tx.Commit(), "Failed to commit transaction")
}
return testcases
}
func TestGetFQDNSetsBySerials(t *testing.T) {
sa, fc, cleanUp := initSA(t)
defer cleanUp()
// Add the test fqdn sets
testcases := setupFQDNSets(t, sa.dbMap, fc)
// Asking for the fqdnSets for no serials should produce an error since this
// is not expected in normal conditions
fqdnSets, err := sa.getFQDNSetsBySerials(sa.dbMap, []string{})
test.AssertError(t, err, "No error calling getFQDNSetsBySerials for empty serials")
test.AssertEquals(t, len(fqdnSets), 0)
// Asking for the fqdnSets for serials that don't exist should return nothing
fqdnSets, err = sa.getFQDNSetsBySerials(sa.dbMap, []string{"this", "doesn't", "exist"})
test.AssertNotError(t, err, "Error calling getFQDNSetsBySerials for non-existent serials")
test.AssertEquals(t, len(fqdnSets), 0)
// Asking for the fqdnSets for serial "a" should return the expectedHashA hash
fqdnSets, err = sa.getFQDNSetsBySerials(sa.dbMap, []string{"a"})
test.AssertNotError(t, err, "Error calling getFQDNSetsBySerials for serial \"a\"")
test.AssertEquals(t, len(fqdnSets), 1)
test.AssertEquals(t, string(fqdnSets[0]), string(testcases["a"].ExpectedHash))
// Asking for the fqdnSets for serial "b" should return the expectedHashA hash
// because cert "b" has namesA subjects
fqdnSets, err = sa.getFQDNSetsBySerials(sa.dbMap, []string{"b"})
test.AssertNotError(t, err, "Error calling getFQDNSetsBySerials for serial \"b\"")
test.AssertEquals(t, len(fqdnSets), 1)
test.AssertEquals(t, string(fqdnSets[0]), string(testcases["b"].ExpectedHash))
// Asking for the fqdnSets for serial "d" should return the expectedHashC hash
// because cert "d" has namesC subjects
fqdnSets, err = sa.getFQDNSetsBySerials(sa.dbMap, []string{"d"})
test.AssertNotError(t, err, "Error calling getFQDNSetsBySerials for serial \"d\"")
test.AssertEquals(t, len(fqdnSets), 1)
test.AssertEquals(t, string(fqdnSets[0]), string(testcases["d"].ExpectedHash))
// Asking for the fqdnSets for serial "c" should return the expectedHashB hash
// because cert "c" has namesB subjects
fqdnSets, err = sa.getFQDNSetsBySerials(sa.dbMap, []string{"c"})
test.AssertNotError(t, err, "Error calling getFQDNSetsBySerials for serial \"c\"")
test.AssertEquals(t, len(fqdnSets), 1)
test.AssertEquals(t, string(fqdnSets[0]), string(testcases["c"].ExpectedHash))
// Asking for the fqdnSets for serial "a", "b", "c" and "made up" should return
// the three expected hashes - two expectedHashA (for "a" and "b"), one
// expectedHashB (for "c")
expectedHashes := map[string]int{
string(testcases["a"].ExpectedHash): 2,
string(testcases["c"].ExpectedHash): 1,
}
fqdnSets, err = sa.getFQDNSetsBySerials(sa.dbMap, []string{"a", "b", "c", "made up"})
test.AssertNotError(t, err, "Error calling getFQDNSetsBySerials for serial \"a\", \"b\", \"c\", \"made up\"")
for _, setHash := range fqdnSets {
setHashKey := string(setHash)
if _, present := expectedHashes[setHashKey]; !present {
t.Errorf("Unexpected setHash in results: %#v", setHash)
}
expectedHashes[setHashKey]--
if expectedHashes[setHashKey] <= 0 {
delete(expectedHashes, setHashKey)
}
}
if len(expectedHashes) != 0 {
t.Errorf("Some expected setHashes were not observed: %#v", expectedHashes)
}
}
func TestGetNewIssuancesByFQDNSet(t *testing.T) {
sa, fc, cleanUp := initSA(t)
defer cleanUp()
// Add the test fqdn sets
testcases := setupFQDNSets(t, sa.dbMap, fc)
// Use one hour ago as the earliest cut off
earliest := fc.Now().Add(-time.Hour)
// Calling getNewIssuancesByFQDNSet with an empty FQDNSet should error
count, err := sa.getNewIssuancesByFQDNSet(sa.dbMap, nil, earliest)
test.AssertError(t, err, "No error calling getNewIssuancesByFQDNSet for empty fqdn set")
test.AssertEquals(t, count, -1)
// Calling getNewIssuancesByFQDNSet with FQDNSet hashes that don't exist
// should return 0
count, err = sa.getNewIssuancesByFQDNSet(sa.dbMap, []setHash{{0xC0, 0xFF, 0xEE}, {0x13, 0x37}}, earliest)
test.AssertNotError(t, err, "Error calling getNewIssuancesByFQDNSet for non-existent set hashes")
test.AssertEquals(t, count, 0)
// Calling getNewIssuancesByFQDNSet with the "a" expected hash should return
// 1, since both testcase "b" was a renewal of testcase "a"
count, err = sa.getNewIssuancesByFQDNSet(sa.dbMap, []setHash{testcases["a"].ExpectedHash}, earliest)
test.AssertNotError(t, err, "Error calling getNewIssuancesByFQDNSet for testcase a")
test.AssertEquals(t, count, 1)
// Calling getNewIssuancesByFQDNSet with the "c" expected hash should return
// 1, since there is only one issuance for this sethash
count, err = sa.getNewIssuancesByFQDNSet(sa.dbMap, []setHash{testcases["c"].ExpectedHash}, earliest)
test.AssertNotError(t, err, "Error calling getNewIssuancesByFQDNSet for testcase c")
test.AssertEquals(t, count, 1)
// Calling getNewIssuancesByFQDNSet with the "c" and "d" expected hashes should return
// only 1, since there is only one issuance for the provided set hashes that
// is within the earliest window. The issuance for "d" was too far in the past
// to be counted
count, err = sa.getNewIssuancesByFQDNSet(sa.dbMap, []setHash{testcases["c"].ExpectedHash, testcases["d"].ExpectedHash}, earliest)
test.AssertNotError(t, err, "Error calling getNewIssuancesByFQDNSet for testcase c and d")
test.AssertEquals(t, count, 1)
// But by moving the earliest point behind the "d" issuance, we should now get a count of 2
count, err = sa.getNewIssuancesByFQDNSet(sa.dbMap, []setHash{testcases["c"].ExpectedHash, testcases["d"].ExpectedHash}, earliest.Add(-6*time.Hour))
test.AssertNotError(t, err, "Error calling getNewIssuancesByFQDNSet for testcase c and d with adjusted earliest")
test.AssertEquals(t, count, 2)
}
func TestNewOrder(t *testing.T) {
sa, _, cleanup := initSA(t)
defer cleanup()
// Create a test registration to reference
reg, err := sa.NewRegistration(ctx, core.Registration{
Key: &jose.JSONWebKey{Key: &rsa.PublicKey{N: big.NewInt(1), E: 1}},
InitialIP: net.ParseIP("42.42.42.42"),
})
test.AssertNotError(t, err, "Couldn't create test registration")
order, err := sa.NewOrder(context.Background(), &corepb.Order{
RegistrationID: reg.ID,
Expires: 1,
Names: []string{"example.com", "just.another.example.com"},
V2Authorizations: []int64{1, 2, 3},
Status: string(core.StatusPending),
})
test.AssertNotError(t, err, "sa.NewOrder failed")
test.AssertEquals(t, order.Id, int64(1))
var authzIDs []int64
_, err = sa.dbMap.Select(&authzIDs, "SELECT authzID FROM orderToAuthz2 WHERE orderID = ?;", order.Id)
test.AssertNotError(t, err, "Failed to count orderToAuthz entries")
test.AssertEquals(t, len(authzIDs), 3)
test.AssertDeepEquals(t, authzIDs, []int64{1, 2, 3})
names, err := sa.namesForOrder(context.Background(), order.Id)
test.AssertNotError(t, err, "namesForOrder errored")
test.AssertEquals(t, len(names), 2)
test.AssertDeepEquals(t, names, []string{"com.example", "com.example.another.just"})
names, err = sa.namesForOrder(context.Background(), order.Id)
test.AssertNotError(t, err, "namesForOrder errored")
test.AssertEquals(t, len(names), 2)
test.AssertDeepEquals(t, names, []string{"com.example", "com.example.another.just"})
}
func TestSetOrderProcessing(t *testing.T) {
sa, fc, cleanup := initSA(t)
defer cleanup()
// Create a test registration to reference
reg, err := sa.NewRegistration(ctx, core.Registration{
Key: &jose.JSONWebKey{Key: &rsa.PublicKey{N: big.NewInt(1), E: 1}},
InitialIP: net.ParseIP("42.42.42.42"),
})
test.AssertNotError(t, err, "Couldn't create test registration")
// Add one pending authz
expires := fc.Now().Add(time.Hour)
authzID := createFinalizedAuthorization(t, sa, "example.com", expires, "valid")
order := &corepb.Order{
RegistrationID: reg.ID,
Expires: sa.clk.Now().Add(365 * 24 * time.Hour).UnixNano(),
Names: []string{"example.com"},
V2Authorizations: []int64{authzID},
}
// Add a new order in pending status with no certificate serial
order, err = sa.NewOrder(context.Background(), order)
test.AssertNotError(t, err, "NewOrder failed")
// Set the order to be processing
err = sa.SetOrderProcessing(context.Background(), order)
test.AssertNotError(t, err, "SetOrderProcessing failed")
// Read the order by ID from the DB to check the status was correctly updated
// to processing
updatedOrder, err := sa.GetOrder(
context.Background(),
&sapb.OrderRequest{Id: order.Id})
test.AssertNotError(t, err, "GetOrder failed")
test.AssertEquals(t, updatedOrder.Status, string(core.StatusProcessing))
test.AssertEquals(t, updatedOrder.BeganProcessing, true)
// Try to set the same order to be processing again. We should get an error.
err = sa.SetOrderProcessing(context.Background(), order)
test.AssertError(t, err, "Set the same order processing twice. This should have been an error.")
if !berrors.Is(err, berrors.OrderNotReady) {
t.Errorf("Wrong error when setting an order to processing twice. Expected OrderNotReady, got %#v", err)
}
}
func TestFinalizeOrder(t *testing.T) {
sa, fc, cleanup := initSA(t)
defer cleanup()
// Create a test registration to reference
reg, err := sa.NewRegistration(ctx, core.Registration{
Key: &jose.JSONWebKey{Key: &rsa.PublicKey{N: big.NewInt(1), E: 1}},
InitialIP: net.ParseIP("42.42.42.42"),
})
test.AssertNotError(t, err, "Couldn't create test registration")
// Add one pending authz
expires := fc.Now().Add(time.Hour)
authzID := createFinalizedAuthorization(t, sa, "example.com", expires, "valid")
order := &corepb.Order{
RegistrationID: reg.ID,
Expires: sa.clk.Now().Add(365 * 24 * time.Hour).UnixNano(),
Names: []string{"example.com"},
V2Authorizations: []int64{authzID},
}
// Add a new order with an empty certificate serial
order, err = sa.NewOrder(context.Background(), order)
test.AssertNotError(t, err, "NewOrder failed")
// Set the order to processing so it can be finalized
err = sa.SetOrderProcessing(ctx, order)
test.AssertNotError(t, err, "SetOrderProcessing failed")
// Finalize the order with a certificate serial
order.CertificateSerial = "eat.serial.for.breakfast"
err = sa.FinalizeOrder(context.Background(), order)
test.AssertNotError(t, err, "FinalizeOrder failed")
// Read the order by ID from the DB to check the certificate serial and status
// was correctly updated
updatedOrder, err := sa.GetOrder(
context.Background(),
&sapb.OrderRequest{Id: order.Id})
test.AssertNotError(t, err, "GetOrder failed")
test.AssertEquals(t, updatedOrder.CertificateSerial, "eat.serial.for.breakfast")
test.AssertEquals(t, updatedOrder.Status, string(core.StatusValid))
}
func TestOrder(t *testing.T) {
sa, fc, cleanup := initSA(t)
defer cleanup()
// Create a test registration to reference
reg, err := sa.NewRegistration(ctx, core.Registration{
Key: &jose.JSONWebKey{Key: &rsa.PublicKey{N: big.NewInt(1), E: 1}},
InitialIP: net.ParseIP("42.42.42.42"),
})
test.AssertNotError(t, err, "Couldn't create test registration")
authzExpires := fc.Now().Add(time.Hour)
authzID := createPendingAuthorization(t, sa, "example.com", authzExpires)
// Set the order to expire in two hours
expires := fc.Now().Add(2 * time.Hour).UnixNano()
inputOrder := &corepb.Order{
RegistrationID: reg.ID,
Expires: expires,
Names: []string{"example.com"},
V2Authorizations: []int64{authzID},
}
// Create the order
order, err := sa.NewOrder(context.Background(), inputOrder)
test.AssertNotError(t, err, "sa.NewOrder failed")
// The Order from GetOrder should match the following expected order
expectedOrder := &corepb.Order{
// The registration ID, authorizations, expiry, and names should match the
// input to NewOrder
RegistrationID: inputOrder.RegistrationID,
V2Authorizations: inputOrder.V2Authorizations,
Names: inputOrder.Names,
Expires: inputOrder.Expires,
// The ID should have been set to 1 by the SA
Id: 1,
// The status should be pending
Status: string(core.StatusPending),
// The serial should be empty since this is a pending order
CertificateSerial: "",
// We should not be processing it
BeganProcessing: false,
// The created timestamp should have been set to the current time
Created: sa.clk.Now().UnixNano(),
}
// Fetch the order by its ID and make sure it matches the expected
storedOrder, err := sa.GetOrder(context.Background(), &sapb.OrderRequest{Id: order.Id})
test.AssertNotError(t, err, "sa.GetOrder failed")
test.AssertDeepEquals(t, storedOrder, expectedOrder)
}
// TestGetAuthorizationNoRows ensures that the GetAuthorization function returns
// the correct error when there are no results for the provided ID.
func TestGetAuthorizationNoRows(t *testing.T) {
sa, _, cleanUp := initSA(t)
defer cleanUp()
// An empty authz ID should result in a not found berror.
id := int64(123)
_, err := sa.GetAuthorization2(ctx, &sapb.AuthorizationID2{Id: id})
test.AssertError(t, err, "Didn't get an error looking up non-existent authz ID")
test.Assert(t, berrors.Is(err, berrors.NotFound), "GetAuthorization did not return a berrors.NotFound error")
}
func TestGetAuthorizations2(t *testing.T) {
sa, fc, cleanup := initSA(t)
defer cleanup()
reg := satest.CreateWorkingRegistration(t, sa)
exp := fc.Now().AddDate(0, 0, 10).UTC()
identA := "aaa"
identB := "bbb"
identC := "ccc"
identD := "ddd"
idents := []string{identA, identB, identC}
authzIDA := createFinalizedAuthorization(t, sa, "aaa", exp, "valid")
authzIDB := createPendingAuthorization(t, sa, "bbb", exp)
nearbyExpires := fc.Now().UTC().Add(time.Hour)
authzIDC := createPendingAuthorization(t, sa, "ccc", nearbyExpires)
// Associate authorizations with an order so that GetAuthorizations2 thinks
// they are WFE2 authorizations.
err := sa.dbMap.Insert(&orderToAuthzModel{
OrderID: 1,
AuthzID: authzIDA,
})
test.AssertNotError(t, err, "sa.dbMap.Insert failed")
err = sa.dbMap.Insert(&orderToAuthzModel{
OrderID: 1,
AuthzID: authzIDB,
})
test.AssertNotError(t, err, "sa.dbMap.Insert failed")
err = sa.dbMap.Insert(&orderToAuthzModel{
OrderID: 1,
AuthzID: authzIDC,
})
test.AssertNotError(t, err, "sa.dbMap.Insert failed")
// Set an expiry cut off of 1 day in the future similar to `RA.NewOrder`. This
// should exclude pending authorization C based on its nearbyExpires expiry
// value.
expiryCutoff := fc.Now().AddDate(0, 0, 1).UnixNano()
// Get authorizations for the names used above.
authz, err := sa.GetAuthorizations2(context.Background(), &sapb.GetAuthorizationsRequest{
RegistrationID: reg.ID,
Domains: idents,
Now: expiryCutoff,
})
// It should not fail
test.AssertNotError(t, err, "sa.GetAuthorizations2 failed")
// We should get back two authorizations since one of the three authorizations
// created above expires too soon.
test.AssertEquals(t, len(authz.Authz), 2)
// Get authorizations for the names used above, and one name that doesn't exist
authz, err = sa.GetAuthorizations2(context.Background(), &sapb.GetAuthorizationsRequest{
RegistrationID: reg.ID,
Domains: append(idents, identD),
Now: expiryCutoff,
})
// It should not fail
test.AssertNotError(t, err, "sa.GetAuthorizations2 failed")
// It should still return only two authorizations
test.AssertEquals(t, len(authz.Authz), 2)
}
func TestCountOrders(t *testing.T) {
sa, _, cleanUp := initSA(t)
defer cleanUp()
reg := satest.CreateWorkingRegistration(t, sa)
now := sa.clk.Now()
expires := now.Add(24 * time.Hour)
earliest := now.Add(-time.Hour)
latest := now.Add(time.Second)
// Counting new orders for a reg ID that doesn't exist should return 0
count, err := sa.CountOrders(ctx, 12345, earliest, latest)
test.AssertNotError(t, err, "Couldn't count new orders for fake reg ID")
test.AssertEquals(t, count, 0)
// Add a pending authorization
authzID := createPendingAuthorization(t, sa, "example.com", expires)
// Add one pending order
expiresNano := expires.UnixNano()
order, err := sa.NewOrder(ctx, &corepb.Order{
RegistrationID: reg.ID,
Expires: expiresNano,
Names: []string{"example.com"},
V2Authorizations: []int64{authzID},
})
test.AssertNotError(t, err, "Couldn't create new pending order")
// Counting new orders for the reg ID should now yield 1
count, err = sa.CountOrders(ctx, reg.ID, earliest, latest)
test.AssertNotError(t, err, "Couldn't count new orders for reg ID")
test.AssertEquals(t, count, 1)
// Moving the count window to after the order was created should return the
// count to 0
earliest = time.Unix(0, order.Created).Add(time.Minute)
latest = earliest.Add(time.Hour)
count, err = sa.CountOrders(ctx, reg.ID, earliest, latest)
test.AssertNotError(t, err, "Couldn't count new orders for reg ID")
test.AssertEquals(t, count, 0)
}
func TestFasterGetOrderForNames(t *testing.T) {
sa, fc, cleanUp := initSA(t)
defer cleanUp()
domain := "example.com"
expires := fc.Now().Add(time.Hour)
reg, err := sa.NewRegistration(ctx, core.Registration{
Key: satest.GoodJWK(),
InitialIP: net.ParseIP("42.42.42.42"),
})
test.AssertNotError(t, err, "Couldn't create test registration")
authzIDs := createPendingAuthorization(t, sa, domain, expires)
expiresNano := expires.UnixNano()
_, err = sa.NewOrder(ctx, &corepb.Order{
RegistrationID: reg.ID,
Expires: expiresNano,
V2Authorizations: []int64{authzIDs},
Names: []string{domain},
})
test.AssertNotError(t, err, "sa.NewOrder failed")
_, err = sa.NewOrder(ctx, &corepb.Order{
RegistrationID: reg.ID,
Expires: expiresNano,
V2Authorizations: []int64{authzIDs},
Names: []string{domain},
})
test.AssertNotError(t, err, "sa.NewOrder failed")
_, err = sa.GetOrderForNames(ctx, &sapb.GetOrderForNamesRequest{
AcctID: reg.ID,
Names: []string{domain},
})
test.AssertNotError(t, err, "sa.GetOrderForNames failed")
}
func TestGetOrderForNames(t *testing.T) {
sa, fc, cleanUp := initSA(t)
defer cleanUp()
// Give the order we create a short lifetime
orderLifetime := time.Hour
expires := fc.Now().Add(orderLifetime).UnixNano()
// Create two test registrations to associate with orders
regA, err := sa.NewRegistration(ctx, core.Registration{
Key: satest.GoodJWK(),
InitialIP: net.ParseIP("42.42.42.42"),
})
test.AssertNotError(t, err, "Couldn't create test registration")
// Add one pending authz for the first name for regA and one
// pending authz for the second name for regA
authzExpires := fc.Now().Add(time.Hour)
authzIDA := createPendingAuthorization(t, sa, "example.com", authzExpires)
authzIDB := createPendingAuthorization(t, sa, "just.another.example.com", authzExpires)
ctx := context.Background()
names := []string{"example.com", "just.another.example.com"}
// Call GetOrderForNames for a set of names we haven't created an order for
// yet
result, err := sa.GetOrderForNames(ctx, &sapb.GetOrderForNamesRequest{
AcctID: regA.ID,
Names: names,
})
// We expect the result to return an error
test.AssertError(t, err, "sa.GetOrderForNames did not return an error for an empty result")
// The error should be a notfound error
test.AssertEquals(t, berrors.Is(err, berrors.NotFound), true)
// The result should be nil
test.Assert(t, result == nil, "sa.GetOrderForNames for non-existent order returned non-nil result")
// Add a new order for a set of names
order, err := sa.NewOrder(ctx, &corepb.Order{
RegistrationID: regA.ID,
Expires: expires,
V2Authorizations: []int64{authzIDA, authzIDB},
Names: names,
})
// It shouldn't error
test.AssertNotError(t, err, "sa.NewOrder failed")
// The order ID shouldn't be nil
test.AssertNotNil(t, order.Id, "NewOrder returned with a nil Id")
// Call GetOrderForNames with the same account ID and set of names as the
// above NewOrder call
result, err = sa.GetOrderForNames(ctx, &sapb.GetOrderForNamesRequest{
AcctID: regA.ID,
Names: names,
})
// It shouldn't error
test.AssertNotError(t, err, "sa.GetOrderForNames failed")
// The order returned should have the same ID as the order we created above
test.AssertNotNil(t, result, "Returned order was nil")
test.AssertEquals(t, result.Id, order.Id)
// Call GetOrderForNames with a different account ID from the NewOrder call
regB := int64(1337)
result, err = sa.GetOrderForNames(ctx, &sapb.GetOrderForNamesRequest{
AcctID: regB,
Names: names,
})
// It should error
test.AssertError(t, err, "sa.GetOrderForNames did not return an error for an empty result")
// The error should be a notfound error
test.AssertEquals(t, berrors.Is(err, berrors.NotFound), true)
// The result should be nil
test.Assert(t, result == nil, "sa.GetOrderForNames for diff AcctID returned non-nil result")
// Advance the clock beyond the initial order's lifetime
fc.Add(2 * orderLifetime)
// Call GetOrderForNames again with the same account ID and set of names as
// the initial NewOrder call
result, err = sa.GetOrderForNames(ctx, &sapb.GetOrderForNamesRequest{
AcctID: regA.ID,
Names: names,
})
// It should error since there is no result
test.AssertError(t, err, "sa.GetOrderForNames did not return an error for an empty result")
// The error should be a notfound error
test.AssertEquals(t, berrors.Is(err, berrors.NotFound), true)
// The result should be nil because the initial order expired & we don't want
// to return expired orders
test.Assert(t, result == nil, "sa.GetOrderForNames returned non-nil result for expired order case")
// Create two valid authorizations
authzExpires = fc.Now().Add(time.Hour)
authzIDC := createFinalizedAuthorization(t, sa, "zombo.com", authzExpires, "valid")
authzIDD := createFinalizedAuthorization(t, sa, "welcome.to.zombo.com", authzExpires, "valid")
// Add a fresh order that uses the authorizations created above
names = []string{"zombo.com", "welcome.to.zombo.com"}
order, err = sa.NewOrder(ctx, &corepb.Order{
RegistrationID: regA.ID,
Expires: fc.Now().Add(orderLifetime).UnixNano(),
V2Authorizations: []int64{authzIDC, authzIDD},
Names: names,
})
// It shouldn't error
test.AssertNotError(t, err, "sa.NewOrder failed")
// The order ID shouldn't be nil
test.AssertNotNil(t, order.Id, "NewOrder returned with a nil Id")
// Call GetOrderForNames with the same account ID and set of names as
// the earlier NewOrder call
result, err = sa.GetOrderForNames(ctx, &sapb.GetOrderForNamesRequest{
AcctID: regA.ID,
Names: names,
})
// It should not error since a ready order can be reused.
test.AssertNotError(t, err, "sa.GetOrderForNames returned an unexpected error for ready order reuse")
// The order returned should have the same ID as the order we created above
test.AssertEquals(t, result != nil, true)
test.AssertEquals(t, result.Id, order.Id)
// Set the order processing so it can be finalized
err = sa.SetOrderProcessing(ctx, order)
test.AssertNotError(t, err, "sa.SetOrderProcessing failed")
// Finalize the order
order.CertificateSerial = "cinnamon toast crunch"
err = sa.FinalizeOrder(ctx, order)
test.AssertNotError(t, err, "sa.FinalizeOrder failed")
// Call GetOrderForNames with the same account ID and set of names as
// the earlier NewOrder call
result, err = sa.GetOrderForNames(ctx, &sapb.GetOrderForNamesRequest{
AcctID: regA.ID,
Names: names,
})
// It should error since a valid order should not be reused.
test.AssertError(t, err, "sa.GetOrderForNames did not return an error for an empty result")
// The error should be a notfound error
test.AssertEquals(t, berrors.Is(err, berrors.NotFound), true)
// The result should be nil because the one matching order has been finalized
// already
test.Assert(t, result == nil, "sa.GetOrderForNames returned non-nil result for finalized order case")
}
func TestStatusForOrder(t *testing.T) {
sa, fc, cleanUp := initSA(t)
defer cleanUp()
ctx := context.Background()
expires := fc.Now().Add(time.Hour)
expiresNano := expires.UnixNano()
alreadyExpired := expires.Add(-2 * time.Hour)
// Create a registration to work with
reg := satest.CreateWorkingRegistration(t, sa)
// Create a pending authz, an expired authz, an invalid authz, a deactivated authz,
// and a valid authz
pendingID := createPendingAuthorization(t, sa, "pending.your.order.is.up", expires)
expiredID := createPendingAuthorization(t, sa, "expired.your.order.is.up", alreadyExpired)
invalidID := createFinalizedAuthorization(t, sa, "invalid.your.order.is.up", expires, "invalid")
validID := createFinalizedAuthorization(t, sa, "valid.your.order.is.up", expires, "valid")
deactivatedID := createPendingAuthorization(t, sa, "deactivated.your.order.is.up", expires)
_, err := sa.DeactivateAuthorization2(context.Background(), &sapb.AuthorizationID2{Id: deactivatedID})
test.AssertNotError(t, err, "sa.DeactivateAuthorization2 failed")
testCases := []struct {
Name string
AuthorizationIDs []int64
OrderNames []string
OrderExpires int64
ExpectedStatus string
SetProcessing bool
Finalize bool
}{
{
Name: "Order with an invalid authz",
OrderNames: []string{"pending.your.order.is.up", "invalid.your.order.is.up", "deactivated.your.order.is.up", "valid.your.order.is.up"},
AuthorizationIDs: []int64{pendingID, invalidID, deactivatedID, validID},
ExpectedStatus: string(core.StatusInvalid),
},
{
Name: "Order with an expired authz",
OrderNames: []string{"pending.your.order.is.up", "expired.your.order.is.up", "deactivated.your.order.is.up", "valid.your.order.is.up"},
AuthorizationIDs: []int64{pendingID, expiredID, deactivatedID, validID},
ExpectedStatus: string(core.StatusInvalid),
},
{
Name: "Order with a deactivated authz",
OrderNames: []string{"pending.your.order.is.up", "deactivated.your.order.is.up", "valid.your.order.is.up"},
AuthorizationIDs: []int64{pendingID, deactivatedID, validID},
ExpectedStatus: string(core.StatusInvalid),
},
{
Name: "Order with a pending authz",
OrderNames: []string{"valid.your.order.is.up", "pending.your.order.is.up"},
AuthorizationIDs: []int64{validID, pendingID},
ExpectedStatus: string(core.StatusPending),
},
{
Name: "Order with only valid authzs, not yet processed or finalized",
OrderNames: []string{"valid.your.order.is.up"},
AuthorizationIDs: []int64{validID},
ExpectedStatus: string(core.StatusReady),
},
{
Name: "Order with only valid authzs, set processing",
OrderNames: []string{"valid.your.order.is.up"},
AuthorizationIDs: []int64{validID},
SetProcessing: true,
ExpectedStatus: string(core.StatusProcessing),
},
{
Name: "Order with only valid authzs, not yet processed or finalized, OrderReadyStatus feature flag",
OrderNames: []string{"valid.your.order.is.up"},
AuthorizationIDs: []int64{validID},
ExpectedStatus: string(core.StatusReady),
},
{
Name: "Order with only valid authzs, set processing",
OrderNames: []string{"valid.your.order.is.up"},
AuthorizationIDs: []int64{validID},
SetProcessing: true,
ExpectedStatus: string(core.StatusProcessing),
},
{
Name: "Order with only valid authzs, set processing and finalized",
OrderNames: []string{"valid.your.order.is.up"},
AuthorizationIDs: []int64{validID},
SetProcessing: true,
Finalize: true,
ExpectedStatus: string(core.StatusValid),
},
}
for _, tc := range testCases {
t.Run(tc.Name, func(t *testing.T) {
// If the testcase doesn't specify an order expiry use a default timestamp
// in the near future.
orderExpiry := tc.OrderExpires
if orderExpiry == 0 {
orderExpiry = expiresNano
}
newOrder, err := sa.NewOrder(ctx, &corepb.Order{
RegistrationID: reg.ID,
Expires: orderExpiry,
V2Authorizations: tc.AuthorizationIDs,
Names: tc.OrderNames,
BeganProcessing: false,
})
test.AssertNotError(t, err, "NewOrder errored unexpectedly")
// If requested, set the order to processing
if tc.SetProcessing {
err := sa.SetOrderProcessing(ctx, newOrder)
test.AssertNotError(t, err, "Error setting order to processing status")
}
// If requested, finalize the order
if tc.Finalize {
newOrder.CertificateSerial = "lucky charms"
err := sa.FinalizeOrder(ctx, newOrder)
test.AssertNotError(t, err, "Error finalizing order")
}
// Fetch the order by ID to get its calculated status
storedOrder, err := sa.GetOrder(ctx, &sapb.OrderRequest{Id: newOrder.Id})
test.AssertNotError(t, err, "GetOrder failed")
// The status shouldn't be nil
test.AssertNotNil(t, storedOrder.Status, "Order status was nil")
// The status should match expected
test.AssertEquals(t, storedOrder.Status, tc.ExpectedStatus)
})
}
}
func TestUpdateChallengesDeleteUnused(t *testing.T) {
sa, fc, cleanUp := initSA(t)
defer cleanUp()
expires := fc.Now().Add(time.Hour)
ctx := context.Background()
// Create a pending authz
authzID := createFinalizedAuthorization(t, sa, "example.com", expires, "valid")
result, err := sa.GetAuthorization2(ctx, &sapb.AuthorizationID2{Id: authzID})
test.AssertNotError(t, err, "sa.GetAuthorization2 failed")
if len(result.Challenges) != 1 {
t.Fatalf("expected 1 challenge left after finalization, got %d", len(result.Challenges))
}
if result.Challenges[0].Status != string(core.StatusValid) {
t.Errorf("expected challenge status %q, got %q", core.StatusValid, result.Challenges[0].Status)
}
if result.Challenges[0].Type != "http-01" {
t.Errorf("expected challenge type %q, got %q", "http-01", result.Challenges[0].Type)
}
}
func TestRevokeCertificate(t *testing.T) {
sa, fc, cleanUp := initSA(t)
defer cleanUp()
reg := satest.CreateWorkingRegistration(t, sa)
// Add a cert to the DB to test with.
certDER, err := ioutil.ReadFile("www.eff.org.der")
test.AssertNotError(t, err, "Couldn't read example cert DER")
_, err = sa.AddPrecertificate(ctx, &sapb.AddCertificateRequest{
Der: certDER,
RegID: reg.ID,
Ocsp: nil,
Issued: sa.clk.Now().UnixNano(),
IssuerID: 1,
})
test.AssertNotError(t, err, "Couldn't add www.eff.org.der")
serial := "000000000000000000000000000000021bd4"
status, err := sa.GetCertificateStatus(ctx, serial)
test.AssertNotError(t, err, "GetCertificateStatus failed")
test.AssertEquals(t, status.Status, core.OCSPStatusGood)
fc.Add(1 * time.Hour)
now := fc.Now()
dateUnix := now.UnixNano()
reason := int64(1)
response := []byte{1, 2, 3}
err = sa.RevokeCertificate(context.Background(), &sapb.RevokeCertificateRequest{
Serial: serial,
Date: dateUnix,
Reason: reason,
Response: response,
})
test.AssertNotError(t, err, "RevokeCertificate failed")
status, err = sa.GetCertificateStatus(ctx, serial)
test.AssertNotError(t, err, "GetCertificateStatus failed")
test.AssertEquals(t, status.Status, core.OCSPStatusRevoked)
test.AssertEquals(t, status.RevokedReason, revocation.Reason(reason))
test.AssertEquals(t, status.RevokedDate, now)
test.AssertEquals(t, status.OCSPLastUpdated, now)
test.AssertDeepEquals(t, status.OCSPResponse, response)
err = sa.RevokeCertificate(context.Background(), &sapb.RevokeCertificateRequest{
Serial: serial,
Date: dateUnix,
Reason: reason,
Response: response,
})
test.AssertError(t, err, "RevokeCertificate should've failed when certificate already revoked")
}
func TestAddCertificateRenewalBit(t *testing.T) {
sa, fc, cleanUp := initSA(t)
defer cleanUp()
reg := satest.CreateWorkingRegistration(t, sa)
// An example cert taken from EFF's website
certDER, err := ioutil.ReadFile("www.eff.org.der")
test.AssertNotError(t, err, "Unexpected error reading www.eff.org.der test file")
cert, err := x509.ParseCertificate(certDER)
test.AssertNotError(t, err, "Unexpected error parsing www.eff.org.der test file")
names := cert.DNSNames
expires := fc.Now().Add(time.Hour * 2).UTC()
issued := fc.Now()
serial := "thrilla"
// Add a FQDN set for the names so that it will be considered a renewal
tx, err := sa.dbMap.Begin()
test.AssertNotError(t, err, "Failed to open transaction")
err = addFQDNSet(tx, names, serial, issued, expires)
test.AssertNotError(t, err, "Failed to add name set")
test.AssertNotError(t, tx.Commit(), "Failed to commit transaction")
// Add the certificate with the same names.
_, err = sa.AddPrecertificate(ctx, &sapb.AddCertificateRequest{
Der: certDER,
Issued: issued.UnixNano(),
RegID: reg.ID,
IssuerID: 1,
})
test.AssertNotError(t, err, "Failed to add precertificate")
_, err = sa.AddCertificate(ctx, certDER, reg.ID, nil, &issued)
test.AssertNotError(t, err, "Failed to add certificate")
assertIsRenewal := func(t *testing.T, name string, expected bool) {
t.Helper()
var count int
err := sa.dbMap.SelectOne(
&count,
`SELECT COUNT(1) FROM issuedNames
WHERE reversedName = ?
AND renewal = ?`,
ReverseName(name),
expected,
)
test.AssertNotError(t, err, "Unexpected error from SelectOne on issuedNames")
test.AssertEquals(t, count, 1)
}
// All of the names should have a issuedNames row marking it as a renewal.
for _, name := range names {
assertIsRenewal(t, name, true)
}
// Add a certificate with different names.
certDER, err = ioutil.ReadFile("test-cert.der")
test.AssertNotError(t, err, "Unexpected error reading test-cert.der test file")
cert, err = x509.ParseCertificate(certDER)
test.AssertNotError(t, err, "Unexpected error parsing test-cert.der test file")
names = cert.DNSNames
_, err = sa.AddPrecertificate(ctx, &sapb.AddCertificateRequest{
Der: certDER,
Issued: issued.UnixNano(),
RegID: reg.ID,
IssuerID: 1,
})
test.AssertNotError(t, err, "Failed to add precertificate")
_, err = sa.AddCertificate(ctx, certDER, reg.ID, nil, &issued)
test.AssertNotError(t, err, "Failed to add certificate")
// None of the names should have a issuedNames row marking it as a renewal.
for _, name := range names {
assertIsRenewal(t, name, false)
}
}
func TestAddCertificateBadRatelimitUpdate(t *testing.T) {
sa, _, cleanUp := initSA(t)
defer cleanUp()
reg := satest.CreateWorkingRegistration(t, sa)
issued := sa.clk.Now()
serial, cert := test.ThrowAwayCert(t, 1)
// Manually add an fqdn set for the certificate serial. This will cause the
// real fqdn set update in AddCertificate to fail due to the duplicate serial.
err := addFQDNSet(
sa.dbMap,
cert.DNSNames,
serial,
cert.NotBefore,
cert.NotAfter)
test.AssertNotError(t, err, "Couldn't manually add fqdnSet")
// Add the test certificate, it shouldn't error even though part of the rate
// limit updates failed.
_, err = sa.AddCertificate(ctx, cert.Raw, reg.ID, nil, &issued)
test.AssertNotError(t, err, "Couldn't add testCert")
// The rate limit transaction failure stat should have been incremented
test.AssertEquals(t, test.CountCounter(sa.rateLimitWriteErrors), 1)
// The rate limit transaction failure should have been audit logged
logLines := log.GetAllMatching(`ERR: \[AUDIT\] failed AddCertificate ratelimit update transaction: failed to insert \*core.FQDNSet: Error 1062: Duplicate entry '.*' for key 'serial'`)
test.AssertEquals(t, len(logLines), 1)
}
func TestCountCertificatesRenewalBit(t *testing.T) {
sa, fc, cleanUp := initSA(t)
defer cleanUp()
// Create a test registration
reg := satest.CreateWorkingRegistration(t, sa)
// Create a small throw away key for the test certificates.
testKey, err := rsa.GenerateKey(rand.Reader, 512)
test.AssertNotError(t, err, "error generating test key")
// Create an initial test certificate for a set of domain names, issued an
// hour ago.
template := &x509.Certificate{
SerialNumber: big.NewInt(1337),
DNSNames: []string{"www.not-example.com", "not-example.com", "admin.not-example.com"},
NotBefore: fc.Now().Add(-time.Hour),
BasicConstraintsValid: true,
ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth, x509.ExtKeyUsageClientAuth},
}
certADER, err := x509.CreateCertificate(rand.Reader, template, template, testKey.Public(), testKey)
test.AssertNotError(t, err, "Failed to create test cert A")
certA, _ := x509.ParseCertificate(certADER)
// Update the template with a new serial number and a not before of now and
// create a second test cert for the same names. This will be a renewal.
template.SerialNumber = big.NewInt(7331)
template.NotBefore = fc.Now()
certBDER, err := x509.CreateCertificate(rand.Reader, template, template, testKey.Public(), testKey)
test.AssertNotError(t, err, "Failed to create test cert B")
certB, _ := x509.ParseCertificate(certBDER)
// Update the template with a third serial number and a partially overlapping
// set of names. This will not be a renewal but will help test the exact name
// counts.
template.SerialNumber = big.NewInt(0xC0FFEE)
template.DNSNames = []string{"www.not-example.com"}
certCDER, err := x509.CreateCertificate(rand.Reader, template, template, testKey.Public(), testKey)
test.AssertNotError(t, err, "Failed to create test cert C")
countName := func(t *testing.T, name string) int64 {
counts, err := sa.CountCertificatesByNames(
context.Background(),
[]string{name},
fc.Now().Add(-5*time.Hour),
fc.Now().Add(5*time.Hour))
test.AssertNotError(t, err, "Unexpected err from CountCertificatesByNames")
for _, elem := range counts {
if elem.Name == name {
return elem.Count
}
}
return 0
}
// Add the first certificate - it won't be considered a renewal.
issued := certA.NotBefore
_, err = sa.AddCertificate(ctx, certADER, reg.ID, nil, &issued)
test.AssertNotError(t, err, "Failed to add CertA test certificate")
// The count for the base domain should be 1 - just certA has been added.
test.AssertEquals(t, countName(t, "not-example.com"), int64(1))
// Add the second certificate - it should be considered a renewal
issued = certB.NotBefore
_, err = sa.AddCertificate(ctx, certBDER, reg.ID, nil, &issued)
test.AssertNotError(t, err, "Failed to add CertB test certificate")
// The count for the base domain should still be 1, just certA. CertB should
// be ignored.
test.AssertEquals(t, countName(t, "not-example.com"), int64(1))
// Add the third certificate - it should not be considered a renewal
_, err = sa.AddCertificate(ctx, certCDER, reg.ID, nil, &issued)
test.AssertNotError(t, err, "Failed to add CertC test certificate")
// The count for the base domain should be 2 now: certA and certC.
// CertB should be ignored.
test.AssertEquals(t, countName(t, "not-example.com"), int64(2))
}
func TestNewAuthorizations2(t *testing.T) {
sa, fc, cleanUp := initSA(t)
defer cleanUp()
reg := satest.CreateWorkingRegistration(t, sa)
expires := fc.Now().Add(time.Hour).UTC().UnixNano()
apbA := &corepb.Authorization{
Identifier: "aaa",
RegistrationID: reg.ID,
Status: string(core.StatusPending),
Expires: expires,
Challenges: []*corepb.Challenge{
{
Status: string(core.StatusPending),
Type: string(core.ChallengeTypeDNS01),
Token: "YXNkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
},
},
}
apbB := &corepb.Authorization{
Identifier: "aaa",
RegistrationID: reg.ID,
Status: string(core.StatusPending),
Expires: expires,
Challenges: []*corepb.Challenge{
{
Status: string(core.StatusPending),
Type: string(core.ChallengeTypeDNS01),
Token: "ZmdoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
},
},
}
req := &sapb.AddPendingAuthorizationsRequest{Authz: []*corepb.Authorization{apbA, apbB}}
ids, err := sa.NewAuthorizations2(context.Background(), req)
test.AssertNotError(t, err, "sa.NewAuthorizations failed")
test.AssertEquals(t, len(ids.Ids), 2)
for i, id := range ids.Ids {
id := id
dbVer, err := sa.GetAuthorization2(context.Background(), &sapb.AuthorizationID2{Id: id})
test.AssertNotError(t, err, "sa.GetAuthorization failed")
// Everything but ID should match
req.Authz[i].Id = dbVer.Id
test.AssertDeepEquals(t, req.Authz[i], dbVer)
}
}
func TestFinalizeAuthorization2(t *testing.T) {
sa, fc, cleanUp := initSA(t)
defer cleanUp()
reg := satest.CreateWorkingRegistration(t, sa)
expires := fc.Now().Add(time.Hour).UTC().UnixNano()
apb := &corepb.Authorization{
Identifier: "aaa",
RegistrationID: reg.ID,
Status: string(core.StatusPending),
Expires: expires,
Challenges: []*corepb.Challenge{
{
Status: string(core.StatusPending),
Type: string(core.ChallengeTypeDNS01),
Token: "YXNkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
},
},
}
ids, err := sa.NewAuthorizations2(context.Background(), &sapb.AddPendingAuthorizationsRequest{Authz: []*corepb.Authorization{apb}})
test.AssertNotError(t, err, "sa.NewAuthorization failed")
expires = fc.Now().Add(time.Hour * 2).UTC().UnixNano()
ip, _ := net.ParseIP("1.1.1.1").MarshalText()
err = sa.FinalizeAuthorization2(context.Background(), &sapb.FinalizeAuthorizationRequest{
Id: ids.Ids[0],
ValidationRecords: []*corepb.ValidationRecord{
{
Hostname: "aaa",
Port: "123",
Url: "http://asd",
AddressUsed: ip,
},
},
Status: string(core.StatusValid),
Expires: expires,
Attempted: string(core.ChallengeTypeDNS01),
})
test.AssertNotError(t, err, "sa.FinalizeAuthorization2 failed")
dbVer, err := sa.GetAuthorization2(context.Background(), &sapb.AuthorizationID2{Id: ids.Ids[0]})
test.AssertNotError(t, err, "sa.GetAuthorization2 failed")
test.AssertEquals(t, dbVer.Status, string(core.StatusValid))
test.AssertEquals(t, time.Unix(0, dbVer.Expires).UTC(), fc.Now().Add(time.Hour*2).UTC())
test.AssertEquals(t, dbVer.Challenges[0].Status, string(core.StatusValid))
test.AssertEquals(t, len(dbVer.Challenges[0].Validationrecords), 1)
apb2 := &corepb.Authorization{
Identifier: "aaa",
RegistrationID: reg.ID,
Status: string(core.StatusPending),
Expires: expires,
Challenges: []*corepb.Challenge{
{
Status: string(core.StatusPending),
Type: string(core.ChallengeTypeDNS01),
Token: "ZmdoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
},
},
}
ids, err = sa.NewAuthorizations2(context.Background(), &sapb.AddPendingAuthorizationsRequest{Authz: []*corepb.Authorization{apb2}})
test.AssertNotError(t, err, "sa.NewAuthorization failed")
prob, _ := bgrpc.ProblemDetailsToPB(probs.ConnectionFailure("it went bad captain"))
err = sa.FinalizeAuthorization2(context.Background(), &sapb.FinalizeAuthorizationRequest{
Id: ids.Ids[0],
ValidationRecords: []*corepb.ValidationRecord{
{
Hostname: "aaa",
Port: "123",
Url: "http://asd",
AddressUsed: ip,
},
},
ValidationError: prob,
Status: string(core.StatusInvalid),
Attempted: string(core.ChallengeTypeDNS01),
Expires: expires,
})
test.AssertNotError(t, err, "sa.FinalizeAuthorization2 failed")
dbVer, err = sa.GetAuthorization2(context.Background(), &sapb.AuthorizationID2{Id: ids.Ids[0]})
test.AssertNotError(t, err, "sa.GetAuthorization2 failed")
test.AssertEquals(t, dbVer.Status, string(core.StatusInvalid))
test.AssertEquals(t, dbVer.Challenges[0].Status, string(core.StatusInvalid))
test.AssertEquals(t, len(dbVer.Challenges[0].Validationrecords), 1)
test.AssertDeepEquals(t, dbVer.Challenges[0].Error, prob)
}
func TestGetPendingAuthorization2(t *testing.T) {
sa, fc, cleanUp := initSA(t)
defer cleanUp()
domain := "example.com"
expiresA := fc.Now().Add(time.Hour).UTC()
expiresB := fc.Now().Add(time.Hour * 3).UTC()
authzIDA := createPendingAuthorization(t, sa, domain, expiresA)
authzIDB := createPendingAuthorization(t, sa, domain, expiresB)
regID := int64(1)
validUntil := fc.Now().Add(time.Hour * 2).UTC().UnixNano()
dbVer, err := sa.GetPendingAuthorization2(context.Background(), &sapb.GetPendingAuthorizationRequest{
RegistrationID: regID,
IdentifierValue: domain,
ValidUntil: validUntil,
})
test.AssertNotError(t, err, "sa.GetPendingAuthorization2 failed")
test.AssertEquals(t, fmt.Sprintf("%d", authzIDB), dbVer.Id)
validUntil = fc.Now().UTC().UnixNano()
dbVer, err = sa.GetPendingAuthorization2(context.Background(), &sapb.GetPendingAuthorizationRequest{
RegistrationID: regID,
IdentifierValue: domain,
ValidUntil: validUntil,
})
test.AssertNotError(t, err, "sa.GetPendingAuthorization2 failed")
test.AssertEquals(t, fmt.Sprintf("%d", authzIDA), dbVer.Id)
}
func TestCountPendingAuthorizations2(t *testing.T) {
sa, fc, cleanUp := initSA(t)
defer cleanUp()
expiresA := fc.Now().Add(time.Hour).UTC()
expiresB := fc.Now().Add(time.Hour * 3).UTC()
_ = createPendingAuthorization(t, sa, "example.com", expiresA)
_ = createPendingAuthorization(t, sa, "example.com", expiresB)
// Registration has two new style pending authorizations
regID := int64(1)
count, err := sa.CountPendingAuthorizations2(context.Background(), &sapb.RegistrationID{
Id: regID,
})
test.AssertNotError(t, err, "sa.CountPendingAuthorizations2 failed")
test.AssertEquals(t, count.Count, int64(2))
// Registration has two new style pending authorizations, one of which has expired
fc.Add(time.Hour * 2)
count, err = sa.CountPendingAuthorizations2(context.Background(), &sapb.RegistrationID{
Id: regID,
})
test.AssertNotError(t, err, "sa.CountPendingAuthorizations2 failed")
test.AssertEquals(t, count.Count, int64(1))
// Registration with no authorizations should be 0
noReg := int64(20)
count, err = sa.CountPendingAuthorizations2(context.Background(), &sapb.RegistrationID{
Id: noReg,
})
test.AssertNotError(t, err, "sa.CountPendingAuthorizations2 failed")
test.AssertEquals(t, count.Count, int64(0))
}
func TestAuthzModelMapToPB(t *testing.T) {
baseExpires := time.Now()
input := map[string]authzModel{
"example.com": {
ID: 123,
IdentifierType: 0,
IdentifierValue: "example.com",
RegistrationID: 77,
Status: 1,
Expires: baseExpires,
Challenges: 4,
},
"www.example.com": {
ID: 124,
IdentifierType: 0,
IdentifierValue: "www.example.com",
RegistrationID: 77,
Status: 1,
Expires: baseExpires,
Challenges: 1,
},
"other.example.net": {
ID: 125,
IdentifierType: 0,
IdentifierValue: "other.example.net",
RegistrationID: 77,
Status: 1,
Expires: baseExpires,
Challenges: 3,
},
}
out, err := authzModelMapToPB(input)
if err != nil {
t.Fatal(err)
}
for _, el := range out.Authz {
model, ok := input[el.Domain]
if !ok {
t.Errorf("output had element for %q, a hostname not present in input", el.Domain)
}
authzPB := el.Authz
test.AssertEquals(t, authzPB.Id, fmt.Sprintf("%d", model.ID))
test.AssertEquals(t, authzPB.Identifier, model.IdentifierValue)
test.AssertEquals(t, authzPB.RegistrationID, model.RegistrationID)
test.AssertEquals(t, authzPB.Status, uintToStatus[model.Status])
gotTime := time.Unix(0, authzPB.Expires).UTC()
if !model.Expires.Equal(gotTime) {
t.Errorf("Times didn't match. Got %s, expected %s (%d)", gotTime, model.Expires, authzPB.Expires)
}
if len(el.Authz.Challenges) != bits.OnesCount(uint(model.Challenges)) {
t.Errorf("wrong number of challenges for %q: got %d, expected %d", el.Domain,
len(el.Authz.Challenges), bits.OnesCount(uint(model.Challenges)))
}
switch model.Challenges {
case 1:
test.AssertEquals(t, el.Authz.Challenges[0].Type, "http-01")
case 3:
test.AssertEquals(t, el.Authz.Challenges[0].Type, "http-01")
test.AssertEquals(t, el.Authz.Challenges[1].Type, "dns-01")
case 4:
test.AssertEquals(t, el.Authz.Challenges[0].Type, "tls-alpn-01")
}
delete(input, el.Domain)
}
for k := range input {
t.Errorf("hostname %q was not present in output", k)
}
}
func TestGetValidOrderAuthorizations2(t *testing.T) {
sa, fc, cleanup := initSA(t)
defer cleanup()
// Create two new valid authorizations
reg := satest.CreateWorkingRegistration(t, sa)
identA := "a.example.com"
identB := "b.example.com"
expires := fc.Now().Add(time.Hour * 24 * 7).UTC()
authzIDA := createFinalizedAuthorization(t, sa, identA, expires, "valid")
authzIDB := createFinalizedAuthorization(t, sa, identB, expires, "valid")
order, err := sa.NewOrder(context.Background(), &corepb.Order{
RegistrationID: reg.ID,
Expires: fc.Now().Truncate(time.Second).UnixNano(),
Names: []string{"a.example.com", "b.example.com"},
V2Authorizations: []int64{authzIDA, authzIDB},
Status: string(core.StatusPending),
})
test.AssertNotError(t, err, "AddOrder failed")
authzMap, err := sa.GetValidOrderAuthorizations2(
context.Background(),
&sapb.GetValidOrderAuthorizationsRequest{
Id: order.Id,
AcctID: reg.ID,
})
test.AssertNotError(t, err, "sa.GetValidOrderAuthorizations failed")
test.AssertNotNil(t, authzMap, "sa.GetValidOrderAuthorizations result was nil")
test.AssertEquals(t, len(authzMap.Authz), 2)
namesToCheck := map[string]int64{"a.example.com": authzIDA, "b.example.com": authzIDB}
for _, a := range authzMap.Authz {
if fmt.Sprintf("%d", namesToCheck[a.Authz.Identifier]) != a.Authz.Id {
t.Fatalf("incorrect identifier %q with id %s", a.Authz.Identifier, a.Authz.Id)
}
test.AssertEquals(t, a.Authz.Expires, expires.UnixNano())
delete(namesToCheck, a.Authz.Identifier)
}
// Getting the order authorizations for an order that doesn't exist should return nothing
missingID := int64(0xC0FFEEEEEEE)
authzMap, err = sa.GetValidOrderAuthorizations2(
context.Background(),
&sapb.GetValidOrderAuthorizationsRequest{
Id: missingID,
AcctID: reg.ID,
})
test.AssertNotError(t, err, "sa.GetValidOrderAuthorizations failed")
test.AssertEquals(t, len(authzMap.Authz), 0)
// Getting the order authorizations for an order that does exist, but for the
// wrong acct ID should return nothing
wrongAcctID := int64(0xDEADDA7ABA5E)
authzMap, err = sa.GetValidOrderAuthorizations2(
context.Background(),
&sapb.GetValidOrderAuthorizationsRequest{
Id: order.Id,
AcctID: wrongAcctID,
})
test.AssertNotError(t, err, "sa.GetValidOrderAuthorizations failed")
test.AssertEquals(t, len(authzMap.Authz), 0)
}
func TestCountInvalidAuthorizations2(t *testing.T) {
sa, fc, cleanUp := initSA(t)
defer cleanUp()
// Create two authorizations, one pending, one invalid
fc.Add(time.Hour)
reg := satest.CreateWorkingRegistration(t, sa)
ident := "aaa"
expiresA := fc.Now().Add(time.Hour).UTC()
expiresB := fc.Now().Add(time.Hour * 3).UTC()
_ = createFinalizedAuthorization(t, sa, ident, expiresA, "invalid")
_ = createPendingAuthorization(t, sa, ident, expiresB)
earliest, latest := fc.Now().Add(-time.Hour).UTC().UnixNano(), fc.Now().Add(time.Hour*5).UTC().UnixNano()
count, err := sa.CountInvalidAuthorizations2(context.Background(), &sapb.CountInvalidAuthorizationsRequest{
RegistrationID: reg.ID,
Hostname: ident,
Range: &sapb.Range{
Earliest: earliest,
Latest: latest,
},
})
test.AssertNotError(t, err, "sa.CountInvalidAuthorizations2 failed")
test.AssertEquals(t, count.Count, int64(1))
}
func TestGetValidAuthorizations2(t *testing.T) {
sa, fc, cleanUp := initSA(t)
defer cleanUp()
// Create a valid authorization
ident := "aaa"
expires := fc.Now().Add(time.Hour).UTC()
authzID := createFinalizedAuthorization(t, sa, ident, expires, "valid")
now := fc.Now().UTC().UnixNano()
regID := int64(1)
authzs, err := sa.GetValidAuthorizations2(context.Background(), &sapb.GetValidAuthorizationsRequest{
Domains: []string{
"aaa",
"bbb",
},
RegistrationID: regID,
Now: now,
})
test.AssertNotError(t, err, "sa.GetValidAuthorizations2 failed")
test.AssertEquals(t, len(authzs.Authz), 1)
test.AssertEquals(t, authzs.Authz[0].Domain, ident)
test.AssertEquals(t, authzs.Authz[0].Authz.Id, fmt.Sprintf("%d", authzID))
}
func TestGetOrderExpired(t *testing.T) {
sa, fc, cleanUp := initSA(t)
defer cleanUp()
fc.Add(time.Hour * 5)
reg := satest.CreateWorkingRegistration(t, sa)
order, err := sa.NewOrder(context.Background(), &corepb.Order{
RegistrationID: reg.ID,
Expires: fc.Now().Add(-time.Hour).UnixNano(),
Names: []string{"example.com"},
V2Authorizations: []int64{666},
})
test.AssertNotError(t, err, "NewOrder failed")
_, err = sa.GetOrder(context.Background(), &sapb.OrderRequest{
Id: order.Id,
})
test.AssertError(t, err, "GetOrder didn't fail for an expired order")
test.Assert(t, berrors.Is(err, berrors.NotFound), "GetOrder error wasn't of type NotFound")
}
func TestBlockedKey(t *testing.T) {
sa, _, cleanUp := initSA(t)
defer cleanUp()
hashA := make([]byte, 32)
hashA[0] = 1
hashB := make([]byte, 32)
hashB[0] = 2
added := time.Now().UnixNano()
source := "API"
_, err := sa.AddBlockedKey(context.Background(), &sapb.AddBlockedKeyRequest{
KeyHash: hashA,
Added: added,
Source: source,
})
test.AssertNotError(t, err, "AddBlockedKey failed")
_, err = sa.AddBlockedKey(context.Background(), &sapb.AddBlockedKeyRequest{
KeyHash: hashA,
Added: added,
Source: source,
})
test.AssertNotError(t, err, "AddBlockedKey failed with duplicate insert")
comment := "testing comments"
_, err = sa.AddBlockedKey(context.Background(), &sapb.AddBlockedKeyRequest{
KeyHash: hashB,
Added: added,
Source: source,
Comment: comment,
})
test.AssertNotError(t, err, "AddBlockedKey failed")
exists, err := sa.KeyBlocked(context.Background(), &sapb.KeyBlockedRequest{
KeyHash: hashA,
})
test.AssertNotError(t, err, "KeyBlocked failed")
test.Assert(t, exists != nil, "*sapb.Exists is nil")
test.Assert(t, exists.Exists, "KeyBlocked returned false for blocked key")
exists, err = sa.KeyBlocked(context.Background(), &sapb.KeyBlockedRequest{
KeyHash: hashB,
})
test.AssertNotError(t, err, "KeyBlocked failed")
test.Assert(t, exists != nil, "*sapb.Exists is nil")
test.Assert(t, exists.Exists, "KeyBlocked returned false for blocked key")
exists, err = sa.KeyBlocked(context.Background(), &sapb.KeyBlockedRequest{
KeyHash: []byte{5},
})
test.AssertNotError(t, err, "KeyBlocked failed")
test.Assert(t, exists != nil, "*sapb.Exists is nil")
test.Assert(t, !exists.Exists, "KeyBlocked returned true for non-blocked key")
}
func TestAddBlockedKeyUnknownSource(t *testing.T) {
sa, _, cleanUp := initSA(t)
defer cleanUp()
_, err := sa.AddBlockedKey(context.Background(), &sapb.AddBlockedKeyRequest{
KeyHash: []byte{1, 2, 3},
Added: 1,
Source: "heyo",
})
test.AssertError(t, err, "AddBlockedKey didn't fail with unknown source")
test.AssertEquals(t, err.Error(), "unknown source")
}
func TestBlockedKeyRevokedBy(t *testing.T) {
sa, _, cleanUp := initSA(t)
defer cleanUp()
err := features.Set(map[string]bool{"StoreRevokerInfo": true})
test.AssertNotError(t, err, "failed to set features")
defer features.Reset()
_, err = sa.AddBlockedKey(context.Background(), &sapb.AddBlockedKeyRequest{
KeyHash: []byte{1},
Added: 1,
Source: "API",
})
test.AssertNotError(t, err, "AddBlockedKey failed")
_, err = sa.AddBlockedKey(context.Background(), &sapb.AddBlockedKeyRequest{
KeyHash: []byte{2},
Added: 1,
Source: "API",
RevokedBy: 1,
})
test.AssertNotError(t, err, "AddBlockedKey failed")
}
|
Q:
All squares above 6 have an even number of multiples of 10. Why?
I was recently looking at a puzzle in Martin Gardner's book:
Two brothers sell their heard of sheep, and receive the same number of
dollars per sheep, as there were sheep in the heard. They receive the
money in $\$10$ bills, and then the remainder is made up of silver
dollars.
They split the money by alternating taking \$10 bills, and then the
last takes all the silver dollars. The older brother goes first, and
takes the first bill, and the last bill - so the younger brother
complains that he receives less.
The older brother agrees to write him a cheque to cover the
difference. How much is the cheque for?
Now, to get to the solution - as the book says - you know that the total amount of money was $\$n^2$, and that $n^2 - n^2 \mod 10$ is odd. Looking at the squares, you have $1,4,9,16,25,36,49,64,81,100,121,144,\ldots$ . And so the number of sheep has to have been either 4, or 6, and so the cheque must be for $\$2$. But how do I show that all the squares above 6 have an even number of tens?
Pointed out below, were $14^2, 16^2, 24^2, 26^2, \ldots$ - all the squares of numbers ending in 4 or 6. Is there a relationship with these numbers?
A:
All integers are of the form $10n\pm k$, where $0\le k\le5$. Squaring, we have $100n^2\pm20kn+k^2$. For $k^2<10\iff0\le k\le3$, the tens digit is always even. For $k=4$ we have numbers ending in $4$ and $10-4=6$ yielding squares with an odd tens digit, since $4^2={\color{red}1}6$. For $k=5$ we have $k^2={\color{red}2}5$, so the tens digit is again even.
|
London Hamasniks and Interpal
6 March 2009
This is a guest post by habibi
The Palestinian Return Centre (PRC) is a London-based group dedicated to the return of Palestinian refugees to their families’ old homes in Israel.
As such, it is no friend of peace. Everyone who has followed the negotiations over the years knows that this is a deep red line for Israel. Just as it would be for any Muslim countries asked to compensate Jewish families expelled in the past for their losses, or to grant Jews return to their old homes, should any be so bold as to do so.
Nor will Israel be defeated on any battlefield at home any time in the foreseeable future.
In other words, the PRC’s position amounts to a guarantee of decades of frustration, anger and strife.
So it is hardly surprising to learn that the PRC was established in the 1990s by Abu Sitta, a Palestinian exile, to raise opposition to the Oslo peace process. Nor to see that Mr Sitta frequently uses “Israelis are Nazis” rhetoric fit only for racist haters. As for the Geneva Accord, he dismisses it as the work of Mossad.
The PRC remains on message: it is very keen on Hamas. In the picture below, in November 2008 PRC director Majed Al Zeer (left) shares a platform in Damascus with Khaled Mishaal (right), a top Hamas hardliner. The man to Meshaal’s right is former Malaysian leader and notorious anti-Semite Mahathir Mohamad. The man to al Zeer’s left is Ali Akbar Mohtashami-Pur, an Iranian cleric and former diplomat and minister who played a key role in the build-up of Hezbollah.
The Congress reaffirms the need to popularize the culture of resistance and its practice as the option of resistance is the best and shortest way to realize the return of the refugees to their homes. It calls for the safeguarding of this option and its fortification on the national, patriotic, Islamic and international fronts.
…
They reaffirm their support for the national, patriotic and liberation stand of Syria and the steadfastness of its people under the leadership of Dr Bashar Al Asad in the face of all forms harassment, threats and aggression the last of which was the abhorrent American attack on Syrian territory.
…
They regard support for the Iraqi resistance and safeguarding of the unity and Arab identity of Iraq an important step toward the restoration of the Palestinian people of their land and rights.
…
The participants in the Arab International Congress for the right of return convinced of the longstanding and current danger of the Zionist role in the plots to dismember Sudan and undermine its national unity, Arab, African and Islamic identity and halt its role as a bridge between the Arab ummah and its strategic and civilizational depth in Africa declare their firm support for the people of Sudan in their struggle against all forms of colonial intervention, dubious internationalization and provocative initiatives.
This was hardly the first time the PRC associated itself so closely with terrorists. In 2007, it hoped to invite Hamas leader Ismail Haniyeh to a conference in Rotterdam. The Dutch authorities refused to issue a visa to Haniyeh. So another Hamas minister was dispatched. He managed to get a visa but was stopped at the airport in Brussels and turned back when the Dutch realised they had made a mistake and alerted the Belgians. For the PRC’s Al Zeer, refusing entry to a member of a proscribed terrorist group was nothing less than a “humiliation of the Palestinian people”.
In 2006, Sweden was more Hamas-friendly than the Netherlands: it allowed another Hamas minister to attend a PRC conference.
Earlier in 2006, a PRC conference in London was addressed by Ismail Haniyeh via an audio link. Other extremists involved in this event included fugitive Hamas commander Muhammed Sawalha and journalist Abdel Bari Atwan, who has said he would “go to Trafalgar Square and dance with delight” if Iran launched a nuclear attack on Israel.
An audio link was also used to allow Ismail Haniyeh to address a PRC-backed conference in Copenhagen in 2008. At that conference, Al Zeer was in fine form:
“the resistance of the Palestinian people has surpassed the bounds of time and it is this resistance which will bring about an honorable future that the mothers of the martyrs, wives of prisoners and heroic children under bombardment all deserve”
Who might like to work with extremists such as Majed al Zeer? Among others, some employees of the Hamas-linked charity Interpal, that’s who. As mentioned earlier, one of the trustees of the PRC is Ghassan Faour. He is also a trustee of Interpal. Another PRC trustee is Majdi Akeel. He works for Interpal.
Amazingly, the Charity Commission’s new report on Interpal does not even mention the charity’s links to the PRC. This is a serious failure when the Commission was so officially alarmed by Interpal’s close relationship with another set of extremists, the charity grouping “Union for Good”, that it demanded Interpal and its trustee Essam Mustafa cut their links with the Union.
By the way, Majdi Akeel’s links to extremists are nothing new. In the Holy Land Foundation case in the USA, his name appeared in two court exhibits.
The first is an entry for him in the address book of top Hamas man Mousa Abu Marzook, which was confiscated when Marzook was arrested in New York in 1995. Marzook has played an important role in fund-raising for Hamas.
The second is the transcript of an intercepted telephone conversation in 1994 between Haitham Maghawri, a former director of the Holy Land Foundation who has been found guilty in absentia of providing material support to Hamas, and Muin Shabib, a Hamas operative mentioned in the BBC Panorama programme about Interpal. The wording of the conversation is somewhat cryptic, but it seems fairly clear that Maghawri was supporting a visa application of Akeel (one of the “brothers”), presumably to a US embassy for a visit to the USA, where Akeel would help Maghawri advance radical causes they shared.
I’d say Mr Akeel has been pretty lucky in his career, overall, as has Mr Faour, and Interpal too. I hope they have written nice thank you letters to all the UK politicians and officials who have helped make this possible. |
Bob Wolff Shares His Audio Archive
Bob Wolff, whose 74-year career is the longest in sports broadcasting history, has donated about 1,400 audio and video recordings, consisting of well more than 1,000 hours, to the Library of Congress. Below are six excerpts from his interviews with some of the best-known players in baseball history. |
"Harry Potter and the Order of the Phoenix" "It's just too hot today isn't it?" "And it's going to get even worse." "temperatures up in the mid 30s Celsius." "And at night should go up even, and perhaps..." "Alright, lets go home." "What a lovely day." "Do we have to?" "We do." "Hey big D. Beat up another 10 year old?" "This one deserved it." " Ya." " Ya." "5 against 1, very brave." "Well you're the one to talk?" "moaning in your sleep every night." "At least I'm not afraid of my pillow." "Don't kill Cedric." "Who's Cedric?" "Your boyfriend?" "Shut up." "He's going to kill me, mom." "Where is your mom?" "Where is your mom, Potter?" "Is she dead?" "Is she dead..." "What's going on?" "What's going on here?" "What are you doing?" "I'm not doing anything." "Dudley, come on!" "Run!" "Dudley, run!" "Expecto Patronum!" "Mrs. Figg." "Don't Put away your wand, Harry." "They might come back." "Dementors in little Winchik." "What's next?" "Whole world's in top sterny." "I don't understand." "How did you know..." "Dumbledore asked me to keep an eye on you." "Dumbledore?" "You know Dumbledore?" "After You-Know-Who killed that poor Diggory boy last year." "Did you expect him to let you go wandering around alone?" "Good Lord, they told me you're intelligent." "Now, get inside and stay there." "Soon someone will be in touch with you." "Whatever happens, don't leave the house." "Didlykin, is that you?" "Dudley!" "Vernon come quick!" "Who did this to you boy?" "Happy, are we, now?" "You finally done it." "You finally driven him loopey." "Vernon, don't you say that." "Just look at him, Petunia." "Our boy has gone yumpie." "I've reach my limit, you hear?" "This is the last I'm gonna take you and your losses." "Dear Mr. Potter" "The Ministry has received intelligence." "That at 6:23 this evening..." "You performed the Petronas Charm in the presence of a muggle." "As a clear violation of the decree... for the reasonable restriction of Underage Sorcery, you are hereby expelled from Hogwarts School of Witchcraf and Wizardry." "Hope that you are well, Mafilda Hopkerk." "Justice." "Sorry, Hedwig." "Hygienist, these muggles." "Tonks, for God's sake." "Professor Moody, what're you doing here?" "To rescue you of course." "Where are we going?" "That I'm just expelled from school." "You haven't been Not yet." "Kingsley, you take front." "But the letter said..." "Dumbledore has persuaded the Minister to suspend your expeltion pending for your formal hearing." "A hearing?" "Don't worry, Harry." "We'll explain everything when we get back to headquarters." "Shh, not here, Nymphadora." "Don't call me Nymphadora." "Stay in formation everyone." "Don't break ranks if one of us was killed." "Come on." "Here you go, son." "Yes, but..." "He grew stronger by the minute." "We have to act now." "Harry." "Mrs. Weasley." "Thank God, you're alright." "Bit peaky." "I'm afraid, dinner, we're gonna have to wait after the meeting finish." "Look." "No time to explain." "Straight upstairs." "First door on the left." "Yeah." "Harry." "You alright?" "We've heard them talking about the Dementors attack." "You must tell us everything." "Let him breath, Hermione." "And this hearing at the Ministry, it's just outrageous." "They can't expel you." "It's completely unfair." "Yeah." "There's a lot going around me." "So what is this place?" "It's headquarters." "The Order of The Phoenix." "It's a secret society." "Dumbledore formed it back in the first, You-Know-Who." "You couldn't write any of this in your letter l suppose?" "Whole summer without a scrap of news." "We thought to write, really, I did." "Only..." "Only What?" "Dumbledore made us swear not to tell you anything." "Dumbledore said that?" "But why he want to keep me in the dark?" "Maybe I can help." "Afterall, I'm the one who saw Voldermort returned." "I'm the one he fought with." "I'm the one who saw Cedric Diggory get killed." "Harry." "Don't be so uptight." "Let it out." "Anyway, we heard the chatting." "Only had something more interesting." "Harry has the right to know." "If it wasn't him, no one know he's back." "He's hardly a child, Molly." "But not an adult either." "He's not James, Sirius." "He's not your son." "He's as good as it." "No one else he's got." "He's got me." "Potter will grow up into a criminal." "Just like his Godfather." "Stay out of this, Severus." "Why don't you tell him?" "Hermione, I hate your cat." "We'll be eating down in the kitchen." "Just because you're allowed to use magic now, does not mean you have to whip your wands out for everything." "Hi, mom." "You hungry, Harry?" "You sure you're alright, Harry?" "Harry Potter." "Sirius." "It is very very peculiar... lt seems that your hearing at the Ministry... is to be before the entire Withem." "I don't understand why is the Ministry of Magic go against me." "Show him." "He'd find out soon enough." ""The Boy Who Lies?"" "He's been attacking Dumbledore as well." ""Fudge:" "All ls Well"" "Fudge is using all his power." "including his influence at the Daily Prophet." "Smear anyone who claims the Dark Lord has returned." "Why?" "The Minister thinks Dumbledore's after his job." "But that's insane." "No one in the right mind would believe that Dumbledore..." "Exactly the point." "Fudge isn't in his right mind." "He's been twisted and walked by fear." "Now, fear makes people do a lot of things." "The last time Voldermort gain power..." "He almost destroyed everything we hold on stand." "Now he has returned, I'm afraid the Minister will do almost anything... to avoid facing the terrifying truth." "We think Voldermort wants to build up his army again." "14 years ago he had huge armies in his command." "Not just witches to wizards" "But a lot of dark creatures." "He's been recruiting, we've been attempted to do the same." "But gathering followers isn't the only thing he's interested." "We believe Voldermort may be after something." "Sirius." "Something he didn't have last time." "You mean, like a weapon?" "No, that's enough." "He's just a boy!" "You say much more, you might as well inducting him to the Order straight away." "Good. I want to join." "If Voldermort's recruiting the army then I want to fight." "Harry." "You are hereby expelled." "Before the whole Withom." "The trains." "Underground." "Genius these muggles." "Here we are." "I've never use this entrance before." "It should be fun." "I'll just get my money." ""Dumbledore" " Deaf or Dangerous?"" "Good morning, Arthur." "Morning, Bob." "Inter Department Memos." "Used to use owls." "The mess is unbelievable!" "Merlin's Beard Thank you, Kingsley." "They changed the time of your hearing." "When is it?" "In 5 minutes!" "Remember, during the hearing speak calmly if you are spoken too" "Keep calm" "You've done nothing wrong!" "As the muggle say "Truth will out!"" "Yes?" "I'm not allow in, I;m afraid." "Good luck, Harry." "Diciplinary Hearing of 12th August, into offences commited by Harry James Potter... resident at no.4, Privet drive, Winshik, solicitor Cornelius Fudge..." "Minister..." "Witness for Defense." "Albus Percivel Wilfred..." "Brown Dumbledore." "You got our message that the time and place... of the hearing has been changed, did you?" "I must have missed it." "But by mistake, I arrived at the Ministry 3 hours early." "Charges?" "The charges against the accused are as follows... that he did knowingly, and in full aware this legality of his action... produce of the Petronas Charm in the presence of a muggle." "Do you deny producing said Petronus?" "No, but..." "And you were aware that you're forbidden from using magic... outside school while under the age of 17?" "Yes, of course, but..." "Witches and wizards of the Wizengemot.." "I was only doing it because of the Dementors." "Dementors?" "In Little Winchik?" "That's very clever." "Muggles can't see Dementors, can't they, boy?" "Highly convenient I'm not lying." "There were 2 of them." "If I hadn't..." "Enough!" "I'm sorry to interrupt what have showed in a very well rehearse story." "But since you can't produce no witnesses of the event..." "Pardon me, Minister." "Where as it happens, we can." "Please describe the attack." "What did they look like?" "One of them was very large, and the other one was skinny." "Not the boys." "The Dementors." "Alright, alright... oh well em..." "Big." "Cloak." "Then... everything went cold." "Like all of the happiness had gone from the world." "Now, look here." "Dementors don't just wander into a muggle suburban." "Happen to cross with a wizard." "The odds are ternomecule." "I don't think anyone would've believe... that the Dementors were there by coincidence, minister." "I'm sure I must've misunderstood you, professor" "Dementors are, after all, under the control of Ministry of Magics." "So silly but it sounded, for moment as though, you're suggesting that the Ministry had ordered the attack on this boy." "That would be disturbing indeed, Madam Under-Secretary." "Which is why I'm sure the Ministry will be mounting a full scale enquiry... into why the 2 Dementors were surveiling very far from Azkaban... and why they attack without the authorization?" "Of course there is someone who might be behind the attack." "Cornelius, I employ you to see reason." "The evidence the Dark Lord have returned is incontrovertible." "He's not back!" "In the matter of Harry Potter" "The Law say in this states, that magic may be used before muggles in life threatening situation." "Laws can be changed if necessary, Dumbledore." "Really?" "It is become a practive to hold a full criminal trial... to deal with a simple matter of Underage Magic?" "Those, in favor of conviction." "Those in favor of clearing the accuse of all charges." "Clear the whole charges." "Professor!" "Padfoot, are you barking mad?" "You'll blow the entire operation!" "Sirius, what are you doing here?" "If someone sees you... I had to see you off tonight." "What's life without a little risk?" "I don't want to see you get trapped back into Azkaban." "Don't worry about me." "Anyway, I wanted you to have this." "Orginal Order of the Phoenix." "Marlene McKenine." "She was killed 2 weeks after this was taken." "Voldermort wiped out her entire family." "Franklin and Ellis Longbottom." "Neville's parents." "They suffered a foughtless death." "It's been 14 years." "There isn't a day goes by I don't miss your dad." "Do you really think there's gonna be a war, Sirius?" "It feels like it did before." "You keep it." "Anyway, I suppose you're the young ones now." "Bye... I surprise the Ministry still let you walk out free, Potter." "You better enjoy while you can." "Or else a cell in Azkaban will have your name on it." "What I tell you He's a complete nutter" "You stay away from me!" "It's only Malfoy Just relax." "Hi guys." "Hi, Neville." "What is it?" "What's what?" "That." "Pulling the carriage." "Nothing's pulling the carriage, Harry." "It's pulling itself, like always." "You are not going mad... I can see them too." "You're just the sane as I am." "Everyone, this is Loneylov..." "Luna Lovegood." "Interesting necklace." "It's a charm actually." "Keeps away the Naragos." "I'm hungry. I hope there's a pudding." "What's a Naragos?" "No idea." "Good evening, children." "Now we have 2 changes in staff this year." "Please welcome back Professor Grubbly-Plank." "Who'd be taking care of magical creatures, while Professor Hagrid is on temporary leaves." "We're also pleased to welcome our new Defense Against Dark Arts teacher," "Professor Dolores Umbridge." "I'm sure you all will join me in wishing the professor good luck." "As usual our care taker Mr. Filch has ask me to remind you..." "She was at my hearing." "She works for Fudge." "Thank you, headmaster for those kind words of welcome." "And how lovely to see all your bright, happy faces... smiling up to me." "I'm sure we'll all going to be very good friends." "That's likely." "That's likely." "The Ministry of Magic, has always considered... the education of young witches and wizards... to be a vital importance." "Although each headmaster has brought something new... to this historic school." "Progress for the sake of progress must be discourage." "Let us preserve what must be preserved." "Perfect what can't be perfected..." "And proove actism, in order to beat pro-imitate." "Thank you, Professor Umbridge." "That really was constant minimizing." "Minimizing?" "What?" "What does it mean?" "It means the Ministry interfering Hogwarts." "Dean, Seamus, good holiday?" "Alright, better than Seamus' actually." "My mom didn't want me to come back this year." "Why not?" "Let me see, because of you." "The Daily Prophet has been saying a lot of things about you, Harry." "And about Dumbledore as well!" "Your mom believes them?" "Well, nobody was there the night Cedric died." "Well, I guess you should read the Prophet like your stupid mother." "It'll tell you everything you need to know." "Don't you dare tell me." "I'll never let go anyone that calls me a liar." "What's going on?" "He is what's going on." "Do you believe the words he commended, you or him?" "Yeah, I do." "Does anyone else got a problem with Harry?" "You alright?" "Fine." "Seamus was backout there." "He'll go through it." "We'll see." "I said I'm fine, Ron." "Alright. I just leave you to your thought, huh?" "Come on, Seamus, go on, get it" "Good morning, children" "Ordinary Wizarding Level Examinations" "OWLS" "Well, commonly known as..." "OWLS" "Study hard and you'll be awarded" "Failed to do so, and the consequences maybe...severe" "Your previous instruction subjects have been disturbingly uneven" "But please to know from now on..." "You'll be following a carefully structured" "Ministry approved course of defensive magic" "Yes?" "..there isn't something about using the defensive spells" "Using spells?" "Why would you need spells in my classroom?" "We aren't using magics" "You'll be learning about defensive spells in a secure, risks-free way" "What use is that?" "We're gonna be attacked, it won't be risks-free" "Students will raise their hands when speak in my class lt's the view of the ministry" "That a theoretical knowledge'll be sufficient..." "To get you thru your examinations, which after all... ls what schools are all about" "And how's theories supposed to prepare us for out there?" "There's nothing out there, dear" "Who do you imagine'd attack children like yourselves?" "I don't know, maybe Lord Voldermort" "Now let me make this quite plain" "You've been told..." "That a certain dark wizard is at large once again" "This is a lie!" "It's not lie, i saw him, I fought.." "Detention, Mr Potter" "So, according to your say, Diggory dropped of his own?" "Cedric Diggory's death was a tragic accident" "He was murdered, Voldermort killed him, you must know that" "Enough...enough!" "See me later, Mr Potter...my office" "Come in" "Good evening, Mr Potter" "Sit" "You're gonna be doing some lines for me today, Mr Potter" "No, not with your quill" "Cause you're gonna be using a rather special 1 of mine" "Now, I want you to write" "I must not tell lies!" "How many times?" "Lets say, as long it take the message to sink you" "You haven't given me any ink" "You won't need any inks" "Yes?" "Nothing" "That's rite" "Because you know deep down" "You deserved to be punished" "Don't you, Mr Potter?" "Go on" "Skiving snack box" "Sweets'll make you ill lt'll get you outta class" "Let's take hours of pleasures outta school boredom" "You care for another?" "I'm not asking you to write all of it for me" "Oh please l'm just busy studying this stupid owls exams I'll do the introductions That's all!" "Hermione, you're the most wonderful person i've ever known I'll never be rude to you again" "Only I bet you will" "What's wrong with your hand?" "Nothing" "The other hand" "You've gotta tell Dumbledore" "No, Dumbledore's got enough in his mind rite now" "Anyway i want to get Umbridge's her satisfaction" "Bloody hell she was torturing you lf your parents know about this..." "Yeah, i haven't got any parents, have I?" "Harry, you've gotta report this" "It's perfectly simple...." "No!" "It's not..." "Hermoine, what ever this is;" "It's not simple" "You don't understand!" "Then help us to..." "Dear Padfoot, i hope you're alrite lt's getting cooler here" "Winter's definitely on the way" "Despite i've been back to Hogwarts, i feel more alone than ever I know you but all people will understand" "Hello Harry Potter" "Your feet, aren't you cold?" "A bit" "Unfortunately all my shoes are mysteriously disappeared" "I suspect nigel are behind this" "What are they?" "The Carl Pastro" "They're gentle really, but..." "People avoid them because, they've been..." "Different" "Why can't the other see?" "They can only been by people who's seen death" "So you know someone who's gone?" "My mum" "She was quiet an extraordinary witch" "She did a lot of experiments though" "One day 1 of her spells went badly wrong I was 9 I'm sorry lt was rather horrible I do feel very sad about it sometimes" "But i've a dad" "My dad and I believe you by the way" "And he must not be named's back" "And you fought him" "And the Ministry extremely tough for that conspiring you and Dumbledore" "Thanks, seems that you're the only who do I don't think that's true" "I supposed that is how you wanted it to be." "What do you mean?" "If i were You Know Who!" "I don't want you to feel crowd from anyone else" "Because if it's just you alone..." "you aren't much as a threat" "Would you ever stop eating?" "I'm hungry" "Harry" "Can i join you?" "Prof, what exactly are you insinuating?" "I am only requesting when it come to my students" "You conformed to prescribe disciplinary practices" "Seems silly of me but it sounds" "That you're questioning my authority in my own classroom" "Minerva" "Not at all, Dolores" "Merely your medieval methods I'm sorry, dear" "But to question my practices is to question the ministry" "And by extension, the minister himself I'm a tolerant woman" "But the 1 thing i won't stand for is disloyalty" "Disloyalty" "Things at Hogwarts are far worse than i feared" "Cornelius will want to take immediate actions" "What happened to Dumbledore?" "Umbridge revolutionised the teaching of defence against the dark art" "Doleres Umbridge will as High Inquisitor have powers" "To adjust the seriously falling standards of Hogwarts school" "Just 1 question" "You've been in this post for how long exactly?" "You ask first for the Defend Againts the Dark Art Teacher ls that correct?" "Yes" "But you were unsuccessful" "Obviously" "Would you please predict something, please?" "I'm sorry" "One tiny little propecy" "Pity" "No, wait...i think 1 do see something, yes I saw something dark" "You're in a grave danger" "Lovely..." "Cho, what's going on?" "It's professor, Trelawney" "16 years i've been here to teach" "Hogwarts is my home" "You can't do this" "Actually i can" "Minerva" "Something you'd like to say, dear?" "Oh there're several things i'd like to say" "Prof McGonagall" "May i ask you to escort Sybil back inside?" "Sybil, come here" "Thank you, Dumbledore" "Dumbledore, may i remind you" "Under the tone of educational decree #23 as it acted by the minister" "You've the right to dismiss my teacher" "But you don't have the authority to banish them from the garden" "That power remained for the headmaster" "For now" "Don't you have studying to do?" "Professor?" "Professor?" "Professor Dumbledore?" "Professor?" "Professor Dumbledore?" "Foul evil Gargoyle!" "We aren't learning how to defend ourselves" "We aren't learning how to pass our OWLS" "She's taking over the entire school" "Security's and will remain the ministry's top priority" "Furthermore, we've convincing evidence" "That these disappearances are the work of..." "The notorious mass murderer, Sirius Black...." "Harry" "Sirius" "What are you doing here?" "Answering you your letter" "You said you're worried about Umbridge" "What's she doing?" "Training you to kill the half-bred?" "She isn't letting us to use magic at all I'm not surprised" "The latest intelligence says that Fudge doesn't want you to train in combat" "Combat?" "He afraid we're forming some sorta wizard army?" "This's exactly what he thinks" "That Dumbledore is assembling his own forces to take on the ministry" "He's becoming more crack on the edge" "The others wouldn't want me to tell you this, Harry" "Things aren't going all well, the order" "Fudge's blocking the truth in every turn" "These disappearances as much how it started before" "Voldermort is on the move" "What do we do?" "Someone is coming, i'm sorry i can't be more help" "But for now, it looks like you're on your own" "He's out there isn't he?" "We've gotta be able to defend ourselves lf Umbridge refuses to teach us how we need someone who'll" "Harry" "This is mad, who want to be tough by me?" "I'm a nut, remember?" "Look at the bright side." "You can't be any worse than her, anyway" "Thanks, Ron" "Anything, mate" "Who supposed to make this?" "Just a couple of people" "Lovely spot." "Well, at least safer than being tracked" "Hey come back here" "Hi, So..." "We know why we're here" "We need a teacher" "Proper teacher" "One has really experienced to defend himself against the dark arts" "Why?" "Why?" "Because you know who's back you toadpole" "So as "HE" says" "So as Dumbledore says" "So Dumbledore says because He says?" "The point is where's the proof?" "Perhaps Harry could tell us more about Diggory got killed I'm not gonna talk about Cedric" "If that is why you're here, you might as well clear up now" "Come on Hermione, let's go, these are some sorts freaks ls that true you can produce petronus charm?" "Yes I've seen it" "Blimey Harry, I don't know you can do that?" "He killed a Basilisk..." "With a sword in Dumbledore's office lt's true" "Third year he fought about 100 dementor to 1" "And last year he really did fight who went to flash" "Wait" "Those sound great when you say it like that, but... ln fact, i was just lucky l didn't know what i was doing half of the time I nearly always had helped" "He's just being modest" "No, Hermione, i'm not" "Facing these stuff in real life isn't like in school lt isn't like you made a mistake you can try just try again tomorrow" "But out there" "When you're a second away from being murdered" "Or watching a friend die right before your eyes" "You don't know how it's like" "You're right, Harry, we don't" "That's why we need your help" "Because the one we try of beating..." "Voldermort" "He's really back?" ""Dumbledore Army"" "1st we need to find a place where Umbridge won't find out" "The shrinking shack?" "That's too small" "Forbidden forest?" "Too bloody horrible" "Harry, what happened if Umbridge does find out?" "Who cares?" "I mean...it"s exciting, isn't it?" "Breaking the rules" "Who are you and what have you done to Hermoine Granger?" "Anyway, at least we knew that is 1 positive thing that is coming in today..." "What's that?" "For the next few days we should... each come out for a couple of place we can use for practise" "We gotta make sure Umbridge won't find out this place" "All student organisations disbanded" "Watch where you're going Longbottom" "You've done it Neville!" "You have found the room of requirement" "What?" "This's also called come-and-go-room" "The room only appears when a person's immediate needs and it always equips with what the person needs" "So, you really needed a toilet?" "Charming really lt's great" "Just like Hogwarts wants to fight back" ""Expeliarmus"" "I'm hopeless" "You're just flourishing your wand too much, try like this" ""Expeliarmus"" "Would you please copy your whole text 4 times" "To ensure maximum attention" "You don't need to talk I think it's more like it" "Wands, away!" "Stuning is the most useful spell in arsenal.." "It's sorta a wizard fighting a battle really" "Come on, Nigel, give your best shot" "Stupify" "Good, not bad...at all" "Don't worry about, Hermione, I'll go easy" "Thanks, Ron" "Go on, Ron... 1 second You're on!" ""Stupify"" "Thank you" "Shut up I let her do that" "It's embarassing lt's really my intention" ""All students will submit to questioning"" "Come on, do you want a cup of tea?" "Focus on the fixed point, try again" ""Expeliarmus"" "You need to keep your concentration..." "Great" "Aim Higher" "I'm ok..." "Working hard is important, there's something about this even more..." "Believing in yourself" "Think of this, every great wizard in history" "Started out..." "Nothing more than what we're now..." "students lf they can do it, why not us?" ""Expeliarumus"" "Fantastic, well done, mate" "So, that's it for this lesson" "We aren't gonna be meeting again until after the holidays" "So just keep practising on your own best you can" "And well done, everyone, great great work" "Well done mate." "Thanks" "See you after Christmas" "See you in the common room Harry" "Thanks a lot, Harry" "Merry Christmas" "Harry Merry Christmas" "Have a merry christmas, Luna" "We've been thinking, Harry" "Sounds great, guys, would you excuse me?" "Are you alrite?" "I heard Umbridge gave you a hard time the other day" "Yeah, i'm ok lt's worth it" "Just..." "learning all these" "Made me wonder maybe he would..." "Cedric...gave me all these stuff" "He was really good lt was just Voldermort was better" "You're a really good teacher, Harry I've never been able to stunt anything before" "Mistletoe" "It keeps the Naragos out" "What are Naragos?" "I've no idea" "Well, how was it?" "Wet I mean she was sorta crying" "Not that bad, are you?" "I'm sure Harry's kising's more than satisfactory" "Cho's been half of the time crying these days I bet snogging will cheer her up" "You don't know how she must be feeling?" "Obviously she feel sad about Cedric and now got more confused now with Harry guilty about kissing him" "and she worry about everything else" "One person can fill all that..." "They'll explode" "It's because you've got an emotional range of tea spoon!" ""Voldermort maybe after something!"" ""Something he didn't have last time!"" ""Harry"" ""Harry!"" "In the dream, were you standing next to the victim?" "or looking down at the scene?" "Neither..." "It was like I'm who..." "Professor would you please tell me what happening..." "Everard, Arthur on guard at night" "Make sure he is found by the right people." "Sir...." "Phileus,you must go to your potrait in the Grimould Place tell them Arthur Weasly is gravely injured and his children will be arriving there soon by portkey" "They got it Albus..." "It was close but they got in" "What's more the Dark Lord failed to acquired..." "Ah, thank you.." "Look at me!" "What's happening to me?" "You wish to see me headmaster?" "Oh Severus, I am very can't wait!" "Not even in the morning!" "Otherwise we will be vulnerable!" "Its appear that there is a connection between the Dark Lord minds and your own" "Weather he is as yet aware of this connection is not clear" "Pray he remains ignorant" "You mean if he knows about it," "He'll be able to read my mind." "Read it, controll it... and injured." "In the past it was often the Dark Lord pleasure to invade the minds of his victims creating visions" "design to torture them to madness... only after extracting the last exquisit answer of agony" "Only when they had literally begging for death he finally kill them" "Use properly the power of Occlumency will help shield you from access or influence" "In this lesson i will attemp to penetrate your mind" "You will attemp to resist" "Prepare yourself!" "Concentrate POTTER..." "Here we go..." "Daddy's back" "Sit down, everybody, sit down, now's time for presents" |
Primary Navigation
The Sandbox Post
Single Post Permalink
This is a well done example, I hope you don't mind if my students post some questions to you? I am an adjunct instructor in game design at CSU Fullerton (Cal State), and this fits in with the class exactly.
I'm glad you can use it in your class. I'm happy to try to answer any questions your class may have, as long as it doesn't involve math Math is hard! I simply implemented Stefan algorithm as he describes in his thesis. I don't really understand it all.
But if you've got any question about the source code, I'll be happy to try
Oh, and stay tune for an update to this sample. For better "explorability" |
Selahattin Torkal
Selahattin Torkal (1925 – 16 November 2010) was a Turkish footballer. He competed in the men's tournament at the 1948 Summer Olympics.
References
Category:1925 births
Category:2010 deaths
Category:Turkish footballers
Category:Turkey international footballers
Category:Olympic footballers of Turkey
Category:Footballers at the 1948 Summer Olympics
Category:Sportspeople from Istanbul
Category:Association footballers not categorized by position |
Taiwan Jones (linebacker)
Taiwan Markis Jones (born December 1, 1993) is an American football linebacker for the Los Angeles Wildcats of the XFL. He played college football at Michigan State. Jones signed with the New York Jets as an undrafted free agent in 2015.
Early years
Jones attended Anchor Bay High School in Michigan. Jones was ranked as the 30th best linebacker by Rivals.com and was ranked the 57th ranked linebacker by Scout.com. Jones was selected to the PrepStar's All-Midwest Team. Jones was named to the all-state Division 1-2 first-team by The Detroit News and Associated Press. He was named to the all-county and all-conference teams in his senior season and also was named the Macomb Area Conference Blue Division MVP also in his Senior season. Jones was a utility player at high school where he played at running back, wide receiver and quarterback. Jones recorded 46 tackles and three interceptions in his 2010 season. Jones also played for the Anchor Bay basketball team in which he was a three-year starter. Jones was named an Associated Press Class A All-State honorable mention for the 2010-11 basketball season. He also named to the Detroit Free Press All-East Team in his senior season.
Professional career
According to NFLDraftScout.com, Jones was projected to go in the fifth round in the 2015 NFL Draft and his NFL comparisons were to NFL Linebacker Brandon Spikes and current Cincinnati Bengals linebacker Nico Johnson.
In May 2015, Jones signed with the New York Jets as an undrafted free agent following the conclusion of the 2015 NFL Draft. On December 18, 2015, he was promoted to the active roster.
On September 3, 2016, he was released by the Jets as part of final roster cuts. He was re-signed by the Jets on October 26, 2016. He was released again by the Jets on November 22, 2016.
On April 1, 2019, Jones signed a contract to play with the Memphis Express of the Alliance of American Football, only to learn of the league's suspension of operations the following day.
In October 2019, Jones was selected by the Los Angeles Wildcats in the 2020 XFL Draft's open phase.
References
External links
Michigan State bio
New York Jets bio
Category:1993 births
Category:Living people
Category:African-American players of American football
Category:American football linebackers
Category:People from New Baltimore, Michigan
Category:Players of American football from Michigan
Category:Michigan State Spartans football players
Category:New York Jets players
Category:Memphis Express (American football) players
Category:Los Angeles Wildcats (XFL) players |
Now Playing
11/20/2018 7:44PM
How to Read Trump's Statement on Khashoggi Killing
In a statement Tuesday, President Trump signaled that he plans to stand beside Saudi Arabia after the death of journalist Jamal Khashoggi. But as WSJ's Gerald F. Seib explains, it won't be that simple. Photo: Getty |
Features
Categories
Where next for local government transformation?
Feature: Technology
Georgina Maratheftis, programme manager for local government at techUK, looks at how councils are embracing digital devolution to deliver more efficient services
A well-rehearsed narrative for local government is that it is increasingly fragmented and hard to navigate. While this is true, local government is unique in the number of lines of business it operates - from zoo licenses to local planning to waste collection. Managing demand and rising expectations at a continued time of financial constraints is no easy feat and, as such, councils are embracing digital technology as an enabler to do things differently and to deliver more efficient, improved services.
It has been a year of firsts for local government transformation: the advent of the metro mayors in May; the appointment of the first London Chief Digital Officer; and the first Chief Digital Officer in the Department for Communities and Local Government. It hasn’t stopped there – we’ve had the Secretary of State for Local Government acknowledge the potential of tech to transform public service outcomes and call for digital leadership across the council in his speech at the Urban Tech Summit.
Placed-based approach becoming the norm
As councils grapple with continued financial constraints and the onset of devolution, there is a need for greater cross-public service and council working. The focus on place-based approach is not a new one but now, with the advent of devolution, there are the mechanisms in place to deliver place-based transformation.
A number of the metro mayors have made encouraging commitments towards digital devolution, a move which techUK called for in its Digital Devolution: A Guide for Mayors. Digital is instinctively designed to assist collaboration and, by putting digital at the forefront of city region plans, mayors can reshape and integrate services, creating better places to live and driving regional growth. The mayors can be the figureheads and champions that can improve coordination by convening stakeholders across the city-region to accelerate the pace of transformation.
Digital devolution and future service delivery
Both Andy Burnham, Greater Manchester Mayor, and Andy Street, West Midlands Mayor, outlined their digital ambitions for the city region early on in their tenure, seeing the enabling role it can play in transforming service outcomes whilst creating smarter places where citizens want to live, work and thrive. Most recently, Andy Street set out the West Midlands Combined Authorities Urban Challenge asking how technology can solve local public service problems, which include well-being, homelessness, youth unemployment and digital citizenship.
Furthermore, the West Midlands second devolution deal paves the way for future deals to commit digital capability at the heart of them, something which techUK has called for. The West Midlands will have a regional Office for Data Analytics under its new devolution deal, accompanied by plans for a Digital Capability Framework and a new technology hub.
As the landscape for local government is changing, from funding to models of working, there is a growing recognition that councils can’t continue to ‘salami slice’ but instead rethink what services will be delivered in future and how. We are seeing councils, such as Aylesbury Vale, adopt a more commercially-orientated business model with greater self-service functions for users, reimagining the future public service delivery and outcomes. All this is only possible because these councils have the leadership in place to drive the vision as well as the digital innovation.
Digital leadership
Before we look at the technologies revolutionising public service outcomes we can’t forget that a key component in creating the environment to enable successful transformation is leadership and culture. Having the leadership in place that recognises how council services can be transformed by new technologies is pivotal. Without the buy-in from the top, the digital ambition can fall by the wayside.
At techUK’s flagship public sector conference this year, PS2030, the local government panel explored the ‘art of the possible’ is for local government in 2030. One of the key points raised was the phrase ‘digital leadership’ will be redundant by that time as there will be a ‘digital mindset’ across the organisation with leaders having the clarity and vision of what tech can do to enable successful transformation. We will also see Chief Digital and Information Officers supporting multiple regions, not just a single council. This is already happening in some areas - Leeds and London have appointed Chief Digital Officers.
The Secretary of State in Local Government, Sajid Javid, summed it up well at the West Midland Urban Tech Summit when he said: “We need the right leadership, with the right attitude. An understanding and embracing of digital is no longer something that can be safely left to a local authority’s IT department. It doesn’t belong in the basement, it belongs in the boardroom.”
Data enriched places and AI
Local government have the potential to lead the way in data revolution. The possibilities are endless when it comes to unlocking, exploring and harnessing the insights and knowledge contained within data more effectively. Insights from data can lead to better policy making and provide increasingly personalised, predictive and customised citizen services. Data Mill North is a perfect example of this. It is a platform to which anyone can publish open data to create the core infrastructure for open innovation in the region. Leeds has created a culture of collaboration for solving challenges and its driven competition in the market by prompting developers and companies to create apps/products needed by citizens.
This year also saw the launch of the Worcestershire Office of Data Analytics. It brings together partners across the local government public service landscape to introduce innovative ways to address the challenges of the place and use data to bring frontline insights that will create a data-driven culture and drive digital transformation. As councils move towards a place-based approach, many are opening an office of data analytics - West Midlands secured one as part of its new devolution deal – to overcome obstacles to data sharing and use analytics to better manage demand.
Even though artificial intelligence is still a rather nascent market for public sector, local government is leading the way in its adoption and understanding its value in transforming services for citizens. Last year, Enfield Council introduced an AI-based chatbot to simplify internal processes and help residents complete standard applications. Aylesbury Vale District Council has also turned to AI to boost customer service. It has introduced a service that learns from previous council residents’ conversations and can improve council response time to resident queries on services, such as council tax, benefit and bin collection.
Smart places
Technologies such as sensors can also enable greater self-service and empower citizens to manage their own situations. This is particularly relevant in transforming health and social care services to deal with an ageing population.
We are also seeing councils using smart road sensors to cut down the costs of monitoring car parking and making the lives of residents easier by finding a parking space much quicker. At the start of the year, Cardiff City Council began its rollout of infrared sensors on its parking bays and an app to help drivers find vacant spaces. The council is also planning to make more use of automatic number plate recognition technology in off-street car parks and place variable message signage around the city to direct motorists to available parking. The council will also obtain better intelligence on its parking facilities as a result helping to radically change the way cities operate and create smart places.
When thinking about what is the purpose of local government, is it not about supporting and helping the most vulnerable in our society? Technology can help achieve efficiency savings and deliver services better but the ultimate goal is to improve social outcomes. A good example of where technology can assist is helping to prevent homelessness, and this is one of the biggest challenges facing local government. The latest official figures show an estimated 4,134 people in England were forced to sleep outside in 2016, up 16 per cent on the previous year.
The government’s new Homelessness Reduction Act, will place more responsibility on local government to prevent homelessness when it comes into force in April 2018. By unlocking the potential of their existing data, local authorities strategically predict and prevent homelessness by identifying households at risk of losing their home. Councils, such as Redditch, are using apps to enable the public to alert the local authority about people sleeping rough on the streets.
Where next?
The pressures on local government can’t be underestimated. With growing citizen expectations and increasing demand, councils are reengineering their approaches to provide improved citizen outcomes. Technologies such as AI, data analytics, personal apps and virtual reality offer enormous potential for councils to rethink how and what services are delivered, with the goal of bringing the most value to the citizen.
Technology can also act as the enabler in reinvigorating local democracy, bringing communities together and allowing genuine collaboration. This momentum must not be lost - councils must continue to share best practice and case studies on the adoption of new technologies.
It is an exciting time for local government innovation. 2017 saw some great examples of local government transformation but there is still so much untapped potential tech can bring, let’s see what 2018 has in store. |
#include "webenginepage.h"
#include "webwindow.h"
WebEnginePage::~WebEnginePage()
{
for(WebWindow *createdWindow : mCreatedWindows)
{
createdWindow->close();
createdWindow->deleteLater();
}
mCreatedWindows.clear();
}
bool WebEnginePage::acceptNavigationRequest(const QUrl &url, QWebEnginePage::NavigationType /*type*/, bool /*isMainFrame*/)
{
QString urlString = url.toString();
if(mRedirectURLString.length() > 0 &&
(urlString.length() >= mRedirectURLString.length()) &&
(urlString.left(mRedirectURLString.length()) == mRedirectURLString))
{
emit callbackCatched(url.toString());
return false;
}
return true;
}
QWebEnginePage *WebEnginePage::createWindow(WebWindowType type)
{
switch(type)
{
case QWebEnginePage::WebBrowserTab:
case QWebEnginePage::WebBrowserBackgroundTab:
case QWebEnginePage::WebBrowserWindow:
case QWebEnginePage::WebDialog:
{
WebWindow *webViewDialog = new WebWindow(QSize(600, 500), QUrl(), mRedirectURLString, false);
QObject::connect(webViewDialog, SIGNAL(callbackCalled(const QString &)), this, SLOT(onAuthWindowCallbackCalled(const QString &)));
QObject::connect(webViewDialog, SIGNAL(windowClosed()), this, SLOT(onCreatedWindowClosed()));
QObject::connect(webViewDialog->GetWebEnginePage(), SIGNAL(windowCloseRequested()), this, SLOT(onWindowCloseRequested()));
mCreatedWindows.push_back(webViewDialog);
webViewDialog->open();
return webViewDialog->GetWebEnginePage();
}
}
return NULL;
}
void WebEnginePage::onAuthWindowCallbackCalled(const QString &inURLString)
{
emit callbackCatched(inURLString);
}
void WebEnginePage::onCreatedWindowClosed()
{
WebWindow *createdWindow = qobject_cast<WebWindow *>(sender());
if (createdWindow != Q_NULLPTR)
{
std::vector<WebWindow*>::iterator iterator = std::find(mCreatedWindows.begin(), mCreatedWindows.end(), createdWindow);
if(iterator != mCreatedWindows.end())
{
mCreatedWindows.erase(iterator);
createdWindow->close();
createdWindow->deleteLater();
}
}
}
void WebEnginePage::onWindowCloseRequested()
{
QWebEnginePage *webEngine = qobject_cast<QWebEnginePage *>(sender());
if (webEngine != Q_NULLPTR)
{
for(WebWindow *createdWindow : mCreatedWindows)
{
if(createdWindow->GetWebEnginePage() == webEngine)
{
std::vector<WebWindow*>::iterator iterator = std::find(mCreatedWindows.begin(), mCreatedWindows.end(), createdWindow);
if(iterator != mCreatedWindows.end())
{
mCreatedWindows.erase(iterator);
createdWindow->close();
createdWindow->deleteLater();
}
break;
}
}
}
}
|
A study by the CDC, appearing in the journal Pediatrics shows, once again, that smoking cigarettes during pregnancy (with its nicotine and other toxic substances) is a health risk to your baby. Reuters Health reports:
…women who smoked early in pregnancy were 30 percent more likely to give birth to babies with obstructions in the flow of blood from the heart to the lungs, and nearly 40 percent more likely to have babies with openings in the upper chambers of their hearts.
We’ve known for many years of the dangers of smoking during pregnancy, and this study just adds to that knowledge. Mothers-to-be take note: what goes into your body affects your baby—possibly for a lifetime. |
<?php
/**
* @link:http://www.zjhejiang.com/
* @copyright: Copyright (c) 2018 浙江禾匠信息科技有限公司
*
* Created by PhpStorm.
* User: 风哀伤
* Date: 2018/8/11
* Time: 10:46
*/
namespace app\modules\mch\models\order;
use app\modules\mch\models\MchModel;
use yii\db\ActiveRecord;
/**
* @property ActiveRecord $order_model
*/
class OrderDeleteForm extends MchModel
{
public $order_model;
public $order_id;
public $store;
public $is_recycle;
public $type;
public $mch_id;
public function delete()
{
if (!$this->order_id) {
return [
'code' => 1,
'msg' => '数据错误,请刷新后重试'
];
}
$orderClass = $this->order_model;
$order = $orderClass::find()->where(['id' => $this->order_id])->andWhere(['is_recycle'=>1])->one();
if (!$order) {
return [
'code' => 1,
'msg' => '订单不存在,请刷新后重试'
];
}
if (isset($order->is_recycle)) {
if ($order->is_recycle == 0) {
$order->is_recycle = 1;
} else {
if (isset($order->is_show)) {
$order->is_show = 0;
} else {
return [
'code' => 1,
'msg' => "操作失败,{$orderClass}缺少is_show字段"
];
}
}
} else {
return [
'code' => 1,
'msg' => "操作失败,{$orderClass}缺少is_recycle字段"
];
}
if ($order->save()) {
return [
'code' => 0,
'msg' => '操作成功'
];
} else {
$this->getErrorResponse($order);
}
}
// 清空回收站
public function deleteAll()
{
$orderClass = $this->order_model;
$condition = ['is_recycle' => 1, 'store_id' => $this->store->id];
if ($this->type || $this->type === 0) {
$condition['type'] = $this->type;
}
if ($this->mch_id === 0) {
$condition['mch_id'] = 0;
}
if ($this->mch_id) {
$condition = ['and', $condition, ['>', 'mch_id', 0]];
}
$count = $orderClass::updateAll(['is_show' => 0], $condition);
return [
'code' => 0,
'msg' => "已清空,共删除{$count}个订单"
];
}
// 移入移出回收站
public function recycle()
{
if (!$this->order_id) {
return [
'code' => 1,
'msg' => '订单不存在,请刷新后重试'
];
}
$orderClass = $this->order_model;
$condition = ['store_id' => $this->store->id, 'id' => $this->order_id];
if($this->is_recycle && $this->is_recycle == 1){
$condition['is_recycle'] = 0;
}else{
$condition['is_recycle'] = 1;
}
$order = $orderClass::find()->where($condition)->one();
if (!$order) {
return [
'code' => 1,
'msg' => '订单不存在,请刷新后重试'
];
}
if (isset($order->is_recycle)) {
$order->is_recycle = $this->is_recycle;
} else {
return [
'code' => 1,
'msg' => "操作失败,{$orderClass}缺少is_recycle字段"
];
}
if ($order->save()) {
return [
'code' => 0,
'msg' => '操作成功'
];
} else {
return $this->getErrorResponse($order);
}
}
} |
Fatigue and sleep deprivation
Being a doctor typically involves high-intensity, time-pressured working patterns. These can lead to sleep deprivation and fatigue, effecting doctors' health, well-being and performance, their safety and that of their patients.
This BMA briefing highlights why doctors are at risk of fatigue and the acute and long-term impacts this can have. It also presents a framework for how Government, organisations and doctors themselves can manage this risk.
Factors increasing the risk of fatigue
Doctors and other clinical staff are at an increased risk of fatigue due to specific factors, including:
long working hours
high intensity workloads
increasing numbers of patient consultations, leading to 'decision fatigue'
unplanned and unpredictable interruptions associating with providing patient care advice while on call
the disruptive effects of shift working on the natural sleep cycle
Other factors which can contribute to fatigue include having to take annual leave at fixed times, being bullied or harassed at work, and additional responsibilities such as running a GP practice.
Impact of fatigue on doctors and patients
Fatigue and sleep deprivation, associated with long working hours and shift work, impacts on doctors' personal safety, increasing the likelihood of occupational accidents, road traffic crashes and needlestick injuries. It also increases risks to patient safety through clinical errors.
In the long-term, working long hours and shift or night work carries significantly health risks - including cardiovascular disease, primary sleep disorders, becoming overweight or obese, and developing type 2 diabetes.
Managing fatigue in the medical profession
While the risks of long working hours and shift work are well-recognised and managed in other safety-critical industries, such as for flight crew, working hours for doctors and other clinical staff are significantly less regulated.
A more comprehensive approach to managing the risks of fatigue in the medical profession is urgently required.
The BMA's framework outlines measures for Government, health departments and national bodies, for employers and for doctors to better anticipate and manage these risks.
Watch our animation on managing fatigue
Guidance for doctors and other clinical staff
Alongside this briefing, the BMA has produced guidance for doctors and other clinical staff on how best to manage the risks of fatigue associated with current working patterns.
GMC Number (the BMA newsletter is exclusively for practicing doctors and medical students)*
Branch of Practice
Email address *
Please confirm you agree to the BMA sending you correspondence
I give permission for the BMA to send me the newsletter and marketing emails about subjects which they think may be of interest to me, including membership benefits, events I may wish to attend, careers support, contract checking, pensions advice and other products/services provided by the BMA and its partners to its members on a regular basis. I understand that my information will also be processed in accordance with the BMA’s Privacy Policy in force from time to time. * |
The historic status of the now-shuttered Century 21 dome theater on Winchester Boulevard bounces back into the city of San Jose’s court this week. On Wednesday night, the city’s Historic Landmarks Commission will have a hearing and decide whether to recommend the City Council declare the 50-year-old movie house a city landmark.
A couple of weeks back, the State Historic Resources Commission determined the theater to be eligible for the National Register of Historic Places and sent the nomination forward. The National Park Service will make the final determination — probably some time in June — but even if it agrees, there’s unlikely to be a victory for preservationists. Because while the park service doesn’t require a property owner to consent to a historic listing, it won’t list a property on the register if the owner objects. The families that own the land beneath the dome have objected in the past, and there’s no reason to believe they won’t continue to do so.
So in that scenario, the Century 21 would be “Determined Eligible,” without actually being listed.
Given the actions that San Jose’s Historic Landmarks Commission has taken on the issue so far, I’d expect it to forward the nomination to the City Council. And that’s where things get sticky again. One councilmember I’ve talked to wants to wait until the National Register decision is made, which may push any city action until after the council’s July recess.
For anyone interested in weighing in, the landmarks commission meeting starts at 6 p.m. in rooms 118 and 119 of the San Jose City Hall wing. You can also read city staff’s report on the theater at http://www.sanjoseca.gov/DocumentCenter/View/30078.
SHE SHOOTS, SHE SINGS: When San Jose State’s women’s basketball team gets together for its end of the year banquet on Saturday at the Villages Golf & Country Club, there’ll be some high notes along with the high fives. The event, which includes a brunch and silent auction, also will also feature some of the team members providing attendees with a presentation of their vocal skills.
Personally, I’m not surprised that San Jose State would turn out athletes who are artists, too. Creativity is part of the DNA around here.
If you’re interested in attending the event, contact Gayle Kludt at kludtgayle70@gmail.com.
SCENE STEALER: It’s not unusual during the way casual “ShakesBEERience” shows at downtown San Jose’s Cafe Stritch to have a cast member borrow a drink from your table or sit down next to you while performing lines. But a surreal moment during last week’s production of “Romeo and Juliet” left the audience wondering if what they saw was real or part of the show. Toward the end of the play, a young man walked up to the stage and addressed the audience, telling them he was visiting San Jose from Canada for the first time and just wanted to thank everyone for a great time. He departed and the play played on.
Methinks he got a bit into the ale, eh?
Contact Sal Pizarro at spizarro@mercurynews.com. Follow him at Twitter.com/spizarro. |
Q:
Any downsides to feature property "Always Force Install"?
Occasionally on our deployments, we would get this error
Error occurred in deployment step 'Add Solution': A feature with ID {Guid} has already been installed in this farm. Use the force attribute to explicitly re-install the feature.
To fix this, we set the Always Force Install property of the feature in Visual Studio to True and this fixes it.
Are there any downsides to setting this property to True for all our features so we don't encounter this issue again? What would be the implication if going forward we just set this to True all the time?
A:
On http://msdn.microsoft.com/en-us/library/office/ms436075(v=office.15).aspx there's a remark about feature event handlers:
Optional Boolean. TRUE if the Feature is installed by force during
installation even if the Feature is already installed. For example, if
set to TRUE, Feature deployment event handlers will always fire
anytime a user tries to install the Feature (even if it is already
installed) by using either the scanforfeatures or installfeature
command-line operation. This attribute equals FALSE by default. The
AlwaysForceInstall attribute affects Features of all scopes.
Whether that is a problem or not depends pretty much on what you are doing with your event handlers.
|
// @include "../lib/psd.jsx"
var psd = new PSD({output:APP.OPTION.output});
psd.option.exportImages = false;
psd.parseLayers(null, null, function(layer){
if(layer.kind != LayerKind.TEXT && !psd.linkReg.test(layer.name)) return true;
});
psd.exportJSON(psd.getTextLayersAndSlices());
psd.exportPng();
psd = null;
alert('done') |
Q:
How to sort an array of dictionary in swift 4
This is my NSObject class
class CustomDate: NSObject {
var quarter: Int!
var day: String!
var month: String!
var db: String!
var long: String!
var unix: Int!
init(quarter: Int, day: String, month: String, db: String, long: String, unix: Int) {
super.init()
self.quarter = quarter
self.day = day
self.month = month
self.db = db
self.long = long
self.unix = unix
}
}
The variable I created to store CustomDate
var dates = [CustomDate]()
I am getting the data from json in a dictionary in 6 key value pairs what I want is as you can see the photo below is printing the date and month. But I need to sort json data in ascending order(or descending order). How can I do that here is my code. I am using alamofire to getting the data and I create a NSObject class to store data
func apiData() {
Alamofire.request("https://api.lrs.org/random-date-generator?lim_quarters=40&source=api-docs", method: .get, parameters: nil, encoding: URLEncoding.default, headers: nil).responseJSON { (response:DataResponse<Any>) in
switch(response.result) {
case .success(_):
guard let json = response.result.value as? [String: Any] else { return }
guard let data = json["data"] as? [String: Any] else { return }
for (_, value) in data {
let dateValue = value as! [String: Any]
let date = CustomDate(quarter: dateValue["quarter"] as! Int,
day: dateValue["day"] as! String,
month: dateValue["month"] as! String,
db: dateValue["db"] as! String,
long: dateValue["long"] as! String,
unix: dateValue["unix"] as! Int)
self.dates.append(date)
}
print(self.dates)
break
case .failure(_):
print(response.result.error as Any)
break
}
}
}
Photo for example
A:
To compare strings in numeric order either use localizedStandardCompare which sorts like in Finder
dates.sort(by: {$0.month.localizedStandardCompare($1.month) == .orderedAscending})
or compare with option numeric
dates.sort(by: {$0.month.compare($1.month, options: .numeric) == .orderedAscending})
The best solution might be to declare month as Int.
|
Commission drops plans for drastic copper feed reductions
The European Commission has dropped plans for a drastic reduction in permitted copper levels in piglet feed in what is a significant win for the NPA.
The Standing Committee on Plants, Animals, Food and Feed, which helps the Commission in its role of implementing EU legislation, agreed revised maximum permitted limits (MPLs) of copper compounds for piglet feed at its latest meeting.
After more than a year of debate on the new limits, the Committee finally agreed that the MPLs should be reduced from the existing level of 170mg/kg to 150mg/kg up to four weeks after weaning, 100mg/kg to eight weeks after weaning and then to 25mg/kg.
This comes as a huge relief for the pig sector, given that the initial proposal was to reduce the level to 25mg/kg for all ages of pigs, largely in order to protect soils from elevated concentrations of heavy metals.
Expert witness
NPA Allied Industry Group member Paul Toplis was asked by EU animal feed representative body FEFAC to act as an expert witness to appeal against the original proposal because he had been instrumental in two previous successful defences of copper.
Mr Toplis warned of the dangers to piglet health of reducing MPLs to 25mg/kg. “Alongside allies from the EU pig and animal feed sectors, we argued that such a dramatic reduction in copper limits, coming at the same time as the industry faces the loss of zinc oxide and pressure to reduce antibiotic use, would have made it very difficult to control post-weaning diarrhoea in piglets,” he said.
“We focused on AMR as the priority, fighting for copper retention to enable producers to continue their impressive reductions in antibiotic use.”
Mr Toplis estimated that the potential cost to producers of the original proposals being implemented was £1-2/pig as a result of reduced performance and piglet health, meaning the decision has potentially saved the industry up to £18 million.
NPA senior policy adviser Georgina Crayford said: “This is a significant win for the pig industry and clearly demonstrates how the NPA’s strength and expertise within its ranks can be quickly and effectively deployed to defend pig producers here in the UK. We are really pleased that the Committee has seen the sense in our arguments and reached a sensible conclusion.”
How the case was made
The NPA cited numerous studies that have shown that supplementing diets with copper at pharmacological levels (150–250 mg/kg) is beneficial to piglet health.
For example, a recent study by Bikker et al demonstrated a loss in performance of 2-3% in weaned pigs during the nursery period when Cu supplementation was reduced from 160 to 120 mg/kg. It also resulted in an increased number of pigs with loose faeces and diarrhea, reinforcing evidence that copper at pharmacological levels supports the gut health of pigs.
That is why commercial diets for weaned pigs up to 12 weeks of age generally contain a Cu supplement close to 170 mg/kg in EU countries.
The NPA also highlighted evidence suggesting that the ban was unnecessary from an environmental perspective. While the Centre for Ecology and Hydrology’s latest Countryside Survey identified a statistically significant increase in Cu concentrations in UK soils between 1998 and 2007, no changes were detected in arable land which represents the land type where most animal manure is applied.
“This suggests that extraction of copper from the soil by cropping helps to prevent increases in concentrations of this metal from application of animal manure,” Dr Crayford said.
Related
About The Author
Editor of LBM titles Pig World and Farm Business and group editor of Agronomist and Arable Farmer. National Pig Association's webmaster. Previously political editor at Farmers Guardian for many years and also worked Farmers Weekly. Occasional farming media pundit. Brought up on a Leicestershire farm, now work from a shed in the garden in Oxfordshire. Big fan of Leicester City and Leicester Tigers. Occasional cricketer. |
1. Field of the Invention
The present invention relates to a door assembly for use on an aircraft.
2. Description of the Prior Art
In commercial aircraft which are utilized today each aircraft has a fuselage in which a number of access openings are provided. Each access opening is equipped with a door. The conventional aircraft doors which are utilized to close access openings in an aircraft are quite complex and costly. Each door requires a complex hinge system in which a door is opened by first unlocking the door then pushing the door outwardly from the plane of the protective skin of the aircraft fuselage. Once the door has been pushed out from the plane of the surrounding skin of the aircraft it is opened by being swung in an arc about its hinges. The procedure is reversed in order to close a conventional aircraft door.
Because a conventional aircraft door must be capable of both translational and rotational movement, the hinge mechanism by means of which the door is attached to the fuselage of the aircraft is quite complex. As a result of this complexity conventional aircraft doors are quite costly to manufacture. Furthermore, the intricacy and complexity of the hinge mechanism enhances the likelihood of a malfunction.
Another problem that exists with conventional aircraft door closure systems is excessive weight. Due to the complexity and the many necessary parts in a conventional aircraft door assembly, the weight of such an assembly is rather large. In the aircraft industry weight is an extremely important consideration, and all possible measures are taken to reduce the weight of each and every component on an aircraft. However, even though weight is such an important factor in aircraft construction, conventional aircraft doors are still inordinately heavy.
Still another disadvantage of conventional aircraft door assemblies is that due to the complex hinge mechanism that is required, the sizes of the conventional aircraft doors must be limited. This is because there is a great cantilevered load which acts upon the hinge mechanisms when the doors are opened. As a consequence, the sizes of the access openings into which conventional aircraft doors are mounted must be limited in order to avoid hinge mechanisms which have an even greater weight. The limited size of the access openings reduces the speed with which both cargo and passengers can be loaded onto and unloaded off of an aircraft. Furthermore, the limited size of access openings in a conventional aircraft restricts the rate at which passengers can exit an aircraft in an emergency. This creates an important concern for passenger safety. The restricted size of the openings thereby creates problems of convenience, safety and cost in loading and unloading an aircraft. |
Q:
Need Some MS Access Guideance
SELECT ID, OurMaps FROM tblMatterList where Matter_OpenDate=true and datestarted between dateadd("d", ([period]-1)*14,datevalue("01/01/" & year(date())) and dateadd("d", (([period]-1)*14)+14,datevalue("01/01/" & year(date()))
Does anyone know why this code isn't working, I keep getting a Compile Error: Expected: Case
Many Thanks
A:
You're missing a bracket from each of the dateadd functions, add one closing bracket after each:
year(date())) <-- add another close bracket here
|
Finally, the 2020 NFL Draft Guide is done.
And, like last year, if you have your subscription to The Athletic, it is ready for download — for free.
Due to COVID-19, this year’s NFL Draft will be much different than past years. But not much has changed with the NFL Draft Guide – it includes 420 in-depth reports and over 1,000 ranked prospects with all the important details that matter.
For many of you, this draft publication has become an annual tradition in preparations for the NFL Draft. I’m blown away by the response every year and, honestly, that is what keeps me motivated to continue working on it year-round to make it the most information-packed draft guide available.
If this is the first time you are reading the draft guide, I don’t think you will be disappointed. Each year, I start working on “The Beast” on June 1 and it requires 10 months to finish. It includes full analysis of each player, relevant... |
A New Jersey woman, who pleaded guilty to setting her own newborn baby on fire and leaving the child to die in the street, has been sentenced to a 30-year prison sentence, court documents reveal.
In January of 2015, police arrested Pemberton Township woman Hyphernkemberly Dorvilier, 23, after they said she doused her baby with WD-40 oil and set her aflame. The child later died from the third degree burns she suffered during the incident.
Now after a year of court cases, a judge has sentenced Dorvilier to 30 years in prison for the offense.
“I was on a downward spiral. I believe I hit my rock bottom,” Dorvilier said before the court on Friday.
“I apologize first and foremost for not giving my daughter, Angelica, the life she deserved. She deserved so much better,” the convict concluded.
Judge Terrence Cook denied the woman’s plea for leniency and instead insisted that the 30-year sentence was “the sentence that justice requires.”
“The crime in this case was committed against the weakest of the weak, a helpless newborn,” Judge Cook said at the hearing.
“All she knew was the extreme excruciating pain of being set on fire by her mother, the person who was supposed to love and protect her,” Cook concluded.
In February, Dorvilier pleaded guilty to the grisly incident after spending much of last year insisting she didn’t do it.
In fact, a 911 call recorded during the incident features Dorvilier saying, “It’s not mine, it’s not mine… I didn’t do it, I didn’t do it, I didn’t do it.”
During her trial, prosecutors said Dorvilier had hidden her pregnancy from family members and decided to kill the child immediately after birth to continue the ruse. The body of the burned child was found with her umbilical cord and the placenta still attached.
Prosecutors had asked for the thirty-year sentence and the judge agreed to the full amount.
Follow Warner Todd Huston on Twitter @warnerthuston, or email the author at igcolonel@hotmail.com. |
Bitcoin is the Future, Not NFC, Says PayPal President David Marcus
Bitcoin has more potential to revolutionize commerce than near-field communication (NFC) technology does, PayPal president David Marcus said at the LeWeb conference in Paris today.
Marcus stressed he is a big fan of bitcoin and has a personal stash of the digital currency, but said the majority of people don’t currently understand what bitcoins actually are, CNET reports.
“People are confused. They think because it’s called cryptocurrency it’s a currency. I don’t think it is a currency. It’s a store of value, a distributed ledger,” he said.
While Marcus is largely positive about bitcoin, he doesn’t have many kind words to say about NFC, calling it “technology for the sake of technology”.
“Instead swiping or using a PIN pad, they’re tapping. How is that really better? How is that changing your life? People don’t want that,” he said.
Marcus wants payments to become more seamless. He sees a future where consumers won’t have to visit a checkout to pay for their goods, they will use wireless technology to pay from wherever they are in a store.
“Today a merchant has Internet connectivity at the point-of-sale terminal. All the consumers have phones with wireless networks. Why do you need to be at a place in a store to make a payment?” he said.
Marcus concluded that, over the coming years, retail chains really have some work to do to reinvent themselves and their payment systems.
Just last month, eBay president John Donahoe told the Financial Times that PayPal could, one day, incorporate bitcoin. He also stated that digital currency is going to become a “very powerful thing”.
The e-commerce group is keeping its eye on bitcoin and, in the meantime, it’s focus is on incorporating reward points from retailer loyalty schemes with its PayPal wallet. |
A hand-painted portrait of you will be featured on a wall in the game
(Approx $736 USD | €674 EUR)
- 2 x Steam Key
- Digital Soundtrack
- Special thanks in game credits
- Physical copy of a portrait
Less |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.