text
stringlengths
8
5.77M
/** * Copyright DataStax, Inc. * * Please see the included license file for details. */ package org.apache.spark.sql.cassandra import com.datastax.spark.connector.cql.{ColumnDef, TableDef} import org.apache.spark.SparkConf import org.apache.spark.sql.sources.{EqualTo, Filter, In, IsNotNull} /** * A series of pushdown rules that only apply when connecting to Datastax Enterprise */ object DsePredicateRules extends CassandraPredicateRules { override def apply( predicates: AnalyzedPredicates, tableDef: TableDef, sparkConf: SparkConf): AnalyzedPredicates = { pushOnlySolrQuery(predicates, tableDef) } /** * When using a "solr_query = clause" we need to remove all other predicates to be pushed down. * * Example : SparkSQL : "SELECT * FROM ks.tab WHERE solr_query = data:pikachu and pkey = bob" * * In this example only the predicate solr_query can be handled in CQL. Passing pkey as well * will cause an exception. */ def pushOnlySolrQuery( predicates: AnalyzedPredicates, tableDef: TableDef): AnalyzedPredicates = { val allPredicates = predicates.handledByCassandra ++ predicates.handledBySpark val solrQuery: Set[Filter] = allPredicates.collect { case EqualTo(column, value) if column == "solr_query" => EqualTo(column, value) } //Spark 2.0 + generates an IsNotNull when we do "= literal" val solrIsNotNull: Set[Filter] = allPredicates.collect { case IsNotNull(column) if column == "solr_query" => IsNotNull(column) } if (solrQuery.nonEmpty) { AnalyzedPredicates(solrQuery, allPredicates -- solrQuery -- solrIsNotNull) } else { predicates } } }
The Struggle for Labours Soul: Understanding Labours Political Thought Since 1945 Free download. Book file PDF easily for everyone and every device. You can download and read online The Struggle for Labours Soul: Understanding Labours Political Thought Since 1945 file PDF Book only if you are registered here. And also you can download or read online all Book PDF file that related with The Struggle for Labours Soul: Understanding Labours Political Thought Since 1945 book. Happy reading The Struggle for Labours Soul: Understanding Labours Political Thought Since 1945 Bookeveryone. Download file Free Book PDF The Struggle for Labours Soul: Understanding Labours Political Thought Since 1945 at Complete PDF Library. This Book have some digital formats such us :paperbook, ebook, kindle, epub, fb2 and another formats. Here is The CompletePDF Book Library. It's free to register here to get Book file PDF The Struggle for Labours Soul: Understanding Labours Political Thought Since 1945 Pocket Guide. Who runs the Labour Party - British Labour Party - Politics - TV Eye - 1980 One Party Dominance. Sean McGraw. Representing Women in Parliament. Marian Sawer. The uneven path of British Liberalism. Tudor Jones. New Labour in Power. Tim Bale. New Labour's Pasts. James E. The British Party System. Stephen Ingle. Nation, Class and Resentment. Steve Fenton. Egalitarian Thought and Labour Politics. Book Reviews | Labour History Review Nick Ellison. Parties and People. Ross McKibbin. Class Struggle and Social Welfare. Michael Lavalette. Television Policies of the Labour Party Des Freedman. Nostalgia and the post-war Labour Party. Richard Jobson. The Labour Governments Peter Dorey. Education and Labour Party Ideologies and Beyond. Denis Lawton. Navigation menu Remaking the Union. Howard Elcock. The Labour governments — volume 1. Steven Fielding. Euroscepticism in Contemporary British Politics. Anthony Forster. Dynamics of Political Change in Ireland. British Regionalism and Devolution. Labour and the left in the s. Jonathan Davis. How has Fianna Fail adapted to changes in Irish society since ? Thorsten Volberg. Navigation menu Duncan McTavish. David Marquand. The Making of Eurosceptic Britain. Chris Gifford. Britain in the Nineties. Peace and Ethnic Identity in Northern Ireland. Henry Jarrett. Scotland: the Challenge of Devolution. Alex Wright. Evolution of the British Party System. Robert C. Ideas and Think Tanks in Contemporary Britain. Michael David Kandiah. Andrew Denham. Contemporary Britain. John Oakland. Parliamentary reform at Westminster. Alexandra Kelso. Race and Politics. Muhammad Anwar. Mass Conservatism. Stuart Ball. Alternatives to State-Socialism in Britain. Alastair J. Neoliberal Thought and Thatcherism. Robert Ledger. Human Geography of the UK. David Graham. The End of British Politics? Michael Moran. Industrial Efficiency and State Intervention. Dr Nick Tiratsoo. New Labour and the European Union. Oliver Daddow. From Immigrants to Ethnic Minority. The Struggle for Labour's Soul: Understanding Labour's Political Thought since 1945 Lorna Chessum. Culture Wars. James Curran. The Great Philosophers: Hegel. Raymond Plant. New Labour, Old Labour. Kevin Hickson. The eventual solution, embodied in the Government of India Act of , provided responsible government for the Indian provinces, the Indianization of the civil service , and an Indian parliament, but it made clear that the Westminster Parliament would continue to legislate for the subcontinent. The act pleased no one, neither the Indians, the Labour Party, which considered it a weak compromise, nor a substantial section of the Conservative Party headed by Churchill, which thought it went too far. Agitation in India continued. Further British compromise became inevitable when the Japanese in the spring of swept through Burma to the eastern borders of India while also organizing in Singapore a large Indian National Army and issuing appeals to Asian nationalism. During the war, Churchill reluctantly offered increasing installments of independence amounting to dominion status in return for all-out Indian support for the conflict. These offers were rejected by both the Muslim minority and the Hindu majority. The election of a Labour government at the end of World War II coincided with the rise of sectarian strife within India. The new administration determined with unduly urgent haste that Britain would have to leave India. The Struggle for Labours Soul: Understanding Labours Political Thought Since 1945 The Struggle for Labours Soul: Understanding Labours Political Thought Since 1945 The Struggle for Labours Soul: Understanding Labours Political Thought Since 1945 The Struggle for Labours Soul: Understanding Labours Political Thought Since 1945 The Struggle for Labours Soul: Understanding Labours Political Thought Since 1945 The Struggle for Labours Soul: Understanding Labours Political Thought Since 1945 The Struggle for Labours Soul: Understanding Labours Political Thought Since 1945 The Struggle for Labours Soul: Understanding Labours Political Thought Since 1945 Related The Struggle for Labours Soul: Understanding Labours Political Thought Since 1945
I'm best defined as a Wife, Mother, Blogger & Professional Photographer. My blog is where I dump all the contents of my life, and over-share the small, but important details and stories! Thank you for stopping in, I look forward to getting to know you! photography info COPYRIGHT STATEMENT All text and images on this website are the sole property of A Sorta Fairytale {blog} and Mandy Chiappini Photography unless otherwise stated. Please do not remove content from this blog without permission. All Rights Reserved. Thank you! Blog Design By 22 March 2012 The home stretch! Yep. I'm full term y'all! Crazy huh?? Feels like just yesterday I was announcing my pregnancy! And then spilling the beans about how we're having another precious baby boy! Gosh. Okay so I don't have a ton to say other than I just wanted to document that I'm officially full term! And that, realistically, this little babe could come at any time! Here a few updates: At my last OB appointment, my doctor told me that she is expecting this baby to be bigger than Bennett... her guess is 8.9lbs (if I go all the way to 40 weeks). She's not expecting me to go past 40 weeks, but in the event that I do... she will induce me at 41 weeks. I tested positive for Group B Strep. It's not a super big deal, but I will need to hustle to the hospital when I go into labor so they can get me started on antibiotics. (here's some info on it in case your curious) I got my hospital bag packed. Not much in there but some clothes and toiletries. Infant car seat has been installed. It's weird looking in the back and seeing the toddler seat AND the infant seat. Holy moly. And here's a question for you all. I feel like so many of you have followed me so loyally through this pregnancy, and I so much appreciate all of the love and support that I've received through this blog. You are all wonderful!! So here's the question: When my labor starts, would anyone want me to post updates as things progress? I could post them on my facebook fanpage or twitter. Or do you not care about the labor and want me to just post the birth story/pics after he arrives? If people want to follow along during my labor, I will definitely update one of my social networking sites as frequently as I can! Let me know! :) You are looking great! I loved hearing those words "full term." Unfortunately my stubborn little boy was 8 days late so being full term was just a tease because I still had a month left! I hope and pray you don't go late! Prayers for a safe labor and delivery process and I can't wait to see pictures of your sweet new baby boy! you are such a gorgeous mama! I would definitely love to hear about how your labor goes but then again. we don't want to stress you out with having to tweet when you should just be concentrating on you and the baby. Sending you lots of positive vibes! Good luck with everything! Baby Fitzie, please come meet us soon! Well, not until mommy is ready though. I of course want a minute by minute play by play, though I am hoping to be there in person for some of it. Oooh, you could vlog! Or do a live feed video ;-) Ahhh, I am so stinkin excited to meet him! I feel like the next few weeks are going to drag on and on. Yay...I'm so happy for you! I remember how ready I was to have my baby#2 and how excited I was when I set up the second crib, installed the second car seat, and got out all of the tiny newborn clothes! I can't wait to see him. It'd be awesome to hear about your labor via Twitter if you have time. My oldest was so sweet (and still is 8 months later) with his little brother. I'm sure Bennet will be the same way. You look so great! Of course, we would love to hear updated but just do whatever is best for you! Sometimes it's nice just to forget the internet for a while and enjoy your labor and share later. Or, if you want to tweet, that's great but we all understand that birth is a busy time and it's not bad if you need a little break! :) I absolutely CANNOT believe you are full term already! It seems like I just read your announcement post yesterday! I have a feeling Sully will be a lot bigger than Elliot, but my OB hasn't said much of anything about it yet. I'm curious to see if she says anything at my next appointment.PS- just curious, did you test positive for group B strep with Bennett as well? Is it something that can pop up randomly even if you didn't test positive for it the first time? Hmmm. You are looking so great and I know you are thrilled to give birth to this baby boy. I'd love to hear anything but chances are that I'll probably catch up with you after it's been said and done. Congratulations mama! Oh I will definitely try to post pictures! I think it will just depend on how the labor goes and how much time I have and if I think about it. Whoa that was a complicated answer! he he. Thanks so much for following me along this journey! Means so much! Ive been following you through the whole pregnancy and its funny how excited I am to meet him even though I don't even "know" you! Thanks for sharing your life with us! Praying for a safe and easy delivery! Mandy, please "DO" update your FB page as your labor progresses, I love to read what's going on with you. I'm in my 33rd week of my first pregnancy so it's so nice to read about your experiences, as many of them have been mine too. :-) Good Luck! WOW you look gorgeous!!! Can't believe how quickly your pregnancy went! :) I'm guessing you're going to be busy in labor and all so I don't expect any updates, but would love to hear the birth story and definitely post pictures ASAP! :D I believe you were planning all natural--no pain meds--?? or amI thinking of someone else?, but if you do get the epi, then by all means update :) Can't wait! Good Luck!!! Okay, so EVERYONE I know in the blogging world follows you and loves you, so I had to get in on the action! I am loving your blog...and you look beautiful preggos! :-)Your newest fan and follower♥ Kyna Post labor updates! I love reading about people's progress! Also, make sure you are constantly reminding people that you are positive for Group B strep if they try and send you home. I got sent home twice and ended up delivering as soon as I got to the hospital for the third time, which was not enough time to get the antibiotics. :( It was incredibly stressful and dangerous for baby. Hang in there and can't wait to see updated on your new little one!
--- abstract: 'We construct orthogonal arrays ${\ensuremath{\mathsf{OA}}}_{\lambda} (k,n)$ (of strength two) having a row that is repeated $m$ times, where $m$ is as large as possible. In particular, we consider OAs where the ratio $m / \lambda$ is as large as possible; these OAs are termed *optimal*. We provide constructions of optimal OAs for any $k \geq n+1$, albeit with large $\lambda$. We also study *basic* OAs; these are optimal OAs in which $\gcd(m,\lambda) = 1$. We construct a basic OA with $n=2$ and $k =4t+1$, provided that a Hadamard matrix of order $8t+4$ exists. This completely solves the problem of constructing basic OAs wth $n=2$, modulo the Hadamard matrix conjecture.' author: - 'Charles J. Colbourn' - 'Douglas R. Stinson[^1]' - Shannon Veitch title: Constructions of optimal orthogonal arrays with repeated rows --- Introduction {#OA2.sec} ============ Let $k \geq 2$, $n \geq 2$ and $\lambda \geq 1$ be integers. An *orthogonal array* ${\ensuremath{\mathsf{OA}}}_{\lambda} (k,n)$ is a $\lambda n^2 $ by $k$ array, $A$, with entries from a set $X$ of cardinality $n$ such that, within any two columns of $A$, every ordered pair of symbols from $X$ occurs in exactly $\lambda$ rows of $A$. For much information on orthogonal arrays, see [@HSS]. In this note, we are interested in ${\ensuremath{\mathsf{OA}}}_{\lambda} (k,n)$ that contain a row that is repeated $m$ times, where $m$ is as large as possible. We observe that, by relabelling the symbols in the orthogonal array, these $m$ rows can all be assumed to be of the form $x \; x \cdots x$ for some fixed symbol $x$. We will denote this particular symbol $x$ either by $0$ or by $\infty$. The following theorem, along with an elementary combinatorial proof, can be found in [@Sti18 Theorem 2.2]. However, we should note that this result is also an immediate consequence of a much more general result from [@Muk]. \[repeated.thm\] Let $k \geq 2$, $n \geq 2$ and $\lambda \geq 1$ be integers. If there is an ${\ensuremath{\mathsf{OA}}}_{\lambda}(k,n)$ containing a row that is repeated $m$ times, then $$m \leq \frac{\lambda n^2}{k(n-1)+1}.$$ An ${\ensuremath{\mathsf{OA}}}_{\lambda}(k,n)$, say $A$, containing a row that is repeated $$\label{m.eq} m = \frac{\lambda n^2}{k(n-1)+1}$$ times will be termed *optimal*. Another way to view the optimality property is to observe that the ratio $m /\lambda$ is as large as possible in an optimal OA. We note that, in a recent paper, Culus and Toulouse [@CT] discuss an application where it is beneficial to construct optimal orthogonal arrays. They also construct several small examples of optimal OAs using linear programs. The rest of this paper is organized as follows. Section \[prelim.sec\] establishes some basic results about optimal OAs. In Section \[examples.sec\], we present some small examples of basic OAs, which are optimal OAs in which $\gcd(m,\lambda) = 1$. In Section \[basic.sec\], we give a complete solution (modulo the Hadamard matrix conjecture) to the the problem of constructing basic OAs with $n = 2$. Section \[general.sec\] gives constructions of optimal OAs for arbitrary values of $n$ and $k \geq n+1$. Section \[delete.sec\] examines the effect of deleting a small number of columns from an optimal OA. Finally, Section \[summary.sec\] is a brief summary. Preliminary results {#prelim.sec} =================== From the proof of [@Sti18 Theorem 2.2], the following result can be derived immediately. \[abar.lem\] [@Sti18 Corollary 2.4] Let $k \geq 2$, $n \geq 2$ and $\lambda \geq 1$ be integers. Suppose there is an optimal ${\ensuremath{\mathsf{OA}}}_{\lambda}(k,n)$, say $A$, containing a row $0 \; 0 \cdots 0$ that is repeated $m$ times. Then every other row of $A$ contains exactly $$\label{a.eq} \overline{a} = \frac{k(\lambda n - m)}{\lambda n^2-m}$$ occurrences of the symbol $0$. We can simplify the formula (\[a.eq\]) for $\overline{a}$, as follows. \[a.cor\] Let $k \geq 2$, $n \geq 2$ and $\lambda \geq 1$ be integers. Suppose there is an optimal ${\ensuremath{\mathsf{OA}}}_{\lambda}(k,n)$, say $A$, containing a row $0 \; 0 \cdots 0$ that is repeated $m$ times. Then every other row of $A$ contains exactly $(k-1)/n$ occurrences of the symbol $0$ and thus $k \equiv 1 \bmod n$. In an optimal ${\ensuremath{\mathsf{OA}}}_{\lambda}(k,n)$, equation (\[m.eq\]) holds. Suppose we substitute this expression for $m$ into equation (\[a.eq\]). We obtain [ $$\begin{aligned} \overline{a} &=& \frac{k(\lambda n - m)}{\lambda n^2-m}\\ &=& \frac{k\left(\lambda n - \frac{\lambda n^2}{k(n-1)+1}\right)}{\lambda n^2-\frac{\lambda n^2}{k(n-1)+1}}\\ &=& \frac{k\left(1 - \frac{n}{k(n-1)+1}\right)}{n-\frac{n}{k(n-1)+1}}\\ &=& \frac{k(k(n-1)+1) -kn}{n(k(n-1)+1) - n}\\ &=& \frac{k^2n - k^2 +k-kn}{kn(n-1)}\\ &=& \frac{k(k-1)(n-1)}{kn(n-1)}\\ &=& \frac{k-1}{n}.\end{aligned}$$ ]{} We will define a quadruple of positive integers $(m,\lambda,k,n)$ to be *feasible* if the following conditions are satisfied: - $k \geq 2$ and $n \geq 2$, - $m = \frac{\lambda n^2}{k(n-1)+1}$, and - $\overline{a} = \frac{k-1}{n}$ is a positive integer. The above conditions are all necessary for the existence of an optimal ${\ensuremath{\mathsf{OA}}}_{\lambda}(k,n)$. Suppose $(m,\lambda,k,n)$ is a feasible quadruple, $\ell \mid m$ and $\ell \mid \lambda$, where $\ell > 1$. Then $(m/\ell,\lambda/\ell,k,n)$ is a feasible quadruple. Define $m' = m/\ell$ and $\lambda' = \lambda / \ell$. It suffices to observe that $$m = \frac{\lambda n^2}{k(n-1)+1} \Leftrightarrow m' = \frac{\lambda' n^2}{k(n-1)+1}.$$ If there exists an optimal ${\ensuremath{\mathsf{OA}}}_{\lambda'}(k,n)$ and we take $\ell$ copies of every row, then we obtain an optimal ${\ensuremath{\mathsf{OA}}}_{\lambda}(k,n)$, where $\lambda = \ell \lambda'$. The most interesting parameter cases are those where we cannot just take multiple copies of a smaller OA. Therefore, we define a feasible quadruple $(m,\lambda,k,n)$ to be *basic* if $\gcd (m,\lambda) = 1$. Similarly, an optimal ${\ensuremath{\mathsf{OA}}}_{\lambda}(k,n)$ is *basic* if $\gcd (m,\lambda) = 1$. As we already mentioned, an optimal OA is any ${\ensuremath{\mathsf{OA}}}_{\lambda}(k,n)$ that has an $m$-times repeated row, where the ratio $m/\lambda$ is as large as possible. A basic OA is an optimal OA where the value of $\lambda$ (or equivalently, $m$) is as small as possible. Note that basic OAs include the case $m = \lambda= 1$, which of course do not contain repeated rows. The possible basic quadruples are quite constrained if $n$ is prime and $m > 1$. \[prime.thm\] If $(m, \lambda, k, n)$ is a basic quadruple, $m > 1$ and $n$ is prime, then $m = n$. Further, $k = ns+1$ and $\lambda = (n-1)s + 1$ for some integer $s$ such that $\gcd(n,s-1) = 1$. We have that $m (k (n-1) + 1) = \lambda n^2$ from (\[m.eq\]). Further, $k = ns + 1$ for some integer $s$, by Corollary \[a.cor\]. Therefore $$\begin{aligned} \lambda n^2 &=& m ((ns+1)(n-1) + 1) \\ &=& m (n^2s - ns + n)\end{aligned}$$ and hence $$\lambda n = m (ns -s + 1).$$ Then $m \mid \lambda n$ and $\gcd(m, \lambda) = 1$, so $m \mid n$. Since $n$ is prime and $m > 1$, we have $m = n$. Referring again to (\[m.eq\]), it follows that $$\begin{aligned} \lambda &=& \frac{m (k(n-1) + 1)}{n^2} \\ &=& \frac{n ((ns+1)(n-1) + 1)}{n^2} \\ &=& (n-1)s + 1.\end{aligned}$$ Finally, a basic quadruple requires that $\gcd(m,\lambda) = 1$. Thus, it is necessary that $\gcd (n,(n-1)s + 1) = 1$, which simplifies to $\gcd(n,s-1) = 1$. Some examples of basic OAs {#examples.sec} -------------------------- An optimal ${\ensuremath{\mathsf{OA}}}_{\lambda}(k,n)$ has a total of $\lambda n^2 = m(k(n-1)+1)$ rows. If we delete $m$ rows of the form $0 \; 0 \cdots 0$, then the number of remaining rows is $mk(n-1)$, which is divisible by $k$. This suggests that we might attempt to construct the ${\ensuremath{\mathsf{OA}}}_{\lambda}(k,n)$ by cyclically rotating $m(n-1)$ “starting rows” $k$ times. We illustrate the technique in a small example. We construct a basic ${\ensuremath{\mathsf{OA}}}_{3}(5,2)$ from the following two starting rows: $$\begin{array}{ccccc} 0& 0& 1 & 1& 1\\ 0& 1& 0 & 1& 1 \end{array}$$ We cyclically rotate these starting rows five times, and then adjoin $m=2$ rows of $0$’s. This yields the desired orthogonal array, which is presented in Figure \[fig1\]. $$\begin{array}{ccccc} 0& 0& 0 & 0& 0\\ 0& 0& 0 & 0& 0\\ \hline 0& 0& 1 & 1& 1\\ 1& 0& 0 & 1& 1\\ 1& 1& 0 & 0& 1\\ 1& 1& 1 & 0& 0\\ 0& 1& 1 & 1& 0\\ \hline 0& 1& 0 & 1& 1\\ 1& 0& 1 & 0& 1\\ 1& 1& 0 & 1& 0\\ 0& 1& 1 & 0& 1\\ 1& 0& 1 & 1& 0 \end{array}$$ It is possible to verify that this process will yield an ${\ensuremath{\mathsf{OA}}}_{3}(5,2)$ without actually constructing the whole array. It suffices to look all the ordered pairs that are (cyclically) a fixed distance apart in the starting rows. Each row has five entries, so we only have to consider pairs at distance one and two, because $\lfloor \frac{5}{2} \rfloor = 2$. - For distance one, we have $00, 01,11,11,10$ from the first starting row and $01, 10,01,11,10$ from the second starting row. We see we have three occurrences of each of $01,10$ and $11$, and one occurrence of $00$. - For distance two, we have $01, 01,11,10,10$ from the first starting row and $00, 11,01,10,11$ from the second starting row. Again, we have three occurrences of each of $01,10$ and $11$, and one occurrence of $00$. This means that, when we rotate the starting rows and adjoin two rows of $0$’s, we are guaranteed to get the desired orthogonal array. Finally, we note that existence of a basic ${\ensuremath{\mathsf{OA}}}_{3}(5,2)$ is also reported in [@CT Table 4]. We now give starting rows for a few other small examples. A basic ${\ensuremath{\mathsf{OA}}}_{5}(9,2)$ with $m=2$ can be constructed from the following two starting rows: $$\begin{array}{ccccccccc} 0& 0& 0 & 1& 0& 1& 1 & 1& 1\\ 0& 0& 1 & 1& 0& 1& 0 & 1& 1 \end{array}$$ Existence of a basic ${\ensuremath{\mathsf{OA}}}_{5}(9,2)$ is also reported in [@CT Table 4]. \[OA7,13,2\] A basic ${\ensuremath{\mathsf{OA}}}_{7}(13,2)$ with $m=2$ can be constructed from the following two starting rows: $$\begin{array}{ccccccccccccc} 0& 0& 0 & 0& 1& 0& 1 & 1& 1& 0& 1 & 1& 1\\ 0& 0& 1 & 0& 1& 1& 0 & 0& 1& 1& 1 & 0& 1 \end{array}$$ A basic ${\ensuremath{\mathsf{OA}}}_{9}(17,2)$ with $m=2$ can be constructed from the following two starting rows: $$\begin{array}{ccccccccccccccccc} 0& 0& 0 & 0& 0& 1& 0 & 1& 1& 1& 0 & 1& 1& 0& 1 & 1& 1\\ 0& 0& 0 & 1& 0& 1& 1 & 0& 1& 0& 1 & 1& 0& 0& 1 & 1& 1 \end{array}$$ \[ex5\] We use a slightly different technique to obtain a basic ${\ensuremath{\mathsf{OA}}}_{5}(7,3)$ with $m=3$. We have three starting rows, consisting of symbols from the set $\{\infty\} \cup {\ensuremath{\mathbb{Z}}}_2$: $$\begin{array}{ccccccc} \infty & \infty & 0 & 0 & 0 & 0 & 1\\ \infty & 1 & \infty & 0 & 1 & 1 & 0\\ \infty & 1 & 1 & \infty & 1 & 0 & 1 \end{array}$$ First, cyclically rotate each starting row seven times. Then develop each row modulo $2$ (the point $\infty$ is fixed). Finally, adjoin three rows of $\infty$’s. The resulting $3 \times 7 \times 2 + 3 = 45$ rows form a basic ${\ensuremath{\mathsf{OA}}}_{5}(7,3)$. Existence of a basic ${\ensuremath{\mathsf{OA}}}_{5}(7,3)$ is also reported in [@CT Table 4]. \[ex794\] We construct a basic ${\ensuremath{\mathsf{OA}}}_{7}(9,4)$ with $m=4$ from four starting rows, consisting of symbols from the set $\{\infty\} \cup {\ensuremath{\mathbb{Z}}}_3$: $$\begin{array}{ccccccccc} \infty & \infty & 0 & 0 & 0 & 0 & 1 & 0 & 2 \\ \infty & 0 & \infty & 1 & 0 & 0 & 1 & 2 & 1 \\ \infty & 0 & 1 & \infty & 1 & 1 & 0 & 1 & 2 \\ \infty & 0 & 0 & 2 & \infty & 2 & 1 & 1 & 2 \end{array}$$ First, cyclically rotate each starting row nine times. Then develop each row modulo $3$ (the point $\infty$ is fixed). Finally, adjoin four rows of $\infty$’s. The resulting $4 \times 9 \times 3 + 4 = 112$ rows form a basic ${\ensuremath{\mathsf{OA}}}_{7}(9,4)$. Basic OAs for $n=2$ {#basic.sec} =================== In this section, we determine all the basic quadruples $(m,\lambda,k,2)$ with $m > 1$. For these quadruples, we can construct a basic ${\ensuremath{\mathsf{OA}}}_{\lambda}(k,2)$ provided that a suitable Hadamard matrix exists. \[basicn=2\] If $(m,\lambda,k,2)$ is a basic quadruple with $m > 1$, then $m=2$. Further, $\lambda = 2t+1$ and $k = 4t+1$ for some positive integer $t$. Take $n=2$ in Theorem \[prime.thm\]. Then $m=2$ and we have $k=2s+1$ and $\lambda = s+1$, where $\gcd(2, s-1) = 1$. Hence $s$ is even. Writing $s=2t$, we obtain $\lambda = 2t+1$ and $k = 4t+1$. \[BIBDtoOA.thm\] There exists a basic ${\ensuremath{\mathsf{OA}}}_{2t+1}(4t+1,2)$ if and only if there is a $(4t+1,2t+1,2t+1)$-BIBD. First suppose that a $(4t+1,2t+1,2t+1)$-BIBD exists. This BIBD has $b = 8t+2$ blocks and replication number $r = 4t+2$. Let $M$ be the $b$ by $v$ incidence matrix of this BIBD. Construct the matrix $$A = \left( \begin{array}{c} 0\; 0 \cdots 0\\ 0\; 0 \cdots 0\\ M \end{array} \right) .$$ We claim that $A$ is a basic ${\ensuremath{\mathsf{OA}}}_{2t+1}(4t+1,2)$. Clearly the first two rows are identical, so $m=2$ and we just need to verify that $A$ is an OA with the stated parameters. Choose any two distinct columns of $A$. These columns correspond to two points in the BIBD, say $x$ and $y$, where $x \neq y$. The number of occurrences of $1\; 1$ in these two columns is $\lambda = 2t+1$. The number of occurrences of $0\; 1$ is $r - \lambda = 2t+1$, as is the number of occurrences of $1\; 0$. Finally, the number of occurrences of $0\; 0$ is $2 + 8t+2 - 3(2t+1) = 2t+1$. Conversely, suppose $A$ is a basic ${\ensuremath{\mathsf{OA}}}_{2t+1}(4t+1,2)$. We can assume that the symbols in the OA are $0$ and $1$. Without loss of generality, suppose that there are $m=2$ rows consisting entirely of zeroes, and then delete them, creating a $8t+2$ by $4t+1$ matrix $M$. We will show that $M$ is the incidence matrix of a $(4t+1,2t+1,2t+1)$-BIBD. Clearly $M$ is the incidence matrix of a set system on $4t+1$ points. Given any two points $x$ and $y$, the number of blocks containing these two points is the same as the number of occurrences of $1\; 1$ in the two associated columns of the OA, which is $2t+1$. To complete the proof, we show that every block in the set system has size $2t+1$. This can be seen easily by recalling from Lemma \[abar.lem\] that every row of $A$ contains exactly $\overline{a} = (4t+1 -1)/2 = 2t$ zeroes. Therefore, the number of ones in a row of $A$ is $4t+1 - \overline{a} = 2t+1$. This completes the proof. Now we show how to construct a basic ${\ensuremath{\mathsf{OA}}}_{2t+1}(4t+1,2)$ from a certain Hadamard matrix. We use a few standard results, all of which can be found in [@Stinson], for example. If there exists a Hadamard matrix of order $8t+4$, then there exists a basic ${\ensuremath{\mathsf{OA}}}_{2t+1}(4t+1,2)$. It is well-known that a Hadamard matrix of order $8t+4$ is equivalent to a symmetric $(8t+3,4t+1,2t)$-BIBD. The derived BIBD is a $(4t+1,2t,2t-1)$-BIBD. If we then complement every block in this BIBD, we obtain a $(4t+1,2t+1,2t+1)$-BIBD. Finally, apply Theorem \[BIBDtoOA.thm\]. It is known that Hadamard matrices exist for all orders $n \equiv 0 \bmod 4$, $4 \leq n < 668$, and it is conjectured that Hadamard matrices exist for all orders $n \equiv 0 \bmod 4$, $n \geq 4$. General constructions for optimal OAs {#general.sec} ===================================== Suppose we fix $k$ and $n$, where $k \geq n+1$. Denote $\rho = n^2 / (k(n-1)+1)$; then $\rho \leq 1$. Our goal is to find an optimal ${\ensuremath{\mathsf{OA}}}_{\lambda}(k,n)$ for some value of $\lambda$. Note that $m / \lambda = \rho$ in such an OA. Also, $\overline{a} = (k-1)/n \geq 1$. One possible approach would be to take all possible $k$-tuples that contain precisely $\overline{a} = (k-1)/n$ occurrences of $0$, and then adjoin an appropriate number of rows consisting entirely of $0$’s. We illustrate the idea using a small example. \[ex6\] Suppose we take $k=7$ and $n=3$. Here we have $\rho = 3/5$ and $\overline{a} = 2$. There are $$\binom{7}{2} \times 2^5 = 21 \times 32 = 672$$ $7$-tuples on the symbol set $\{0,1,2\}$ that contain precisely two zeroes. If we then adjoin $48$ rows of $0$’s, it is not hard to check that we obtain an optimal ${\ensuremath{\mathsf{OA}}}_{80}(7,3)$. The ratio $\rho = m / \lambda = 48/80 = 3/5$, as required. Of course, we know from Example \[ex5\] that a basic ${\ensuremath{\mathsf{OA}}}_{5}(7,3)$ exists. The value of $\lambda$ in the above-constructed optimal ${\ensuremath{\mathsf{OA}}}_{80}(7,3)$ is much larger. As in Example \[ex6\], we take all possible $k$-tuples that contain precisely $\overline{a} = (k-1)/n$ occurrences of 0. In order to have an orthogonal array, any two columns must contain every ordered pair of symbols exactly $\lambda$ times, for some $\lambda$. Since every possible $k$-tuple containing $\overline{a}$ $0$’s is used, it suffices to consider the first two columns. If these two columns contain every ordered pair the same number of times, then so will every other pair of columns in the array. There are four cases to consider for the first two elements in a row: $00$, $0x$, $x0$, and $xy$, where $x, y \in \{1,\dots,n-1\}$. We consider these cases in turn. For each $x \in \{1, \dots, n-1\}$, there are $$\label{0x.eq} \binom{k-2}{\overline{a}-1}(n-1)^{k-\overline{a}-1}$$ rows beginning with $0x$. This result is the same for rows beginning with $x0$. For each $x,y \in \{1, \dots, n-1\}$, there are $$\label{xy.eq} \binom{k-2}{\overline{a}}(n-1)^{k-\overline{a}-2}$$ rows beginning with $xy$. Since $\overline{a} = (k-1)/n$, we find that $$\label{eq6} \frac{k-\overline{a}-1}{n-1} = \frac{k-1 - \frac{k-1}{n}}{n-1} = \frac{k-1}{n} = \overline{a}.$$ Using (\[eq6\]), it is now easy to show that (\[0x.eq\]) and (\[xy.eq\]) are equal: $$\begin{aligned} \binom{k-2}{\overline{a}}(n-1)^{k-\overline{a}-2} &=& \frac{k - \overline{a} - 1}{\overline{a}} \binom{k-2}{\overline{a}-1} \frac{(n-1)^{k-\overline{a}-1}}{n-1} \\ & = & \binom{k-2}{\overline{a}-1}(n-1)^{k-\overline{a}-1}.\end{aligned}$$ Therefore, each ordered pair other than $00$ appears the same number of times (given by (\[0x.eq\]) or (\[xy.eq\])), which we denote by $\lambda$. Thus, adjoining the appropriate number of rows consisting entirely of $0$’s will result in an orthogonal array. The number of rows beginning with $00$ is $${k-2 \choose \overline{a}-2}(n-1)^{k-\overline{a}}.$$ It then follows that we need to adjoin $$m = \lambda - {k-2 \choose \overline{a}-2}(n-1)^{k-\overline{a}}$$ rows of $0$’s. Substituting the value of $\lambda$ obtained from (\[0x.eq\]), we have $$\begin{aligned} m &=& \binom{k-2}{\overline{a}-1}(n-1)^{k-\overline{a}-1} - {k-2 \choose \overline{a}-2}(n-1)^{k-\overline{a}}\\ &=& \binom{k-2}{\overline{a}-1}(n-1)^{k-\overline{a}-1} - \frac{\overline{a}-1}{k - \overline{a}}\binom{k-2}{\overline{a}-1}(n-1)(n-1)^{k-\overline{a}-1} \\ &=& \binom{k-2}{\overline{a}-1}(n-1)^{k-\overline{a}-1} \left( 1 - \frac{(n-1)(\overline{a}-1)}{k - \overline{a}} \right)\\ & = & \lambda \left( 1 - \frac{(n-1)(\overline{a}-1)}{k - \overline{a}} \right).\end{aligned}$$ Therefore, substituting $\overline{a} = (k-1)/n$, we have $$\begin{aligned} \frac{m}{\lambda} &=& 1 - \frac{(n-1)(\overline{a}-1)}{k - \overline{a}}\\ & = & 1 - \frac{(n-1)(\frac{k-n-1}{n})}{k - \frac{k-1}{n}}\\ &=& 1 - \frac{(n-1)(k-n-1)}{kn-k+1}\\ &=& \frac{n^2}{k(n-1)+1}\\ &=& \rho,\end{aligned}$$ as desired. Thus we have proven the following result. \[general.thm\] Suppose $n^2 \leq k(n-1)+1$ and suppose $\overline{a} = (k-1)/n$ is an integer. Then there is an optimal ${\ensuremath{\mathsf{OA}}}_{\lambda}(k,n)$, where $$\label{general.eq} \lambda = \binom{k-2}{\overline{a}-1}(n-1)^{k-\overline{a}-1}.$$ An improvement -------------- We next show that the ${\ensuremath{\mathsf{OA}}}_{\lambda}(k,n)$ constructed in Theorem \[general.thm\] can be partitioned into $n-1$ optimal ${\ensuremath{\mathsf{OA}}}_{\lambda/(n-1)}(k,n)$. In order to describe how this is done, it is useful to change the set of symbols on which the OAs are defined. Suppose we begin with the above-mentioned ${\ensuremath{\mathsf{OA}}}_{\lambda}(k,n)$, constructed on symbols $0, \dots , n-1$. Delete the $m = \lambda n^2 / (k(n-1)+1)$ rows of $0$’s. Then we replace all occurrences of $0$ in the remaining rows by $\infty$, and the symbols $1, \dots , n-1$ are replaced by $0, \dots , n-2$, respectively. We consider the new symbol set as $\{\infty\} \cup {\ensuremath{\mathbb{Z}}}_{n-1}$. Denote the resulting array by $A$. For any row $\mathbf{r}$ of $A$, let $s(\mathbf{r})$ denote the sum of the non-infinite elements in row $\mathbf{r}$, reduced modulo $n-1$. Then, for any $i \in \{ 0,\dots, n-2\}$, let $A_i$ consist of all the rows $\mathbf{r}$ of $A$ such that $s(\mathbf{r}) = i$. Clearly every row of $A$ is in precisely one of $A_0, \dots , A_{n-2}$. It is obvious that every $A_i$ is fixed by any permutation of the columns. Therefore, the number of occurrences of a particular pair of symbols in two given columns does not depend on the two columns that are chosen. Hence, we can restrict our attention to the first two columns of these arrays. For two (not necessarily distinct) symbols $x,y \in \{\infty\} \cup {\ensuremath{\mathbb{Z}}}_{n-1}$ and for $0 \leq i \leq n-2$, let $\lambda_i(x,y)$ denote the number of occurrences of the ordered pair $(x,y)$ in the first two columns of $A_i$. Also, let $\lambda(x,y)$ denote the number of occurrences of $(x,y)$ in the first two columns of $A$. Therefore $$\lambda(x,y) = \begin{cases} \lambda & \text{if $(x,y) \neq (\infty,\infty)$} \\ \lambda - m & \text{if $(x,y) =(\infty,\infty)$,} \end{cases}$$ where $$\lambda = \binom{k-2}{\overline{a}-1}(n-1)^{k-\overline{a}-1}$$ and $$m = \frac{\lambda n^2 }{ k(n-1)+1}.$$ We will show, for any $x,y$, that $\lambda_i(x,y)$ is independent of $i$. First however, we state and prove a small technical lemma. \[tech.lem\] Suppose that $n \geq 2$, $\overline{a} = (k-1)/n$ is an integer and $\overline{a} \geq 1$. Then $\overline{a} +2 \leq k-1$ unless $n=2$, $k=3$ and $\overline{a} = 1$. First, suppose $\overline{a} \geq 2$, so $(k-1)/n \geq 2$. The following inequalities are equivalent: $$\begin{aligned} 2 + \overline{a} & \leq & k-1\\ 2 + \frac{k-1}{n} & \leq & k-1\\ \frac{(k-1)(n-1)}{n} & \geq & 2.\end{aligned}$$ However, $$\frac{(k-1)(n-1)}{n} \geq 2(n-1) \geq 2$$ because $n \geq 2$. Now, suppose $\overline{a} =1$ and $n \geq 3$, We have $k = n+1$, so it follows that $\overline{a} + 2 = 3 \leq n = k-1$. \[1.rem\] The exception to Lemma \[tech.lem\] is $n=2$, $k=3$ and $\overline{a} = 1$. But this is a trivial case, as a basic ${\ensuremath{\mathsf{OA}}}_{1}(3,2)$ exists, and this OA can trivially be “partitioned” into $n-1 = 1$ OAs. In the following discussion, we assume that $n \geq 2$, $\overline{a} = (k-1)/n$ is an integer, $\overline{a} \geq 1$, and $(n,k) \neq (2,3)$. We next define a mapping $f$ on the rows of $A$. Let $\mathbf{r}$ be any row of $A$, where $\mathbf{r} = (x_1, \dots , x_k)$. Let $j_0 = \min \{ j : 3 \leq j \leq k, x_j \neq \infty\}$ (there are $\overline{a}$ occurrences of $\infty$ in $\mathbf{r}$, so Lemma \[tech.lem\] ensures that $\{ j : 3 \leq j \leq k, x_j \neq \infty\} \neq \emptyset$ and hence $j_0$ exists). Let $\kappa \in {\ensuremath{\mathbb{Z}}}_{n-1}$. Define $f(\mathbf{r}) = (y_1, \dots, y_k)$, where $$y_j = \begin{cases} x_j + \kappa \bmod (n-1)& \text{if $j = j_0$,}\\ x_j & \text{otherwise}, \end{cases}$$ for $j = 1, \dots , k$. The process above can also be described as follows. Find the first entry in row $\mathbf{r}$, past the second column, that is not equal to $\infty$. Then add $\kappa$ modulo $n-1$ to that entry. It is clear that the mapping $f$ gives a bijection from the rows in $A_i$ to the rows in $A_{i+\kappa \bmod (n-1)}$, for $i \in {\ensuremath{\mathbb{Z}}}_{n-1}$. Also, $f$ leaves the points in the first two columns of any row of $A$ unaltered. Since $$\sum_{i \in {\ensuremath{\mathbb{Z}}}_{n-1}} \lambda_i(x,y) = \lambda(x,y),$$ we have $\lambda_i(x,y) = \lambda(x,y)/(n-1)$ for all $i \in {\ensuremath{\mathbb{Z}}}_{n-1}$. Therefore, if we adjoin $m/(n-1)$ rows of $\infty$’s to any $A_i$, we obtain an optimal ${\ensuremath{\mathsf{OA}}}_{\lambda}(k,n)$, where $$\lambda = \binom{k-2}{\overline{a}-1}(n-1)^{k-\overline{a}-2}.$$ The above discussion, along with Remark \[1.rem\], proves the following. \[partition.thm\] Suppose $n^2 \leq k(n-1)+1$ and suppose $\overline{a} = (k-1)/n \geq 1$ is an integer. Then there is an optimal ${\ensuremath{\mathsf{OA}}}_{\lambda}(k,n)$, where $$\lambda = \binom{k-2}{\overline{a}-1}(n-1)^{k-\overline{a}-1},$$ that can be partitioned into $n-1$ optimal ${\ensuremath{\mathsf{OA}}}_{\lambda/(n-1)}(k,n)$. \[improved.thm\] Suppose $n^2 \leq k(n-1)+1$ and suppose $\overline{a} = (k-1)/n \geq 1$ is an integer. Then there is an optimal ${\ensuremath{\mathsf{OA}}}_{\lambda}(k,n)$, where $$\lambda = \binom{k-2}{\overline{a}-1}(n-1)^{k-\overline{a}-2}.$$ We have noted that $\overline{a} = 1$ when $k = n+1$. A basic OA with these parameters is in fact an ${\ensuremath{\mathsf{OA}}}_{1}(n+1,n)$, which is equivalent to a projective plane of order $n$. However, in cases where a projective plane of order $n$ is known not to exist, Corollary \[improved.thm\] provides examples of ${\ensuremath{\mathsf{OA}}}_{\lambda}(n+1,n)$ for certain large values of $\lambda$. A further improvement --------------------- We now prove an extension of Theorem \[partition.thm\] where we can sometimes reduce the value of $\lambda$ by additional factors of $n-1$, depending on the parameters $k$ and $n$. Suppose we can write $k = k_1+ \dots + k_{\gamma}$, where $k_1, \dots , k_{\gamma}$ are integers such that $k_i \geq \overline{a}+3$ for $1 \leq i \leq \gamma$. Evidently, we can take $$\gamma = \left\lfloor \frac{k}{\overline{a}+3}\right\rfloor.$$ As before, our starting point is the optimal ${\ensuremath{\mathsf{OA}}}_{\lambda}(k,n)$ obtained from Theorem \[general.thm\] in which the symbol set is $\{\infty\} \cup {\ensuremath{\mathbb{Z}}}_{n-1}$. The value of $\lambda$ is given by (\[general.eq\]) and there are $m$ rows consisting only of $\infty$’s. Delete these $m$ rows and call the resulting array $A$. Now, we consider the columns of $A$ to be partitioned into $\gamma$ *classes*, where the $i$th class consists of $k_i$ columns. Denote these classes as ${\ensuremath{\mathcal{C}}}_1, \dots , {\ensuremath{\mathcal{C}}}_{\gamma}$. For any row $\mathbf{r}$ of $A$, let $s(\mathbf{r}) = (s_1, \dots , s_{\gamma})$, where, for $1 \leq i \leq \gamma$, $s_i$ is the modulo $n-1$ sum of the non-infinite elements in row $\mathbf{r}$ in the columns in ${\ensuremath{\mathcal{C}}}_i$. We will say that the $\gamma$-tuple $s(\mathbf{r})$ is the *type* of row $\mathbf{r}$. Then, for any possible type $\tau \in ({\ensuremath{\mathbb{Z}}}_{n-1})^{\gamma}$, let $A_{\tau}$ consist of all the rows $\mathbf{r}$ of $A$ such that $s(\mathbf{r}) = \tau$. (That is, $A_{\tau}$ comprises all the rows of $A$ having type $\tau$.) This yields a partition of the rows of $A$ into $(n-1)^{\gamma}$ subsets. We will show that each $A_i$, when augmented with an appropriate number of rows of $\infty$’s, is an optimal ${\ensuremath{\mathsf{OA}}}_{\lambda}(k,n)$, where $$\lambda = \binom{k-2}{\overline{a}-1}(n-1)^{k-\overline{a}-\gamma -1}.$$ The number of rows of $\infty$’s to be added to each $A_{\tau}$ to construct an orthogonal array is $m/(n-1)^{\gamma}$. We use a “bijection” proof similar to Theorem \[partition.thm\]. First, we note that any permutation of the columns within any column class ${\ensuremath{\mathcal{C}}}_i$ is an automorphism of every $A_{\tau}$. Therefore, to prove that $A_{\tau}$ yields an orthogonal array (as described above), we just need to consider the ordered pairs of symbols occurring in pairs of columns of the following types: (a) : the first two columns of any ${\ensuremath{\mathcal{C}}}_i$, and (b) : the first column of ${\ensuremath{\mathcal{C}}}_i$ and the the first column of ${\ensuremath{\mathcal{C}}}_j$, where $i \neq j$. We can use a bijection similar to Theorem \[partition.thm\], but we apply the bijection independently for every column class ${\ensuremath{\mathcal{C}}}_i$. Let $\mathbf{r}$ be any row of $A$, where $\mathbf{r} = (x_1, \dots , x_k)$. For each column class ${\ensuremath{\mathcal{C}}}_i$, let $j_i$ be the first column within ${\ensuremath{\mathcal{C}}}_i$, past the second column, that is not equal to $\infty$ (note that $j_i$ exists because $k_i \geq \overline{a}+3$). Fix any $\gamma$-tuple $\kappa \in ({\ensuremath{\mathbb{Z}}}_{n-1})^{\gamma}$. Define the mapping $f$ as follows: $f(\mathbf{r}) = (y_1, \dots, y_k)$, where $$y_j = \begin{cases} x_j + \kappa_i \bmod (n-1)& \text{if $j = j_i$ for some $i$,}\\ x_j & \text{otherwise}, \end{cases}$$ for $j = 1, \dots , k$. The mapping $f$ is a bijection from the rows in $A_{\tau}$ to the rows in $A_{\tau + \kappa \bmod (n-1)}$, for any $\tau \in ({\ensuremath{\mathbb{Z}}}_{n-1})^{\gamma}$. Also, for any row $\mathbf{r}$, $f$ leaves the points in the first two columns of every ${\ensuremath{\mathcal{C}}}_i$ unaltered. Therefore, the ordered pairs occurring in pairs of columns of types [**(a)**]{} and [**(b)**]{} in any $A_{\tau}$ is independent of $\tau$. Hence, we obtain the following theorem and corollary. \[partition2.thm\] Suppose $n^2 \leq k(n-1)+1$ and suppose $\overline{a} = (k-1)/n$ is an integer. Suppose $$\gamma = \left\lfloor \frac{k}{\overline{a}+3}\right\rfloor \geq 1.$$ Then there is an optimal ${\ensuremath{\mathsf{OA}}}_{\lambda}(k,n)$, where $$\lambda = \binom{k-2}{\overline{a}-1}(n-1)^{k-\overline{a}-1},$$ that can be partitioned into $(n-1)^{\gamma}$ optimal ${\ensuremath{\mathsf{OA}}}_{\lambda/(n-1)^{\gamma}}(k,n)$. \[improved2.thm\] Suppose $n^2 \leq k(n-1)+1$ and suppose $\overline{a} = (k-1)/n \geq 1$ is an integer. Suppose $$\gamma = \left\lfloor \frac{k}{\overline{a}+3}\right\rfloor \geq 1.$$ Then there is an optimal ${\ensuremath{\mathsf{OA}}}_{\lambda}(k,n)$, where $$\lambda = \binom{k-2}{\overline{a}-1}(n-1)^{k-\overline{a}-\gamma - 1}.$$ Suppose we take $k = 16$ and $n=3$. Then $\overline{a} = 5$ and $\gamma = 2$. From Corollary \[improved2.thm\], we obtain an optimal ${\ensuremath{\mathsf{OA}}}_{\lambda}(k,n)$, where $$\lambda = \binom{14}{4}2^{8}.$$ Deleting columns from optimal OAs {#delete.sec} ================================= An optimal ${\ensuremath{\mathsf{OA}}}_{\lambda}(k,n)$ can exist only when $k \equiv 1 \bmod n$. However, it is certainly of interest to determine the maximum possible ratio $m/\lambda$ for values of $k$ and $n$ where $k \not\equiv 1 \bmod n$. We might reasonably expect that deleting a small number of columns, say $s$ columns, from an optimal ${\ensuremath{\mathsf{OA}}}_{\lambda}(k,n)$ could yield an ${\ensuremath{\mathsf{OA}}}_{\lambda}(k-s,n)$ where the ratio $m/\lambda$ is as large as possible. Deleting a single column ------------------------ We first prove that this approach works for $s=1$ by proving a modification of Theorem \[repeated.thm\]. The modified bound uses a similar proof technique to [@St82 Theorem 3.1] (see also [@Stinson Theorem 8.7]). \[repeated2.thm\] Let $k \geq 2$, $n \geq 2$, $\lambda \geq 1$ be integers. Suppose $A$ is an ${\ensuremath{\mathsf{OA}}}_{\lambda}(k,n)$ containing a row $0 \; 0 \cdots 0$ that is repeated $m$ times, and let $\alpha$ be a positive integer. Then $$\label{modified.eq} m \leq \frac{\lambda(k(k-1) - 2\alpha k n + (\alpha^2+\alpha)n^2)}{k(k-1)-2\alpha k+\alpha^2+\alpha}.$$ Further, equality occurs if and only if every row has either $\alpha$ or $\alpha+1$ occurrences of the symbol 0. Suppose the last $m$ rows of $A$ are $0 \; 0 \cdots 0$. Let $a_i$ denote the number of occurrences of the symbol $0$ in row $i$ of $A$. Define $N = \lambda n^2$. It is clear from elementary counting that $$\begin{aligned} \sum _{i=1}^{N-m} a_i &=& k(\lambda n - m) \quad \text{and} \\ \sum _{i=1}^{N-m} a_i(a_i-1) &=& k(k-1)(\lambda - m). $$ Let $\alpha$ be a positive integer. Then $$\begin{aligned} 0 & \leq & \sum_{i=1}^{N-m} (a_i - \alpha)(a_i - \alpha - 1) \\ &=& \sum_{i=1}^{N-m} {a_i}(a_i-1) -2\alpha \sum_{i=0}^{N-m} a_i + (\alpha^2 + \alpha)(N-m) \\ &=& k(k-1)(\lambda-m) -2\alpha k(\lambda n - m) + (\alpha^2+\alpha)(\lambda n^2 -m).\end{aligned}$$ Solving for $m$, we obtain (\[modified.eq\]). In the case of equality, every term in the sum $$\sum_{i=1}^{N-m} (a_i - \alpha)(a_i - \alpha - 1)$$ must equal $0$. Therefore, $a_i \in \{\alpha,\alpha+1\}$ for every $i$. We examine a special case of the bound proven in Theorem \[repeated2.thm\]. Let $k \geq 2$, $n \geq 2$, $\lambda \geq 1$ be integers. If $k \equiv 0 \bmod{n}$ and there is an ${\ensuremath{\mathsf{OA}}}_{\lambda}(k,n)$ containing a row that is repeated $m$ times, then $$\label{bound2.eq} m \leq \frac{\lambda n^2}{k(n-1)+n}.$$ Write $k = sn$ for some integer $s$ and take $\alpha =s-1$ in Theorem \[repeated2.thm\]. We find that $$\begin{aligned} m &\leq &\frac{\lambda (sn(sn-1) -2(s-1)sn^2 + ((s-1)^2+(s-1))n^2)}{sn(sn-1)-2(s-1)sn + (s-1)^2 + s-1} \\ &=& \frac{\lambda (s^2n^2-sn-2s^2n^2 +2sn^2 +s^2n^2 -2sn^2 +n^2 +sn^2-n^2)}{s^2n^2-sn-2s^2n+2sn+s^2-2s+1+s-1} \\ &=& \frac{\lambda (sn^2-sn)}{s^2n^2-2s^2n+sn+s^2-s} \\ &=& \frac{\lambda sn(n-1)}{s^2(n-1)^2 + s(n-1)} \\ &=& \frac{\lambda n}{s(n-1) + 1} \\ &=& \frac{\lambda n^2}{k(n-1)+n}.\end{aligned}$$ Suppose there is an optimal ${\ensuremath{\mathsf{OA}}}_{\lambda}(k+1,n)$ containing a row that is repeated $m$ times. Then $k \equiv 0 \bmod n$ and there is an ${\ensuremath{\mathsf{OA}}}_{\lambda}(k,n)$ containing a row that is repeated $m$ times, where (\[bound2.eq\]) is met with equality. Let $A$ be an optimal ${\ensuremath{\mathsf{OA}}}_{\lambda}(k+1,n)$ containing a row $0 \; 0 \cdots 0$ that is repeated $m$ times. If we delete any one column from $A$, then the resulting array $A'$ is an ${\ensuremath{\mathsf{OA}}}_{\lambda}(k,n)$ containing a row $0 \; 0 \cdots 0$ that is repeated $m$ times. Since $A$ is optimal, we have $$m = \frac{\lambda n^2}{(k+1)(n-1)+1} = \frac{\lambda n^2}{k(n-1)+n}$$ from (\[m.eq\]), so (\[bound2.eq\]) is met with equality. Further, $\overline{a} = k/n$ must be a positive integer from Corollary \[a.cor\]. Deleting multiple columns ------------------------- We now consider a different approach. Suppose we return to our original bound, Theorem \[repeated.thm\]. Since $m$ must be an integer, the following variation is immediate. \[repeated3.thm\] Let $k \geq 2$, $n \geq 2$ and $\lambda \geq 1$ be integers. If there is an ${\ensuremath{\mathsf{OA}}}_{\lambda}(k,n)$ containing a row that is repeated $m$ times, then $$m \leq \left\lfloor \frac{\lambda n^2}{k(n-1)+1} \right\rfloor.$$ An orthogonal array for which the bound in Theorem \[repeated3.thm\] is met with equality will be termed *$m$-optimal*. Assume we start with an optimal ${\ensuremath{\mathsf{OA}}}_{\lambda}(k,n)$, so $$m = \frac{\lambda n^2}{k(n-1)+1} .$$ We determine how many columns we can remove, denoted by $s$, such that $$m = \left\lfloor\frac{\lambda n^2}{(k-s)(n-1)+1}\right\rfloor.$$ The resulting ${\ensuremath{\mathsf{OA}}}_{\lambda}(k,n)$ will be $m$-optimal. The following numerical lemma will be useful. \[s.ineq\] Suppose that $$m = \frac{\lambda n^2}{k(n-1)+1}$$ is an integer and $$\label{delete.eq} s < \frac{(k(n-1)+1)^2}{(n-1)(\lambda n^2 + k(n-1)+1)}$$ is a positive integer. Then $$m = \left\lfloor\frac{\lambda n^2}{(k-s)(n-1)+1}\right\rfloor .$$ From (\[delete.eq\]), we find that $$s(n-1)(\lambda n^2 + k(n-1)+1) < (k(n-1)+1)^2.$$ Rearranging this inequality, we see that $$s\lambda n^2(n-1) < ((k-s)(n-1)+1)(k(n-1) +1),$$ and therefore $$\begin{aligned} 1 &> &\frac{\lambda n^2s(n-1)}{((k-s)(n-1)+1)(k(n-1) +1)} \\ &= &\lambda n^2 \left( \frac{1}{(k-s)(n-1)+1} - \frac{1}{k(n-1)+1}\right).\end{aligned}$$ Since $m$ is an integer, this proves that $$m = \frac{\lambda n^2}{k(n-1)+1} = \left\lfloor\frac{\lambda n^2}{(k-s)(n-1)+1}\right\rfloor.$$ The following theorem is now an immediate consequence of Lemma \[s.ineq\]. \[deleted.thm\] If there is an optimal ${\ensuremath{\mathsf{OA}}}_{\lambda}(k,n)$ and $s$ is a positive integer such that (\[delete.eq\]) holds, then there is an $m$-optimal ${\ensuremath{\mathsf{OA}}}_{\lambda}(k-s, n)$. Let $A$ be an optimal ${\ensuremath{\mathsf{OA}}}_{\lambda}(k, n)$ containing a row that is repeated $m = \lambda n^2/(k(n-1)+1)$ times. If we delete any $s$ columns from $A$, then the resulting array $A'$ is an ${\ensuremath{\mathsf{OA}}}_{\lambda}(k-s, n)$ containing a row that is repeated $m$ times. From Lemma \[s.ineq\], we have that $$m = \left\lfloor\frac{\lambda n^2}{(k-s)(n-1)+1}\right\rfloor,$$ so the resulting ${\ensuremath{\mathsf{OA}}}_{\lambda}(k-s, n)$ is $m$-optimal. To illustrate the application of Theorem \[deleted.thm\], we consider the case $n = 2$. \[delete.cor\] Suppose there is a basic ${\ensuremath{\mathsf{OA}}}_{\lambda}(k,2)$ and suppose $$s < \frac{k+1}{3}$$ is a positive integer. Then there is an $m$-optimal ${\ensuremath{\mathsf{OA}}}_{\lambda}(k-s,2)$. From Lemma \[basicn=2\], a basic ${\ensuremath{\mathsf{OA}}}_{\lambda}(k,2)$ has $\lambda = 2t+1$ and $k = 4t+1$, where $t$ is a positive integer, and $m=2$. If we take $n = 2$, $k = 4t+1$, and $\lambda = 2t+1$ in (\[delete.eq\]), the inequality becomes $$\begin{aligned} s &<& \frac{(k(n-1)+1)^2}{(n-1)(\lambda n^2 + k(n-1)+1)}\\ &=& \frac{(k+1)^2}{4\lambda + k + 1} \\ &=& \frac{(4t+2)^2}{4(2t+1)+(4t+1)+1} \\ &=& \frac{4t+2}{3}\\ &=& \frac{k+1}{3}.\end{aligned}$$ The stated result now follows from Theorem \[deleted.thm\]. For $1 \leq s \leq 4$, there is an $m$-optimal ${\ensuremath{\mathsf{OA}}}_7(13-s,2)$. Begin with a basic ${\ensuremath{\mathsf{OA}}}_7(13,2)$ (Example \[OA7,13,2\]) and take $k=13$ in Theorem \[delete.cor\]. We now discuss some examples of $m$-optimal OAs from Culus and Toulouse [@CT]. \[mopt.ex\] Some OAs reported in [@CT Table 4] are in fact $m$-optimal: - an ${\ensuremath{\mathsf{OA}}}_3(4,2)$ with $m=2$ - an ${\ensuremath{\mathsf{OA}}}_5(8,2)$ with $m=2$ - an ${\ensuremath{\mathsf{OA}}}_5(6,3)$ with $m=3$. All of these OAs can be obtained by deleting a column from a basic OA. Finally, the ${\ensuremath{\mathsf{OA}}}_3(5,3)$ with $m=2$ that is depicted in [@CT Table 2] is also $m$-optimal. We make a few observations about the inequality in Theorem \[repeated3.thm\]. In Section \[prelim.sec\], we noted that taking multiple copies of an optimal OA would yield another optimal OA. However, a similar result does not hold for $m$-optimal OAs. To illustrate, we consider OAs with $k=5$ and $n=3$. For an ${\ensuremath{\mathsf{OA}}}_{\lambda}(5,3)$, Theorem \[repeated3.thm\] asserts that $$m \leq \left\lfloor \frac{9 \lambda}{11} \right\rfloor.$$ The ${\ensuremath{\mathsf{OA}}}_3(5,3)$ with $m=2$ mentioned in Example \[mopt.ex\] is $m$-optimal because $\lfloor \frac{27}{11} \rfloor = 2$. If we take two copies of this OA, we obtain an ${\ensuremath{\mathsf{OA}}}_6(5,3)$ with $m=4$. This OA is $m$-optimal because $\lfloor \frac{54}{11} \rfloor = 4$. However, if we take three copies of the ${\ensuremath{\mathsf{OA}}}_{3}(5,3)$, we obtain an ${\ensuremath{\mathsf{OA}}}_9(5,3)$ with $m=6$, which is not $m$-optimal because $\lfloor \frac{81}{11} \rfloor = 7 > 6$. (We do not know if an ${\ensuremath{\mathsf{OA}}}_9(5,3)$ with $m=7$ exists.) Finally, consider a hypothetical $OA_{11}(5,3)$. Here, Theorem \[repeated3.thm\] yields $m \leq 9$. An $OA_{11}(5,3)$ with $m=9$ would be optimal, because (\[m.eq\]) holds. However, an optimal $OA_{11}(5,3)$ cannot exist by Corollary \[a.cor\], because $5 \not\equiv 1 \bmod 3$. Therefore there is no $m$-optimal $OA_{11}(5,3)$. Summary {#summary.sec} ======= Clearly there is much work to be done on the problem of constructing optimal and basic orthogonal arrays. At present, we only have a couple of examples of basic OAs with $n > 2$. Thus, it is of particular interest to construct additional examples, or better yet, infinite classes of these arrays. Acknowledgements {#acknowledgements .unnumbered} ================ This work benefitted from the use of the CrySP RIPPLE Facility at the University of Waterloo. [X]{} J.-F. Culus and S. Toulouse. How far from a worst solution a random solution of a $k$ CSP instance can be? [*Lecture Notes in Computer Science*]{} [**10979**]{} (2018), 374–386 (IWOCA 2018). A.S. Hedayat, N.J.A. Sloane and John Stufken. [*Orthogonal Arrays, Theory and Applications.*]{} Springer, 1999. R. Mukerjee, P. Qian and J. Wu. On the existence of nested orthogonal arrays. [*Discrete Math.*]{} [**308**]{} (2008), 4635–4642. D.R. Stinson. Applications and generalizations of the variance method in combinatorial designs. [*Utilitas Math.*]{} **22** (1982), 323–333. D.R. Stinson. [*Combinatorial Designs, Constructions and Analysis*]{}, Springer, 2004. D.R. Stinson. Bounds for orthogonal arrays with repeated rows. [*Bulletin of the ICA*]{}, to appear. [^1]: D.R. Stinson’s research is supported by NSERC discovery grant RGPIN-03882.
The Full Spectrum Tip! Heading to a pool party? Elevate Magazine tells readers that Colorescience Sunforgettable Mineral Sunscreen Brush SPF 50 stands up to even the splashiest of days, which means you can stay matte and protected, even after a swim. Reapply frequently.
Q: Closing Service Cloud Case Milestones using Apex I am having a look at Case milestones and entitlement processes that are part of the service cloud. I want to programmatically close one of the milestones after a certain Status value has been selected in the Case object, as suggested in the Entitlements Best Practice page. Use Apex code to automatically mark milestones as Completed on cases that match unique criteria. For example, you can create an Apex trigger on EmailMessage that marks a first response milestone as Completed on cases when support reps send email from cases. However, when I wrote a trigger to attempt this I found out that the IsCompleted field of the CaseMilestone object seems to be unwritable. (I checked in workbench as well and it has updateable : false for the IsCompleted field) How would I close the milestone as suggested in the best practices docs? Thanks A: You need to populate the CaseMilestone record's CompletionDate that will make the IsCompleted field true.
Q: AppleScript clipboard isn't being properly set each time the script is run I have an AppleScript I am running that saves the current clipboard to a temporary variable, sets the clipboard to something else (in this case an emoji), pastes the clipboard into a field, and then reverts the clipboard to what it was before the script was run. set temp to the clipboard set the clipboard to "" tell application "System Events" keystroke "v" using command down end tell set the clipboard to temp It works correctly when it is first run but if its run two or more times, it'll paste the emoji the first time followed by the original clipboard every other time after that. A: I was able to solve the issue on my end by just adding a delay... set temp to the clipboard set the clipboard to "" tell application "System Events" keystroke "v" using command down delay 0.3 end tell set the clipboard to temp
An Incredible Movie, An Incredible Conversation, An Incredible Identity A close friend and I sat outside the movie theatre. Incredibles 2 was showing — a movie we had both already seen, which provided a perfect opportunity to chat about our lives, and reflect on our ongoing experience facilitating a pre-orientation program for incoming first-years. The program consisted of 80 first-years and 40 upperclassmen. While the program didn’t have quite the diversity of students that the Duke campus does, it did include a diverse crowd across all areas of identity. The vast majority of students, first-years especially, did not know one another before coming to this program. In theory, everyone had an equal opportunity to introduce themselves, make first impressions, and forge friendships. This made for quite a unique sociology experiment, my friend and I thought, as we discussed our observations. We were particularly interested in observing the friendships that formed as the week-long program progressed. Now was the time we could share our observations and compare our “field notes.” “Did you see who people sat with during lunch today?” he asked. I answered affirmatively, laughing to myself, as I was about to ask him the same question. Perhaps it was because we were both hungry, or perhaps it was because we both intrinsically knew that food brings people together in a way nothing else can. When people eat, they satiate an instinctual desire. People want to eat in good company. “Yes, I did. People sat with others who looked like them, who identified with the same race and came from similar ethnic backgrounds,” I quickly replied. My response was met by a nod of agreement from my friend who remarked, “It’s interesting that race and ethnicity seem to be the most impactful categories of identity, the categories that both separate and bring us together most.” He paused for a second, considering something and then asked me a question about my identity. A question I have been struggling to answer my entire life: “Hey, Andrew, I know you’re Jewish… Do you consider that to be your race, ethnicity, or something else?” Thoughts about my identity started rushing through my mind. What did our observations imply for a Jew living in a Christian society, on a secular campus that features a 210-foot chapel at its center. Most importantly, how can I answer the questions “what is my ethnicity?” and “what is my race?” I began answering his question by giving him context. “When people ask my family their race or ethnicity they answer ‘Jewish’ without hesitating, as if it were an ethnicity, a nationality, a race, and a religion all scooped up into one. I learned this at a young age. And, when I learned it, I thought it was pretty cool that all my identities could be expressed with a singular word, so I began asking my friends at school what they considered themselves, preparing myself to proudly say I was Jewish after they had answered with their singular ethnic-national-racial-religious identity. “However, much to my elementary-school-self’s surprise, none of the responses were what I had expected. I received answers ranging from ‘Italian’ to ‘African American’ to ‘Latino(a)’ to ‘Chinese,’ and while these answers did talk about race, ethnicity, and nationality, they only spoke about one or two of them at a time. And, most shocking to me, not one of my friends answered with their religious beliefs. My young self didn’t care about the complexities among race, ethnic, national, and religious identities. All my young self cared about was how special and efficient it was to say I am Jewish, as it answered all identity questions with a singular word.” “Well, not quite,” I retorted. “As I got older and progressed through school, I began to question my answer to the question ‘what am I?’ I learned about racism in the U.S., about its historical context internationally, and about how important race is to people. I learned the difference between race and ethnicity, how people are born a certain race and how race is entirely a societal construct. I even learned about diversity among Jewish people. And, I no longer found it sufficient to say I was Jewish. Judaism after all is just a religion. One can convert to Judaism, but it is impossible to convert to a different race, ethnicity, or nationality. So I began answering the question ‘what am I?’ differently. My new answer was ‘A Caucasian American-Jew.’” “Okay, that makes sense,” he exclaimed. “So you have since called yourself…” “Not quite,” I said, cutting him off. “I called myself that until I explained my new identity to my grandparents, Holocaust refugees. They responded to my explanation with their experience living through anti-semitism in a world that wanted to ‘destroy the Jewish race.’ My other set of grandparents supplemented this with their experience having difficulties finding employment options because they were Jewish, calling it a form of racism. I did research of my own and found numerous articles documenting anti-semitism in the U.S. and abroad, calling it a form of racism. I was back to square one. When people asked what was I, my response would be ‘Jewish,’ just Jewish. This went unchallenged up until my first few weeks at Duke…” “What happened then?” “Well, as you know, on Duke’s campus many are proud of their identity. Most students, myself included, are put in a new environment with a diversity of peers they are not akin to. I grew up in a mostly white and predominantly Jewish community. In my neighborhood, one street alone had four synagogues on it. Now, at Duke, most of my peers were not Jewish, and were more racially diverse than I was accustomed to. Now, there were no streets nearby with anything remotely close to five synagogues. “So, I felt a drive, stronger than I ever felt in high school, to embrace my heritage, my Judaism. I felt that if I didn’t express it, it might be lost and drown in the sea of cultures now surrounding me, and, while I looked forward to understanding other traditions, I felt a strong need to protect and express my own.” I paused as my friend sat pensively. Sewing his thoughts into words, he said, “I imagine your experience is similar to other students at Duke. I imagine the drive you felt to both understand others and express yourself is the main reason multicultural groups and spaces exist…” “Hmm, maybe. That’s an interesting thought,” I responded. “But last year, Orientation Week taught me a lot and really set the stage for further discovery about my identity.” “What do you mean?” “Well, when O-Week came, I mustered up the courage to socialize. I mastered the script quickly: ‘Hi my name is Andrew, I’m planning to major in economics and statistics (changed to economics and environmental science and policy and ethics since then), I’m from New York, and I live in Gilbert-Addoms.’ Typically there would be a few follow-up questions and occasionally the conversation would drift to a different topic, but for the most part, that script would sum it up. I couldn’t tell you how many people I met, nor could I tell you their names more than five minutes after interacting with them. This pattern of mindless introductions continued until I met someone special, someone who broke the script. ‘Well, it’s great that you are from New York, but I want to know what you consider yourself. What are you?’ she inquired as we stood outside a dorm. ‘I’m Jewish,’ I responded almost instinctually. ‘Wow, my first Jew,’ she cheerfully exclaimed. It is astounding how many times I have gotten that response since….” My friend chuckled a bit as I continued. “I later became her first ‘White male friend,’ which was both an honor and privilege, one I am still grateful for. Coming from her mostly non-white neighborhood, the most identifying factor about me was the color of my skin. As I made more friends at Duke, this pattern continued. I was considered a Jewish-Caucasian, while I considered myself a Caucasian-Jew. I struggled with this greatly, reconsidering once more if Judaism is a race. I thought, perhaps I can be both Caucasian and Jewish. This was a good compromise after all. It pleased my grandparents and my friends, and gave me peace of mind. My search for identity was finally solved.” “Okay, so you consider yourself Jewish and Caucasian. That’s easy,” he said frankly. “Well, I did… up until reading period.” “What happened then?” he asked. “During reading period, I was walking from East Campus to the Freeman Center when I came across a poster from a white-supremacist organization advocating for the ‘creation a pure white, European race,’ the first step of which was to ‘eliminate Jews.’ I researched more about groups like this, and found many neo-Nazi organizations looking to create a pure White race through eliminating Jews, among other racial minorities.” “Whoa. How did that make you feel?” he asked. “This was my first encounter with blatant anti-semitism and the first time that I was forced to make a decision about how I identified. I was fine with calling myself Caucasian and Jewish, but it seemed society wasn’t. These groups were racist, and Jews were on their list as races to exterminate. Judaism must be a race then, right? No. You cannot convert to a race but you can convert to Judaism, and you don’t have to have a certain skin color to be Jewish. Race is something that can be seen, and Judaism is not. How can I call myself just Jewish, when I benefit from White Privilege in other aspects of my life? “These thoughts buzzed around in my mind, as my anger grew at the sight of the poster on Duke’s campus — my campus. I was in an identity crisis. I was angry. I was confused. To other minority groups, I was considered ‘white,’ and to Caucasian groups I was considered ‘Jewish.’ No matter where I turned I felt like an outsider.” “I never realized you felt like that. That was only a few months ago. How do you feel now?” “Still confused,” I said. “But instead of feeling like an outsider, I feel welcomed. I am talking to a close friend after all.” He smiled. “While I still struggle with defining my race, my ethnicity, my nationality etc., the importance of finding a clear definition has faded. I am talking to you, a close friend. A friend who will accept me for being me…” We sat there in silence for a bit, and I thought: Perhaps that is the beauty of diversity. Perhaps we are striving toward accepting others while embracing what makes us unique, getting a little closer to this ideal everyday. I like being me, and no matter how others choose to define me, I will refuse to be anything but me. I am still searching for how to categorize my Judaism. I still am unsure about how to define my identity, but I am now comfortable with the unknown… The movie ended, and my friend, the comedian that he is, said, “Now wasn’t that movie really incredible?” Once more I agreed with him, and I added. “The conversation was too.” Thank you for reading. Feel free to email me your comments at carlins101@gmail.com. I would love to hear from you!
Antibiotic surgical prophylaxis increases nasal carriage of antibiotic-resistant staphylococci. Staphylococci are a significant cause of hospital-acquired infection. Nasal carriage of Staphylococcus aureus is an important risk factor for infection in surgical patients and coagulase-negative staphylococci (CNS) are a major cause of prosthetic joint infections. The impact that antibiotic surgical prophylaxis has on the nasal carriage of staphylococci has not been studied. Daily nasal swabs were taken from 63 patients who received antibiotic surgical prophylaxis and 16 patients who received no antibiotics. Total aerobic bacterial count, S. aureus and CNS were enumerated by culture from nasal swabs. Representative isolates were typed by staphylococcal interspersed repeat units (SIRU) typing and PFGE, and MICs to nine antibiotics were determined. After antibiotic administration, there was a reduction in S. aureus counts (median - 2.3 log(10)c.f.u. ml(- 1)) in 64.0 % of S. aureus carriers, compared with only a 0.89 log(10)c.f.u. ml(- 1) reduction in 75.0 % of S. aureus carriers who did not receive antibiotics. A greater increase in the nasal carriage rate of meticillin-resistant CNS was observed after antibiotic surgical prophylaxis compared with hospitalization alone, with increases of 16.4 and 4.6 %, respectively. Antibiotic-resistant S. epidermidis carriage rate increased by 16.6 % after antibiotic administration compared with 7.5 % with hospitalization alone. Antibiotic surgical prophylaxis impacts the nasal carriage of both S. aureus and CNS.
Q: Flow being fired twice when pressing a custom button. By interview.apexp? I just created a flow that looks up an account and displays a screen to allow the user to enter values in a textbox and select something from a dropdown. It then creates an opportunity using some account information and data entered on the screen and creates an opportunity contact role. The flow is fired by clicking on a custom button on the account. The flow will run and open the screen to allow me to enter values. I click next and the flow creates the opportunity and the opportunity contact role. Then the same screen is displayed again, essentially either creating another opportunity/contact role or requiring me to exit out of the flow. This is very annoying. In attempting to debug the problem, I opened up the developer console to look at the logs. I see when I click the button to start the flow, a log file with the operation of /flow/create_partner_opportunity is created. This is expected as that is the name of my flow, but after I fill out the screen element and click next (a.k.a. when the opportunity and contact role are created), two more logs are created with the same operation of /flow/interview.apexp. I need this behavior to stop. I do not know if the interview.apexp is what is causing this issue, but figured it was a likely culprit. Google wasn't much help in revealing others with this problem. Thanks in advance. A: This is because nothing has been defined on what the Flow should do when it is done, so it will always go back to the beginning of the Flow. It's not very well documented, but it is established behavior. In the URL of your custom button, try adding this to the end of the URL: ?retURL=/[merge field of your choice] For example, if you Flow URL is /flow/create_partner_opportunity, the URL would be something like: /flow/create_partner_opportunity?varOppID={!Opportunity.Id}&retURL=/{!Opportunity.Id} This would return you to the Opp from which you clicked the button. The retURL argument tells the URL which page the flow should return you to when it has finished.
Living with a star The 'Living with a Star: Surviving Near our Explosive Sun' stand organised by Dr Lucie Green (UCL Mullard Space Science Laboratory) was a great success at the prestigious Royal Society Summer Exhibition 2007, with more than 4,000 people visiting the stand. The annual Royal Society exhibition, this year held from 2 to 5 July, is a showcase of the best of UK science and illustrates how science is a major part of everyday life. The Sun produces huge and powerful eruptions called coronal mass ejections, which throw masses of charged particles into space with explosive force. Some of these inevitably reach the Earth, creating beautiful aurora in the polar skies, but also with the potential to wreak havoc with our telecommunications and electricity networks. 'Living with a Star' is based on the work of research institutes across the UK that are using data from two new space missions - STEREO and Hinode - to better understand the Sun's behaviour, and plan for solar storms that might affect the Earth. Dr Green said: "There was a nice mix of students, teachers, the public and then VIPs. The science interactives, where the visitors could explore magnetic fields and ultra violet light, meant that we could then relate these to the erupting magnetic structures that we are studying by imaging the Sun in UV light. The highlight was definitely the 3D movies that we had of the eruptions. The movies are made from the data from the STEREO mission and it's the first time they have been shown at an exhibition like this. The teachers particularly liked our stand because we also discussed the ways in which the Sun affects the Earth - this is now in some of the science syllabi. Talking to the teachers helps to answer their questions. but also builds their confidence in teaching the subject." To find out more, use the links at the top of this article. Image 1: A young boy becomes familiar with magnetic fieldsImage 2: The 3D film of the Sun was very popularImage 3: The display Image 4: The VIP evening
Q: How can I select a specific button with an id? I am new to JavaScrip and I would like to know how I can select a submit button with a specific ID. I tried to use "getElementById" but the console prints "null". HTML CODE <html> <head> <script type="text/javascript" src="script.js"></script> </head> <body> <h1> Welcone to the booking site </h1> <h4> Please, choose a destination </h4> </body> <form name="myTravelForm"> <select name="destination"> <option value="Antarctica" selected>Antarctica</option> <option value="Costa Rica">Costa Rica</option> </select> <input type="button" value="Add this destination" id="banana" /> </form> <div id="travelerInfo"></div> </html> JavaScript code var x; x = document.getElementById("banana") console.log(x) A: Your code is relatively correct you need to put all html within body tags. Also your script gets triggered before the document is finished with loading fully. You should put your script before closing body, so it gets triggered after all DOM elements are loaded. <html> <head> </head> <body> <h1> Welcone to the booking site </h1> <h4> Please, choose a destination </h4> <form name="myTravelForm"> <select name="destination"> <option value="Antarctica" selected>Antarctica</option> <option value="Costa Rica">Costa Rica</option> </select> <input type="button" value="Add this destination" id="banana"/> </form> <div id="travelerInfo"></div> <script type="text/javascript" src="script.js"></script> </body> </html> There is also solution to leave script.js within head tag, but wrap the code within a function and call it within onload placed within body tag as an attribute. In script.js: function findID(){ var x; x = document.getElementById("banana") console.log(x) } Within body tag: <body onload="findID();"> Or you can leave your script.js within <head> tag but wrap the code within with an window.onload or document.onload. This might be the most elegant solution. window.onload = function(e){ var x; x = document.getElementById("banana") console.log(x) }
Planet 9 cannot hide forever, and new research has narrowed the range of possible locations further! In January of 2016, astronomers Mike Brown and Konstantin Batygin published the first evidence that there might be another planet in our Solar System. Known as “Planet 9” (“Planet X” to some), this hypothetical body was believed to orbit at an extreme distance from our Sun, as evidenced by the orbits of certain extreme Kuiper Belt Objects (eKBOs). Since that time, multiple studied have been produced that have attempted to place constraints on Planet 9’s location. The latest study once again comes from Brown and Batygin, who conducted an analytical assessment of all the processes that have indicated the presence of Planet 9 so far. Taken together, these indications show that the existence of this body is not only likely, but also essential to the Solar System as we know it. The study, titled “Dynamical Evolution Induced by Planet Nine“, recently appeared online and has been accepted for publication in The Astronomical Journal. Whereas previous studies have pointed to the behavior of various populations of KBOs as proof of Planet 9, Brown and Batygin sought to provide a coherent theoretical description of the dynamical mechanisms responsible for these effects. In the end, they concluded that it would be more difficult to imagine a Solar System without a Planet 9 than with one. As Konstantin Batygin explained in a recent NASA press statement: “There are now five different lines of observational evidence pointing to the existence of Planet Nine. If you were to remove this explanation and imagine Planet Nine does not exist, then you generate more problems than you solve. All of a sudden, you have five different puzzles, and you must come up with five different theories to explain them.” In 2016, Brown and Batygin described the first three lines of observational evidence for Planet 9. These include six extreme Kuiper Belt Objects which follow highly elliptical paths around the Sun, which are indicative of an unseen mechanism affecting their orbit. Second is the fact that the orbits of these bodies are all tilted the same way – about 30° “downward” to the plane of the Kuiper Belt. The third hint came in the form of computer simulations that included Planet 9 as part of the Solar System. Based to these simulations, it was apparent that more objects should be tilted with respect to the Solar plane, on the order of about 90 degrees. Thanks to their research, Brown and Batygin found five such objects that happened to fit this orbital pattern, and suspected that more existed. Since the publication of the original paper, two more indications have emerged for the existence of Planet 9. Another involved the unexplained orbits of more Kuiper Belt Objects which were found to be orbiting in the opposite direction from everything else in the Solar System. This was a telltale indication that a relatively close body with a powerful gravitational force was affecting their orbits. And then there was the argument presented in a second paper by the team – which was led by Elizabeth Bailey, Batygin’s graduate student. This study argued that Planet 9 was responsible for tilting the orbits of the Solar planets over the past 4.5 billion years. This not only provided additional evidence for Planet 9, but also answered a long standing mystery in astrophysics – why the planets are tilted 6 degrees relative to the Sun’s equator. As Batygin indicated, all of this adds up to a solid case for the existence of a yet-to-discovered massive planet in the outer Solar System: “No other model can explain the weirdness of these high-inclination orbits. It turns out that Planet Nine provides a natural avenue for their generation. These things have been twisted out of the solar system plane with help from Planet Nine and then scattered inward by Neptune.” Recent studies have also shed some light on how and where Planet 9 originated. Whereas some suggested that the planet moved to the edge of the Solar System after forming closer to the Sun, others have suggested that it might be an exoplanet that was captured early in the Solar System’s history. At present, the favored theory appears to be that it formed closer to the Sun and migrated outward over time. Granted, there is not yet a scientific consensus when it comes to Planet 9 and other astronomers have offered other possible explanations for the evidence cited by Batygin and Brown. For instance, a recent analysis based on the Outer Solar System Origins Survey – which discovered more than 800 new Trans-Neptunian Objects (TNOs) – suggests that the evidence could also be consistent with a random distribution of such objects. In the meantime, all that remains is to find direct evidence of the planet. At present, Batygin and Brown are attempting to do just that, using the Subaru Telescope at the Mauna Kea Observatory in Hawaii. The detection of this planet will not only settle the matter of whether or not it even exists, it will also help resolve a mystery that emerged in recent years thanks to the discovery of thousands of extra-solar planets. In short, thanks to the discovery of 3,529 confirmed exoplanets in 2,633 solar systems, astronomers have noticed that statistically, the most likely types of planets are “Super-Earths” and “mini-Neptunes” – i.e. planets that are more massive than Earth but not more than about 10 Earth masses. If Planet 9 is confirmed to exist, which is estimated to have 10 times the Mass of Earth, then it could explain this discrepancy. Planet 9, we know you’re out there and we will find you! Unless you’re not, in which case, disregard this message! Further Reads: NASA
Q: How to cluster color images based on color value? I am trying to cluster a sample color image of a surface into known number of clusters defined by user. I know that intensity variations due to lighting artifacts is troubling. Does anyone know a robust intensity-invariant algorithm to implement this clustering with known number of clusters? additions: I'm using matlab. Clues I have found till now are using HSV and CIE Lab color spaces. A: There are several color models that separate color from intensity information. Pick one and use it. Matlab supports several conversions: RGB->YIO RGB->HSV RGB->YCbCr ... https://de.mathworks.com/help/images/understanding-color-spaces-and-color-space-conversion.html
MH370 Malaysia Airlines (MAS) will hold a private service in remembrance of its personnel aboard the ill-fated MH370 which vansihed on March 8 last year, this Sunday. The service is a private affair which will only be attended by the family of MAS personnel who had perished in the accident and also by its employees, a MAS spokesperson told Bernama today. “Grief and loss are an intensely personal thing. Each family involved will want to mark the occasion in their own way, away from the glare of the media. “So as the many families involved gather privately to remember their loved ones who were on MH370, we will assemble the MAS family to devote time to our own private reflection and remembrance,” she said when asked on the airline’s plan for the one-year anniversary for MH370. The dispearance of the Boeing 777 flight MH370 with its 12 crew and 227 passengers from the radar screen while en route from Kuala Lumpur to Beijing about an hour after departing the KL International Airport at about 12.41am on March 8 last year, was officially declared by the Malaysian government on Jan 29 this year as an accident under international aviation rules, and that all 239 passengers and crew aboard are presumed to have lost their lives. The Malaysian government has also stressed that the search for the Boeing 777 remains a priority, and it is committed to continue all reasonable efforts to bring closure to this unfortunate tragedy, with the continuing cooperation and assistance of the governments of China and Australia. - Bernama
Dev Anand ALIVE and kicking What do George W. Bush, Fidel Castro, Queen Elizabeth, Pope John Paul II, Khushwant Singh, Nelson Mandela, Ronald Reagan, Margaret Thatcher, Britney Spears, Justin Timberlake and Dev Anand have in common? All these famous figures have been reported dead some or the other time, before they actually entered the other world. Yes! In the last couple of hours there have been strong rumors in a section of the media about the demise of yesteryears superstar Dev Anand. But Dale Bhagwagar, the publicist of his forthcoming film Charge Sheet has clarified that Bollywood’s ‘evergreen hero’ is not only hale and hearty, but working at breakneck speed, completing the post-production of his latest movie. “The rumors have no truth in them,” said Bhagwagar, and added, “Dev Saab has been working nonstop on the background score of Charge Sheet and was actually watching television when these rumors broke out. I called him up late in the night at his Mumbai residence to check if everything was alright, and we ended up having a hearty laugh over it at 1.30 am. Right now, he’s charged about Charge Sheet. As I have known him, he possesses more energy than many of the young makers of today. Dev Anand, till date, is a man on a mission. The heavens can wait.”
Pages Friday, July 8, 2016 ENLIVEN THE GRANDEUR OF ISLAMIC INTELLECTUALISM For the month of June, the Monthly Graduate Supervision of the Centre for Islamic Development Management Studies (ISDEV), Universiti Sains Malaysia (USM) took place on 17 June, 2016 at Dewan Kuliah A (DKA). However for this month's programme, the Graduate Supervision Lecture preceded the Tarbiyyah Pengarah. This month's Graduate Supervision lecture was presented by ISDEV Deputy Director, Dr. Fadzila Azni Ahmad who is also ISDEV Academic Programme Coordinator. Dr. Fadzila Azni, or more affectionately known in ISDEV by the name of Dr. Sukainah, conveyed on "Thesis Guidelines" as formatted by USM. Dr. Sukainah stated that knowing how to write a thesis in the correct format was important to students before the start of the study because it would facilitate and help students familiarize with the correct format from the onset. Thus having the right format from the start will also facilitate the lecturers during the review. The Thesis Guidelines as outlined by the Institute of Postgraduate Studies (IPS), USM was described in detail by Dr. Sukainah. After a long discussion, the students were very actively involved in the questions and answers session to find out more about the format and the correct way of writing according to the USM format. Prof Syukri introducing the topic of his tarbiyyah for that day - Enliven the Grandeur of Islamic Intellectualism. The end of the Graduate Supervision Lecture session marked the start of Tarbiyyah Pengarah. In this month's Tarbiyyah, ISDEV Director, Professor Dr. Muhammad Syukri Salleh, conveyed the upbeat spirit of Ramadhan to ISDEV lecturers, students and supporting staff. His address was on "Mencipta Semula Kegemilangan" (Enliven the Grandeur of Islamic Intellectualism). In the early part of his Tarbiyyah, Prof Syukri introduced ISDEV fraternity on one of ISDEV main ambitions - to recreate the glory of Islam as discerned from the history of Islamic civilisation such as during the Golden Age in Baghdad. Back then, Baghdad was the seat of knowledge where Islamic intellectuals were very highly sought out and highly regraded in such a manner that Western scientists boldly stated that there was no Golden Age of Islamic Civilisation after that. A brain teaser intended to bring across an important lesson - the power of communication skills. Then Prof Syukri went on a positive note expressing his confidence that ISDEV is positioned to bring back the glory of Islamic In his pragmatically optimistic outlook, he voiced rather matter-of-factly that although such a goal might not be achieved in the near future, it is nonetheless not impossible for the next generation of ISDEV. They are the ones who would be interacting more with the society. Even if it takes another 100 years, it is not impossible for ISDEV to recreate and bring back the glory of Islam. Before elaborating his points further, Professor Syukri gave a mind teaser to ISDEV fraternity who were present. The puzzle was intended to bring across a stark reminder on the importance of communication skills as to the delivery of the correct communication frequency. When it is correct and the approach to communication is accurate and precise (based on one's situation and level of thinking), then a positive outcome can ensue from the person whom we interacted with. Posing a pertinent question - Do you want to reconstruct the glory of Islamic intellectualism? Prof. Syukri then provided an in-depth analysis of the teaser. He raised questions among ISDEV members on what was actually needed to move a further step closer towards the point of the reconstruction of the Golden Age in Islam. For this to be a reality, Prof Syukri encouraged all ISDEV members to be prepared to make sacrifices and also to create new research entities. This entails moving away from the norm which is currently embarked upon by ISDEV students. But such move to think out of the box (norm) needs to be done more aggressively for the renaissance of Muslims to occur. ISDEV lecturers and students are therefore encouraged to go far out to spread ISDEV thinking that seeks to glorify Islam. He provided the justification on the dire need to pursue knowledge because the nature of knowledge is as such:- Knowledge is to be awaited. Knowledge is to be sought. Knowledge awaits not. Knowledge seeks not. Making a comparison on seeking knowledge between back then and now. If ISDEV wants to build even a speckle of the Golden Age era back, Prof Syukri reiterated the words of Imam Malik which bears the following meaning when translated in the English Language:- 'The later umat would not be decently good except when they are corrected in the manner of the people of the yesteryears'. Taking the spirit of these wise words from Imam Malik, it is thus in ISDEV to want to follow more of these Islamic intellectualism traditions especially in seeking knowledge such as having those whose words are "bermulut masin", morally good and upright, respectable so that when people come and meet any ISDEV member, they would feel gratified in such a manner that when they returned home, they knew and felt that had gained useful knowledge. Hopefully by then, ISDEV could be a magnet that would be the one to initiate the return of the Golden Age of Islam not just by adhering to the traditions of Islamic intellectualism but also with the use and help of facilities and tools that exist today. The continuation of points on the comparison on seeking knowledge between back then and now. He uttered these words after making a comparison between the study of past and present to all who were there. Before ending his tarbiyyah, Prof. Syukri then gave his closing remarks by giving words of encouragement and a fatherly reminder for all to work together to achieve this ambition. He ended off with the reassurance that although ISDEV current members may not be able to achieve such a feat in the near future, have trust in Allah SWT that the efforts towards that goal would still earn every ISDEV member the qualifications for rewards, in shaa Allah. The attendance at DKA for this month's programme. In his closing, Professor Muhammad Syukri Salleh gave an opportunity for all to ask questions. He also took the opportunity to acknowledge the hard work and dedication of ISDEV support staff. They are Puan Aishah, Cik Adawiyah, Encik Helmi, Encik Ibrahim, Puan Farhana and Puan Aznida) because they are very important personnel in ISDEV. They are always ready and willing to help ISDEV lecturers and students to achieve their goals.
/** * Copyright 2013-2020 the original author or authors from the JHipster project. * * This file is part of the JHipster project, see http://www.jhipster.tech/ * for more information. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ const JDLEnum = require('../../models/jdl-enum'); const { formatComment } = require('../../utils/format-utils'); module.exports = { convertEnums }; /** * Converts a parsed JDL content corresponding to enumerations to an array of JDLEnum objects. * @param {Array} enumerations - parsed JDL enumerations. * @return {Array<JDLEnum>} the converted JDLEnums. */ function convertEnums(enumerations) { if (!enumerations) { throw new Error('Enumerations have to be passed so as to be converted.'); } return enumerations.map(enumeration => convertEnum(enumeration)); } /** * Converts a parsed JDL content corresponding to an enumeration to a JDLEnum object. * @param {Object} enumeration - a parsed JDL enumeration. * @return {JDLEnum} the converted JDLEnum. */ function convertEnum(enumeration) { return new JDLEnum({ name: enumeration.name, values: enumeration.values, comment: formatComment(enumeration.javadoc), }); }
Organizations acquire the right to use electronic resources (e.g., software or hardware functions) through a complex set of electronically-enforceable agreements that provide specific terms under which the electronic resources may be used. Each agreement can grant rights to an entity account or a device to access one or more electronic resources under one or more electronically-enforceable constraints (e.g., according to the terms). A resource control system can examine and enforce these rights. For example, the electronically-enforceable agreement can be referred to as a “license.” The resource control system can also include a distribution system. The distribution system can account for consumption of individual rights (e.g., “entitlements”) to one or more electronic resources. A license entitlement is a consumable representation of a key that provides access (e.g., with electronically-enforceable constraints) to an electronic resource or a set of electronic resources. The license entitlement can be “consumed” by per usage, per account, per device, per time period, or any combination thereof. When the parties (e.g., an end-user device and the distribution system) commit to the grant of an entitlement, the end-user device is said to have “consumed” the license entitlement. This can be referred to as a license consumption event. It should be noted that some agreements may or may not be electronically enforceable, and license entitlements may or may not be enforced before a resource is permitted to be used. Compliance with an agreement can be evaluated after the fact, for example during an audit, based on electronic records of usage of the resources by entities and/or devices (license consumption events). It is common for each license consumption event to have more than one potential license entitlement, e.g., license type, that may grant the requested rights of a consumption demand request. For example, access to a software application can be provisioned using an instance-based license that allows any entity to access a specified instance of the software application, that is, an instance of the software application executing on a specified computer. In another example, the access can be provisioned using user-based license that allows a specified user to access any instance of the software application, that is, any instance of software application executing on any of the computers. Various such license types can be provisioned. Further, the associated cost of each license type can be different. Also, an agreement may be flexible as to specific numbers of license entitlements of various types. The organization is liable for license entitlements actually consumed over a period of time, and the organization is free to choose the combination of license entitlements across various types (e.g., to minimize cost) as long as this combination is sufficient to cover all the recorded license consumption events. In a typical organization, a combination of such license types may be provisioned. When this ambiguity (e.g., having multiple possible variations of license entitlements to consume) exists, enterprises (e.g., potential consumers of the license entitlements) generally desire to obtain the most cost effective entitlement to accomplish the desired task associated with the desired electronic resource. This can serve to minimize the cost of utilizing the electronic resource. For example, the organization may want to determine how many instance-based license types and user-based license types (and for which users) are to be obtained to satisfy the demand in a most cost-effective way. Due to the large number of possibilities across usage constraint types and due to frequent changes to terms of electronically-enforceable agreements, resource versions, resource variations, resource editions, agreement editions, resource consumption patterns, or any combination thereof, it is often impractical for any organization or person to conduct such an optimization exercise in a reasonable amount of time. This challenge is further exacerbated by variance in usage channels (e.g., usage of resources from physical installations, remote usage with technologies such as application or desktop virtualizations, global usage rights, etc.). A typical distribution system may need to process millions of consumption demand requests and grant just as many entitlements within a short period of time. Accordingly, conventional distribution systems are unable to optimize its assignments of license entitlement in an effective manner.
Searching for Honda CR-V Wheel Bearing & Hub - Front Shop at 1A Auto for replacement front Wheel Bearings and front Wheel Hubs for your Honda CR-V, at great prices. 1A Auto has a large selection of front Wheel Bearing and front Wheel Hub Assembly replacements for your Honda CR-V, and ground shipping in the continental U.S. is always free! Visit us online or call us at 888-844-3393 and order your Honda CR-V front Wheel Hub Bearing or Wheel Bearing Hub Assembly today!
News How has Donald Trump, a thuggish racist billionaire who boasted of sexual assaults on women, won the US presidency? It is a result that sends shockwaves across the world. It must be met by increased resistance. Features The election of right wing Republican Donald Trump as US president has led to shock—and sparked protests. Activists across the US spoke to Alistair Farrow about the result, the aftermath and how they are fighting back Other Categories A big campaign has taken off in Cambridgeshire to defend nursery schools. Last week parents, governors, teachers, support staff, Labour councillors, the local MP and others joined together to launch the campaign.
Q: What are good services for checking the external IP of a machine? I'm working with an API that requires the machine's external IP. I have come understand that I can't do this without relying on an external server. I've used whatismyip.com in the past: wget -q -O - http://whatismyip.com/automation/n09230945.asp What are some other services for checking the external IP of a machine? Since I'm concerned about a single point of failure, I'd like to have a few options to which I can fail over. A: curl -s http://checkip.dyndns.org | sed 's/[a-zA-Z/<> :]//g' Now, I didn't write that myself, just doing some research for you. http://www.geekology.co.za/blog/2009/04/checking-your-internal-and-external-ip-addresses-on-a-unix-machine/ Or wget -O -q icanhazip.com A: http://api.externalip.net/ip works fine for me, great uptime and fast. no reg exp needed
Q: c++ simple sum in for loop i am using g++ (GCC) 4.6.0 and i am having trouble to producing the correct result. given the following simple for loop in c++ void sum(){ int sum; for(int i=0,sum=0;i<=10;sum+=i,++i); cout << sum << endl; } the output is giving me 0. suppose within the for loop i added cout << sum << endl; it give me 0,1,3... until the very last line 0; I think the reason I am getting 0 is because variable shadowing in the for loop? so I tried ::sum as in ::sum=0, and ::sum +=i. but it complains by the compiler. Also I tried for(sum=0,int i=0;i<=10;sum+=i,++i); the compiler also complains about not having primary expression in the first clause in the for loop A: Really, you have to use the identifier sum three times for three different things? :-S Just write it readbly: int sum = 0; for(int i = 0; i <= 10; ++i) { sum += i; } No more confusion, no more shadowing, no more uninitialized variables. Who are you trying to trick? Think about your replacement who will have to learn and understand your code! Tip: Turn on compiler warnings! PS: Before anyone talks about efficiency and starts counting CPU cycles: a) don't. b) hug your wife. c) compare the assembly of this code and your code. A: int i=0,sum=0 is not the same as int i=0; sum=0;. It is one statement that declares two variables. This means that you are shadowing the outer sum: void sum() { int sum; // <-- one `sum` for (int i=0,sum=0;i<=10;sum+=i,++i) {} // <-- second `sum` cout << sum << endl; } Only a declaration statement like that can be in the first clause of the for preamble (think about whether sum=0,int i=0 would be valid elsewhere in your code), but you can workaround this issue by pulling out the "initialisation" to 0 entirely: void sum() { int sum = 0; for (int i = 0; i <= 10; sum += i, ++i) {} cout << sum << endl; } Or, so that it's actually legible: void sum() { int sum = 0; for (int i = 0; i <= 10; i++) { sum += i; } cout << sum << endl; } A: Change your code to: void sum(){ int sum = 0; for(int i=0;i<=10;sum+=i,++i); // all work is in for loop cout << sum << endl; } Some (older) compilers wouldn't allow your original code, because you were defining a second sum inside your for loop which was hiding the original one. So, it was accumulating correctly within the for loop, but the sum defined outside the for loop was left untouched. For a little more detail: int i = 0, sum = 0; is the same as: int i = 0; int sum = 0;
Q: Unexpected behaviour of function used in conjunction with lapply/sapply? This mult_six <- function(x) { y <- x * 6 } mult_six(7) returns nothing (as expected), and y is not globally assigned (also as exptected, since assignment takes place in the scope of the function, not in the parent environment - so y returns Error: object 'y' not found - completely normal) But sapply(c(1,2,3), mult_six) returns [1] 6 12 18 (and lapply() returns the list equivalent). I do not understand why lapply/sapply would behave any differently to calling the function on each element separately? A: As we know functions by default return the last line in the function, however, since a value is assigned in this function it doesn't explicitly display the result but if you use print you can see it. print(mult_six(7)) #[1] 42
2nd blizzard bearing down on Plains region DODGE CITY, Kan. (AP) -- A second major winter storm is bearing down on the central Plains, forcing cancellations and sending public works crews scrambling for salt and sand supplies less than a week after another system dumped more than a foot of snow on parts of the region. The National Weather Service has issued a blizzard watch through late Monday for much of Kansas because of the storm system that's tracking across western Texas into Oklahoma, Kansas and Missouri. The storm could leave up to 15 inches of snow in some sections of Texas and Kansas, where a storm last week dumped about a foot. More than a foot of snow is possible from the Texas Panhandle, across the Oklahoma Panhandle and into Kansas and possibly Missouri as the storm moves eastward from the southwestern United States. Joe Pajor, deputy director of public works in Wichita, Kan., says "It would have been nice if we'd had a few days to recover, to do some equipment rehab." Wichita saw its second-highest snowfall ever Thursday with 14.2 inches. Weather officials say the storm also could spawn tornadoes Tuesday in Louisiana, Mississippi, Alabama, the Florida Panhandle and Georgia.
life in a nut cell the book is set in a world dictated by people's auras. they are rage, grief, ecstasy, vigilance, and terror. the story follows a boy named muta, who was born into a poor family. in order to overcome his odds of granting his family a chance to have a better life, he decided to take a step into cell academy, where he faces many challenges and makes new friends.
Ketocoumarin dyes as electron mediators for visible light induced carboxylate photorelease. Photoinduced mediated electron transfer to N-alkylpicolinium(NAP)-based esters has previously been shown to induce release of carboxylate anions. In this mechanism, electrons are shuttled between a good electron donor through a sensitizer/mediator to the NAP group which subsequently induces C-O bond cleavage. Previous studies have used UV-absorbing mediators to initiate substrate release with high photorelease efficiencies, but require long irradiation periods for quantitative deprotection. The current study improves upon previous systems by using lower energy visible light absorbing mediators that induce substrate release over shorter irradiation periods (i.e. higher overall photolytic efficacies).
# Translation of Odoo Server. # This file contains the translation of the following modules: # * account_move_line_stock_info # # Translators: # OCA Transbot <transbot@odoo-community.org>, 2017 msgid "" msgstr "" "Project-Id-Version: Odoo Server 9.0c\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-01-21 02:12+0000\n" "PO-Revision-Date: 2017-01-21 02:12+0000\n" "Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n" "Language-Team: Dutch (Belgium) (https://www.transifex.com/oca/teams/23907/" "nl_BE/)\n" "Language: nl_BE\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: account_move_line_stock_info #: model:ir.model.fields,field_description:account_move_line_stock_info.field_stock_move__account_move_line_ids msgid "Account Move Line" msgstr "" #. module: account_move_line_stock_info #: model:ir.model,name:account_move_line_stock_info.model_account_move_line msgid "Journal Item" msgstr "" #. module: account_move_line_stock_info #: model_terms:ir.ui.view,arch_db:account_move_line_stock_info.view_move_form #: model_terms:ir.ui.view,arch_db:account_move_line_stock_info.view_picking_form msgid "Journal Items" msgstr "Boekingslijnen" #. module: account_move_line_stock_info #: model:ir.model,name:account_move_line_stock_info.model_stock_move #: model:ir.model.fields,field_description:account_move_line_stock_info.field_account_move_line__stock_move_id msgid "Stock Move" msgstr ""
# Generated from qtooltip.pro. ##################################################################### ## qtooltip Binary: ##################################################################### qt_internal_add_manual_test(qtooltip SOURCES main.cpp PUBLIC_LIBRARIES Qt::Gui Qt::Test Qt::Widgets )
Q: Is it legal to stream DVD? This is going to be a long question: I'm working on creating a company to stream the latest and greatest movies that haven't reached Netflix yet. In order to do this, my plan is to buy, say, 10 Harry Potter DVDs, and rip one of them. We will then monitor how many people are streaming it and limit it to 10, the number of DVDs we have. It won't hurt the sales of the movie, because we're purchasing the correct number of DVDs. This is equivalent to just sending a DVD to a user, just online. We won't lend out(a.k.a. stream) more DVDs than we have. Update: How is Vidangel legal if they do just this? A: This is not legal. Buying a consumer DVD grants a licence for personal use - you can watch it, you can watch it with friends and family, you can lend it to friends and family so they can watch it. You cannot display it to the public. Services like Netflix have commercial licences with the copyright owners that allow them to do what they do. The copyright owners decide when and if they will sell that licence to Netflix and this is informed by how their DVD sales are going.
[Progress in molecular medicine: "laser capture microdissection"]. With the unravelling of the human genome, we now face the challenge of defining the function and clinical relevance of single genes. To do this, we should be able to isolate normal and diseased cells from complex tissue structures to make them accessible to sensitive molecular analyses. Laser Capture Microdissection (LCM) was developed to meet this challenge. LCM allows the precise dissection of cells with the help of a laser beam under direct visualization in the microscope, and the sterile transfer of these cells into a DNA or RNA isolation buffer. The technique is ideal for investigating cell-cell interactions, for performing mutation analyses, and for the production of high-quality cDNA libraries. Expression studies of known and unknown genes are currently employed successfully to define tissue- and simple cell-specific patterns which help elucidate the etiology and pathogenesis of colon, lung, breast, prostate, adrenal, ovary, and other organ tumors. The LCM system developed at the NIH is, therefore, an important part of the Cancer-Genome Anatomy Project (CGAP), which sequences and publishes the structures of genes that are expressed in human tumors. In combination with the modern cDNA arrays, it will thus be possible to analyze the expression of several thousands of genes in one step and to develop individual therapeutic strategies in the not too distant future. The LCM is a major advance in molecular medicine, enabling us to combine highly-sensitive gene analysis techniques with conventional histologic and morphologic methods. Applications range from research to diagnosis, and to monitoring disease progression.
Certification Achieving the designation of Certified Occupational Hygienist (COH) recognises that you practice in a professionally competent, independent and ethical manner, and shows you are a leader in your field. COH is the highest level of professional occupational hygiene expertise recognised by the AIOH and international agencies. Certification is an internationally recognised badge of competence, benchmarked with standards applicable in other parts of the world. The reward for becoming a COH is the personal satisfaction of knowing you have achieved the highest standard in Australia and you are recognised for your knowledge and experience by professional peers in occupational hygiene. Members who achieve this status are entitled to use the post-nominals COH. COHs have completed relevant tertiary studies and been working in the field of occupational hygiene or one of its specialist branches for more than five years in a professional capacity. COHs have demonstrated to the Council that they have achieved a satisfactory level of professional knowledge and competence through successful completion of an oral examination. They also make an ongoing commitment to excellence and maintaining their professional currency through ongoing professional development.
Index: lcdproc-0.5.9/clients/lcdproc/main.c =================================================================== --- lcdproc-0.5.9.orig/clients/lcdproc/main.c 2017-04-21 12:43:48.000000000 +0200 +++ lcdproc-0.5.9/clients/lcdproc/main.c 2017-12-06 23:36:54.674753530 +0100 @@ -58,7 +58,6 @@ int sock = -1; char *version = VERSION; -char *build_date = __DATE__; int lcd_wid = 0; int lcd_hgt = 0; Index: lcdproc-0.5.9/server/main.c =================================================================== --- lcdproc-0.5.9.orig/server/main.c 2017-04-24 22:17:15.000000000 +0200 +++ lcdproc-0.5.9/server/main.c 2017-12-06 23:36:47.550605856 +0100 @@ -104,7 +104,6 @@ char *version = VERSION; char *protocol_version = PROTOCOL_VERSION; char *api_version = API_VERSION; -char *build_date = __DATE__; /**** Configuration variables ****/ @@ -197,8 +196,8 @@ /* Report that server is starting (report will be delayed) */ report(RPT_NOTICE, "LCDd version %s starting", version); - report(RPT_INFO, "Built on %s, protocol version %s, API version %s", - build_date, protocol_version, api_version); + report(RPT_INFO, "Protocol version %s, API version %s", + protocol_version, api_version); clear_settings();
The 53-man roster for the Kansas City Chiefs has gone through some changes since it was first assembled. There have been some new faces added to the team in the past couple of weeks, while some others have departed. Injuries and roster composition have forced some of the new changes in Kansas City. Take a look at the gallery below and familiarize yourself with the current 53-man roster organized by jersey number: 2. P Dustin Colquitt Kansas City Chiefs punter Dustin Colquitt (2) gives autographs at NFL football training camp Saturday, July… Kansas City Chiefs punter Dustin Colquitt (2) gives autographs at NFL football training camp Saturday, July 27, 2019, in St. Joseph, Mo. (AP Photo/Charlie Riedel) more 4. QB Chad Henne Jan 20, 2019; Kansas City, MO, USA; Kansas City Chiefs quarterback Chad Henne (4) against the… Jan 20, 2019; Kansas City, MO, USA; Kansas City Chiefs quarterback Chad Henne (4) against the New England Patriots during the AFC championship game at Arrowhead Stadium. Mandatory Credit: Mark J. Rebilas-USA TODAY Sports more 7. K Harrison Butker Oct 7, 2018; Kansas City, MO, USA; Kansas City Chiefs kicker Harrison Butker (7) kicks the… Oct 7, 2018; Kansas City, MO, USA; Kansas City Chiefs kicker Harrison Butker (7) kicks the opening kickoff during the game against the Jacksonville Jaguars at Arrowhead Stadium. Mandatory Credit: Denny Medley-USA TODAY Sports more 8. QB Matt Moore Kansas City Chiefs quarterback Matt Moore (8) throws against the Denver Broncos during the second half… Kansas City Chiefs quarterback Matt Moore (8) throws against the Denver Broncos during the second half of an NFL football game, Thursday, Oct. 17, 2019, in Denver. (AP Photo/David Zalubowski) more 10. WR Tyreek Hill Oct 7, 2018; Kansas City, MO, USA; Kansas City Chiefs wide receiver Tyreek Hill (10) runs… Oct 7, 2018; Kansas City, MO, USA; Kansas City Chiefs wide receiver Tyreek Hill (10) runs the ball against Jacksonville Jaguars cornerback Jalen Ramsey (20) during the second half at Arrowhead Stadium. Mandatory Credit: Denny Medley-USA TODAY Sports more 11. WR Demarcus Robinson KANSAS CITY, MO – DECEMBER 30:Demarcus Robinson #11 of the Kansas City Chiefs puts his arms… KANSAS CITY, MO – DECEMBER 30:Demarcus Robinson #11 of the Kansas City Chiefs puts his arms up after catching the fiftieth touchdown pass of the season for his quarterback Patrick Mahomes #15 during the third quarter of the game against the Oakland Raiders at Arrowhead Stadium on December 30, 2018 in Kansas City, Missouri. (Photo by David Eulitt/Getty Images) more 12. WR Gehrig Dieter Jan 12, 2019; Kansas City, MO, USA; Kansas City Chiefs wide receiver Gehrig Dieter (12) reacts… Jan 12, 2019; Kansas City, MO, USA; Kansas City Chiefs wide receiver Gehrig Dieter (12) reacts after a play during the first quarter against the Indianapolis Colts in an AFC Divisional playoff football game at Arrowhead Stadium. Mandatory Credit: Mark J. Rebilas-USA TODAY Sports more 13. WR Byron Pringle DETROIT, MI – SEPTEMBER 29: Byron Pringle #13 of the Kansas City Chiefs is tackled by… DETROIT, MI – SEPTEMBER 29: Byron Pringle #13 of the Kansas City Chiefs is tackled by Will Harris #25 of the Detroit Lions in the fourth quarter at Ford Field on September 29, 2019 in Detroit, Michigan. (Photo by Rey Del Rio/Getty Images) more 14. WR Sammy Watkins Sep 23, 2018; Kansas City, MO, USA; Kansas City Chiefs wide receiver Sammy Watkins (14) is… Sep 23, 2018; Kansas City, MO, USA; Kansas City Chiefs wide receiver Sammy Watkins (14) is introduced before the game against the San Francisco 49ers at Arrowhead Stadium. The Chiefs won 38-27. Mandatory Credit: Denny Medley-USA TODAY Sports more 15. QB Patrick Mahomes KANSAS CITY, MO – AUGUST 10: Patrick Mahomes #15 of the Kansas City Chiefs throws a… KANSAS CITY, MO – AUGUST 10: Patrick Mahomes #15 of the Kansas City Chiefs throws a first quarter pass against the Cincinnati Bengals during a preseason game at Arrowhead Stadium on August 10, 2019 in Kansas City, Missouri. (Photo by David Eulitt/Getty Images) more 17. WR Mecole Hardman PITTSBURGH, PA – AUGUST 17: Mecole Hardman #17 of the Kansas City Chiefs celebrates after a… PITTSBURGH, PA – AUGUST 17: Mecole Hardman #17 of the Kansas City Chiefs celebrates after a 17 yard touchdown reception in the second quarter during a preseason game against the Pittsburgh Steelers at Heinz Field on August 17, 2019 in Pittsburgh, Pennsylvania. (Photo by Justin Berl/Getty Images) more 20. CB Mo Claiborne Kansas City Chiefs' Morris Claiborne is seen during the first half of a preseason NFL football… Kansas City Chiefs' Morris Claiborne is seen during the first half of a preseason NFL football game against the Green Bay Packers Thursday, Aug. 29, 2019, in Green Bay, Wis. (AP Photo/Morry Gash) more 21. CB Bashaud Breeland KANSAS CITY, MO – AUGUST 10: Kansas City Chiefs defensive back Bashaud Breeland (21) with his… KANSAS CITY, MO – AUGUST 10: Kansas City Chiefs defensive back Bashaud Breeland (21) with his defensive teammates between plays in the first half of an NFL preseason game between the Cincinnati Bengals and Kansas City Chiefs on August 10, 2019 at Arrowhead Stadium in Kansas City, MO. (Photo by Scott Winters/Icon Sportswire via Getty Images) more 22. S Juan Thornhill Kansas City Chiefs defensive back Juan Thornhill (22) during the first half of an NFL preseason… Kansas City Chiefs defensive back Juan Thornhill (22) during the first half of an NFL preseason football game against the Cincinnati Bengals in Kansas City, Mo., Saturday, Aug. 10, 2019. (AP Photo/Colin E. Braley) more 23. S Armani Watts Jul 27, 2019; Kansas City, MO, USA; Kansas City Chiefs defensive back Armani Watts (23) walks… Jul 27, 2019; Kansas City, MO, USA; Kansas City Chiefs defensive back Armani Watts (23) walks to the field during training camp at Missouri Western State University. Mandatory Credit: Denny Medley-USA TODAY Sports more 24. DB Jordan Lucas KANSAS CITY, MO - OCTOBER 07: Jordan Lucas #24 of the Kansas City Chiefs celebrates with… KANSAS CITY, MO - OCTOBER 07: Jordan Lucas #24 of the Kansas City Chiefs celebrates with teammates after intercepting a pass during the game against the Jacksonville Jaguars at Arrowhead Stadium on October 7, 2018 in Kansas City, Missouri. (Photo by Jamie Squire/Getty Images) more 25. RB LeSean McCoy Sep 29, 2019; Detroit, MI, USA; Kansas City Chiefs running back LeSean McCoy (25) runs the… Sep 29, 2019; Detroit, MI, USA; Kansas City Chiefs running back LeSean McCoy (25) runs the ball during the first quarter against the Detroit Lions at Ford Field. Mandatory Credit: Raj Mehta-USA TODAY Sports more 26. RB Damien Williams KANSAS CITY, MO - AUGUST 24: Damien Williams #26 of the Kansas City Chiefs runs past… KANSAS CITY, MO - AUGUST 24: Damien Williams #26 of the Kansas City Chiefs runs past Kwon Alexander #56 of the San Francisco 49ers for a 62-yard touchdown catch in the first quarter of a preseason game at Arrowhead Stadium on August 24, 2019 in Kansas City, Missouri. (Photo by David Eulitt/Getty Images) more 27. CB Rashad Fenton Kansas City Chiefs cornerback Rashad Fenton (27) during the first half of an NFL preseason football… Kansas City Chiefs cornerback Rashad Fenton (27) during the first half of an NFL preseason football game against the Cincinnati Bengals in Kansas City, Mo., Saturday, Aug. 10, 2019. (AP Photo/Colin E. Braley) more 29. CB Kendall Fuller Aug 17, 2019; Pittsburgh, PA, USA; Pittsburgh Steelers tight end Vance McDonald (89) runs after a… Aug 17, 2019; Pittsburgh, PA, USA; Pittsburgh Steelers tight end Vance McDonald (89) runs after a catch as Kansas City Chiefs cornerback Kendall Fuller (29) defends during the first quarter at Heinz Field. Mandatory Credit: Charles LeClaire-USA TODAY Sports more 31. RB Darrel Williams Dec 13, 2018; Kansas City, MO, USA; Kansas City Chiefs running back Darrel Williams (31) runs… Dec 13, 2018; Kansas City, MO, USA; Kansas City Chiefs running back Darrel Williams (31) runs for a touchdown against Los Angeles Chargers safety Jahleel Addae (37) in the first half at Arrowhead Stadium. Mandatory Credit: Jay Biggerstaff-USA TODAY Sports more 32. S Tyrann Mathieu Kansas City Chiefs free safety Tyrann Mathieu (32) warms up before an NFL football game against… Kansas City Chiefs free safety Tyrann Mathieu (32) warms up before an NFL football game against the Pittsburgh Steelers, Saturday, Aug. 17, 2019, in Pittsburgh. (AP Photo/Don Wright) more 34. RB Darwin Thompson Aug 24, 2019; Kansas City, MO, USA; Kansas City Chiefs running back Darwin Thompson (25) catches… Aug 24, 2019; Kansas City, MO, USA; Kansas City Chiefs running back Darwin Thompson (25) catches a pass during the first half against the San Francisco 49ers at Arrowhead Stadium. Mandatory Credit: Denny Medley-USA TODAY Sports more 35. CB Charvarius Ward Aug 17, 2019; Pittsburgh, PA, USA; Pittsburgh Steelers running back Benny Snell (24) carries the ball… Aug 17, 2019; Pittsburgh, PA, USA; Pittsburgh Steelers running back Benny Snell (24) carries the ball against Kansas City Chiefs cornerback Charvarius Ward (35) during the second quarter at Heinz Field. Mandatory Credit: Charles LeClaire-USA TODAY Sports more 41. LS James Winchester Sep 18, 2016; Houston, TX, USA; Kansas City Chiefs long snapper James Winchester (41) against the… Sep 18, 2016; Houston, TX, USA; Kansas City Chiefs long snapper James Winchester (41) against the Houston Texans at NRG Stadium. Mandatory Credit: Troy Taormina-USA TODAY Sports more 42. FB Anthony Sherman Jan 1, 2017; San Diego, CA, USA; Kansas City Chiefs fullback Anthony Sherman (42) walks through… Jan 1, 2017; San Diego, CA, USA; Kansas City Chiefs fullback Anthony Sherman (42) walks through the tunnel before the game against the San Diego Chargers at Qualcomm Stadium. Mandatory Credit: Orlando Ramirez-USA TODAY Sports more 44. LB Dorian O'Daniel Oct 1, 2018; Denver, CO, USA; Kansas City Chiefs linebacker Dorian O'Daniel (44) against the Denver… Oct 1, 2018; Denver, CO, USA; Kansas City Chiefs linebacker Dorian O'Daniel (44) against the Denver Broncos at Broncos Stadium at Mile High. Mandatory Credit: Mark J. Rebilas-USA TODAY Sports more 49. S Daniel Sorensen KANSAS CITY, MO - DECEMBER 30: Daniel Sorensen #49 of the Kansas City Chiefs begins to… KANSAS CITY, MO - DECEMBER 30: Daniel Sorensen #49 of the Kansas City Chiefs begins to run towards the end zone after an interception during the first quarter of the game against the Oakland Raiders at Arrowhead Stadium on December 30, 2018 in Kansas City, Missouri. (Photo by David Eulitt/Getty Images) more 50. LB Darron Lee Aug 17, 2019; Pittsburgh, PA, USA; Kansas City Chiefs inside linebacker Darron Lee (50) reacts as… Aug 17, 2019; Pittsburgh, PA, USA; Kansas City Chiefs inside linebacker Darron Lee (50) reacts as he defends against the Pittsburgh Steelers during the second quarter at Heinz Field. Pittsburgh won 17-7. Mandatory Credit: Charles LeClaire-USA TODAY Sports more 52. DE Demone Harris Tampa Bay Buccaneers linebacker Demone Harris (53) runs through a drill during an NFL football training… Tampa Bay Buccaneers linebacker Demone Harris (53) runs through a drill during an NFL football training camp practice Sunday, July 28, 2019, in Tampa, Fla. (AP Photo/Chris O'Meara) more 53. LB Anthony Hitchens Sep 9, 2018; Carson, CA, USA; Kansas City Chiefs linebacker Anthony Hitchens (53) gestures during the… Sep 9, 2018; Carson, CA, USA; Kansas City Chiefs linebacker Anthony Hitchens (53) gestures during the second quarter against the Los Angeles Chargers at StubHub Center. Mandatory Credit: Jake Roth-USA TODAY Sports more 54. LB Damien Wilson Kansas City Chiefs outside linebacker Damien Wilson (54) celebrates recovering a fumble against the Pittsburgh Steelers… Kansas City Chiefs outside linebacker Damien Wilson (54) celebrates recovering a fumble against the Pittsburgh Steelers in the first half of a preseason NFL football game, Saturday, Aug. 17, 2019, in Pittsburgh. (AP Photo/Don Wright) more 55. DE Frank Clark KANSAS CITY, MO - AUGUST 24: Defensive end Frank Clark #55 of the Kansas City Chiefs… KANSAS CITY, MO - AUGUST 24: Defensive end Frank Clark #55 of the Kansas City Chiefs celebrates with defensive end Chris Jones #95, after sacking quarterback Jimmy Garoppolo #10 of the San Francisco 49ers during the first half of a preseason game at Arrowhead Stadium on August 24, 2019 in Kansas City, Missouri. (Photo by Peter Aiken/Getty Images) more 56. LB Ben Niemann Aug 17, 2018; Atlanta, GA, USA; Kansas City Chiefs linebacker Ben Niemann (56) returns an interception… Aug 17, 2018; Atlanta, GA, USA; Kansas City Chiefs linebacker Ben Niemann (56) returns an interception for a touchdown in the fourth quarter against the Atlanta Falcons at Mercedes-Benz Stadium. Mandatory Credit: Jason Getz-USA TODAY Sports more 59. LB Reggie Ragland Jan 20, 2019; Kansas City, MO, USA; Kansas City Chiefs linebacker Reggie Ragland (59) against the… Jan 20, 2019; Kansas City, MO, USA; Kansas City Chiefs linebacker Reggie Ragland (59) against the New England Patriots during the AFC championship game at Arrowhead Stadium. Mandatory Credit: Mark J. Rebilas-USA TODAY Sports more 61. OG Stefen Wisniewski Aug 8, 2019; Philadelphia, PA, USA; Philadelphia Eagles offensive guard Stefen Wisniewski (61) on the sidelines… Aug 8, 2019; Philadelphia, PA, USA; Philadelphia Eagles offensive guard Stefen Wisniewski (61) on the sidelines against the Tennessee Titans at Lincoln Financial Field. Mandatory Credit: Eric Hartline-USA TODAY Sports more 62. C Austin Reiter Jan 20, 2019; Kansas City, MO, USA; Kansas City Chiefs center Austin Reiter (62) against the… Jan 20, 2019; Kansas City, MO, USA; Kansas City Chiefs center Austin Reiter (62) against the New England Patriots during the AFC championship game at Arrowhead Stadium. Mandatory Credit: Mark J. Rebilas-USA TODAY Sports more 64. DT Mike Pennel KANSAS CITY, MO - NOVEMBER 03: Defensive tackle Mike Pennel #64 of the Kansas City Chiefs… KANSAS CITY, MO - NOVEMBER 03: Defensive tackle Mike Pennel #64 of the Kansas City Chiefs tackles running back Dalvin Cook #33 of the Minnesota Vikings during the first quarter against the Kansas City Chiefs at Arrowhead Stadium on November 3, 2019 in Kansas City, Missouri. (Photo by Peter Aiken/Getty Images) more 68. OT Jackson Barton INDIANAPOLIS, IN - AUGUST 17: Offensive tackle Jackson Barton #71 of the Indianapolis Colts moves out… INDIANAPOLIS, IN - AUGUST 17: Offensive tackle Jackson Barton #71 of the Indianapolis Colts moves out to block during the preseason game against the Cleveland Browns at Lucas Oil Stadium on August 17, 2019 in Indianapolis, Indiana. (Photo by Michael Hickey/Getty Images) more 71. RT Mitchell Schwartz Nov 19, 2018; Los Angeles, CA, USA; Kansas City Chiefs offensive tackle Mitchell Schwartz (71) reacts… Nov 19, 2018; Los Angeles, CA, USA; Kansas City Chiefs offensive tackle Mitchell Schwartz (71) reacts against the Los Angeles Rams at the Los Angeles Memorial Coliseum. The Rams defeated the Chiefs 54-51 in the highest scoring Monday Night Football game ever. Mandatory Credit: Kirby Lee-USA TODAY Sports more 72. LT Eric Fisher Sep 23, 2018; Kansas City, MO, USA; Kansas City Chiefs offensive tackle Eric Fisher (72) is… Sep 23, 2018; Kansas City, MO, USA; Kansas City Chiefs offensive tackle Eric Fisher (72) is introduced before the game against the San Francisco 49ers at Arrowhead Stadium. The Chiefs won 38-27. Mandatory Credit: Denny Medley-USA TODAY Sports more 73. OL Nick Allegretti KANSAS CITY, MO - AUGUST 10: Nick Allegretti #73 of the Kansas City Chiefs blocks Darius… KANSAS CITY, MO - AUGUST 10: Nick Allegretti #73 of the Kansas City Chiefs blocks Darius Phillips #23 of the Cincinnati Bengals in the second quarter during a preseason game at Arrowhead Stadium on August 10, 2019 in Kansas City, Missouri. (Photo by David Eulitt/Getty Images) more 74. OL Martinas Rankin Oct 17, 2019; Denver, CO, USA; Kansas City Chiefs quarterback Patrick Mahomes (15) takes a snap… Oct 17, 2019; Denver, CO, USA; Kansas City Chiefs quarterback Patrick Mahomes (15) takes a snap from center Austin Reiter (62) as offensive tackle Martinas Rankin (74) defends in the first quarter against the Denver Broncos at Empower Field at Mile High. Mandatory Credit: Isaiah J. Downing-USA TODAY Sports more 75. OL Cam Erving Jan 20, 2019; Kansas City, MO, USA; Kansas City Chiefs offensive tackle Cameron Erving (75) reacts… Jan 20, 2019; Kansas City, MO, USA; Kansas City Chiefs offensive tackle Cameron Erving (75) reacts against the New England Patriots during the AFC championship game at Arrowhead Stadium. Mandatory Credit: Mark J. Rebilas-USA TODAY Sports more 76. RG Laurent Duvernay-Tardif Sep 23, 2018; Kansas City, MO, USA; Kansas City Chiefs offensive tackle Laurent Duvernay-Tardif (76) is… Sep 23, 2018; Kansas City, MO, USA; Kansas City Chiefs offensive tackle Laurent Duvernay-Tardif (76) is introduced before the game against the San Francisco 49ers at Arrowhead Stadium. The Chiefs won 38-27. Mandatory Credit: Denny Medley-USA TODAY Sports more 77. OL Andrew Wylie December 2, 2018; Oakland, CA, USA; Kansas City Chiefs offensive guard Andrew Wylie (77) during the… December 2, 2018; Oakland, CA, USA; Kansas City Chiefs offensive guard Andrew Wylie (77) during the third quarter against the Oakland Raiders at Oakland Coliseum. The Chiefs defeated the Raiders 40-33. Mandatory Credit: Kyle Terada-USA TODAY Sports more 81. TE Blake Bell Kansas City Chiefs tight end Blake Bell (81) carries the ball during the first half of… Kansas City Chiefs tight end Blake Bell (81) carries the ball during the first half of an NFL preseason football game against the Cincinnati Bengals in Kansas City, Mo., Saturday, Aug. 10, 2019. (AP Photo/Colin E. Braley) more 82. TE Deon Yelder Kansas City Chiefs tight end Deon Yelder (82) runs into the end zone for a touchdown… Kansas City Chiefs tight end Deon Yelder (82) runs into the end zone for a touchdown past Cincinnati Bengals cornerback Anthony Chesley (38), during the first half of an NFL preseason football game in Kansas City, Mo., Saturday, Aug. 10, 2019. (AP Photo/Ed Zurga) more 87. TE Travis Kelce Oct 2, 2017; Kansas City, MO, USA; Kansas City Chiefs tight end Travis Kelce (87) celebrates… Oct 2, 2017; Kansas City, MO, USA; Kansas City Chiefs tight end Travis Kelce (87) celebrates after a catch during the game against the Washington Redskins at Arrowhead Stadium. Mandatory Credit: Denny Medley-USA TODAY Sports more 91. DT Derrick Nnadi Jan 12, 2019; Kansas City, MO, USA; Kansas City Chiefs defensive tackle Derrick Nnadi (91) celebrates… Jan 12, 2019; Kansas City, MO, USA; Kansas City Chiefs defensive tackle Derrick Nnadi (91) celebrates against the Indianapolis Colts during the AFC Divisional playoff football game at Arrowhead Stadium. Mandatory Credit: Mark J. Rebilas-USA TODAY Sports more 92. DE Tanoh Kpassagnon Aug 17, 2019; Pittsburgh, PA, USA; Pittsburgh Steelers quarterback Joshua Dobbs (5) eludes Kansas City Chiefs… Aug 17, 2019; Pittsburgh, PA, USA; Pittsburgh Steelers quarterback Joshua Dobbs (5) eludes Kansas City Chiefs linebacker Tanoh Kpassagnon (42) during the second quarter at Heinz Field. Mandatory Credit: Philip G. Pavely-USA TODAY Sports more 95. DT Chris Jones KANSAS CITY, MO - DECEMBER 25: Defensive end Chris Jones #95 of the Kansas City Chiefs… KANSAS CITY, MO - DECEMBER 25: Defensive end Chris Jones #95 of the Kansas City Chiefs celebrates after a play during the game against the Denver Broncos at Arrowhead Stadium on December 25, 2016 in Kansas City, Missouri. (Photo by Reed Hoffmann/Getty Images) more 97. DE Alex Okafor KANSAS CITY, MO - AUGUST 24: Alex Okafor #97 of the Kansas City Chiefs reaches for… KANSAS CITY, MO - AUGUST 24: Alex Okafor #97 of the Kansas City Chiefs reaches for the tackle of Tevin Coleman #26 of the San Francisco 49ers during preseason action at Arrowhead Stadium on August 24, 2019 in Kansas City, Missouri. (Photo by David Eulitt/Getty Images) more
Predicting RNA structures: the model of the RNA element binding Rev meets the NMR structure. How accurate are the predictions of RNA three-dimensional structures? Assessing this accuracy requires the detailed comparison of the prediction with the experimentally determined structure. Previously, sequence variation in RNA aptamers that bind the Rev protein was used to infer a three-dimensional model of the Rev-binding element (RBE) RNA. Although much of this model has been substantiated by subsequent experimental data, its validity remains to be determined by confronting it with the structure determined by NMR spectroscopy. A series of different criteria such as geometric parameters (root mean square deviation, interproton distances, torsions and puckering), helicoidal parameters (base pairing and base stacking) and stability considerations (conformational energies) have been evaluated to identify common and distinguishing structural characteristics of the model and the NMR structure. The detailed comparison of the two structures reveals striking structural similarities at both the global and local level that validate the RNA modeling approach that we have used. Analysis of the structural differences and the precision of the model suggest that the limitations of the method are related to the amount of structural information available for modeling.
In-depth security news and investigation Posts Tagged: internet of things Earlier this month I spoke at a cybersecurity conference in Albany, N.Y. alongside Tony Sager, senior vice president and chief evangelist at the Center for Internet Security and a former bug hunter at the U.S. National Security Agency. We talked at length about many issues, including supply chain security, and I asked Sager whether he’d heard anything about rumors that Supermicro — a high tech firm in San Jose, Calif. — had allegedly inserted hardware backdoors in technology sold to a number of American companies. Tony Sager, senior vice president and chief evangelist at the Center for Internet Security. The event Sager and I spoke at was prior to the publication of Bloomberg Businessweek‘s controversial story alleging that Supermicro had duped almost 30 companies into buying backdoored hardware. Sager said he hadn’t heard anything about Supermicro specifically, but we chatted at length about the challenges of policing the technology supply chain. Below are some excerpts from our conversation. I learned quite bit, and I hope you will, too. Brian Krebs (BK): Do you think Uncle Sam spends enough time focusing on the supply chain security problem? It seems like a pretty big threat, but also one that is really hard to counter. Tony Sager (TS): The federal government has been worrying about this kind of problem for decades. In the 70s and 80s, the government was more dominant in the technology industry and didn’t have this massive internationalization of the technology supply chain. But even then there were people who saw where this was all going, and there were some pretty big government programs to look into it. TS: Exactly. That was an attempt to help support a U.S.-based technology industry so that we had an indigenous place to work with, and where we have only cleared people and total control over the processes and parts. BK: Why do you think more companies aren’t insisting on producing stuff through code and hardware foundries here in the U.S.? TS: Like a lot of things in security, the economics always win. And eventually the cost differential for offshoring parts and labor overwhelmed attempts at managing that challenge. BK: But certainly there are some areas of computer hardware and network design where you absolutely must have far greater integrity assurance? TS: Right, and this is how they approach things at Sandia National Laboratories [one of three national nuclear security research and development laboratories]. One of the things they’ve looked at is this whole business of whether someone might sneak something into the design of a nuclear weapon. The basic design principle has been to assume that one person in the process may have been subverted somehow, and the whole design philosophy is built around making sure that no one person gets to sign off on what goes into a particular process, and that there is never unobserved control over any one aspect of the system. So, there are a lot of technical and procedural controls there. But the bottom line is that doing this is really much harder [for non-nuclear electronic components] because of all the offshoring now of electronic parts, as well as the software that runs on top of that hardware. BK: So is the government basically only interested in supply chain security so long as it affects stuff they want to buy and use? TS: The government still has regular meetings on supply chain risk management, but there are no easy answers to this problem. The technical ability to detect something wrong has been outpaced by the ability to do something about it. BK: Wait…what? TS: Suppose a nation state dominates a piece of technology and in theory could plant something inside of it. The attacker in this case has a risk model, too. Yes, he could put something in the circuitry or design, but his risk of exposure also goes up. Could I as an attacker control components that go into certain designs or products? Sure, but it’s often not very clear what the target is for that product, or how you will guarantee it gets used by your target. And there are still a limited set of bad guys who can pull that stuff off. In the past, it’s been much more lucrative for the attacker to attack the supply chain on the distribution side, to go after targeted machines in targeted markets to lessen the exposure of this activity. BK: So targeting your attack becomes problematic if you’re not really limiting the scope of targets that get hit with compromised hardware. TS: Yes, you can put something into everything, but all of a sudden you have this massive big data collection problem on the back end where you as the attacker have created a different kind of analysis problem. Of course, some nations have more capability than others to sift through huge amounts of data they’re collecting. BK: Can you talk about some of the things the government has typically done to figure out whether a given technology supplier might be trying to slip in a few compromised devices among an order of many? TS: There’s this concept of the “blind buy,” where if you think the threat vector is someone gets into my supply chain and subverts the security of individual machines or groups of machines, the government figures out a way to purchase specific systems so that no one can target them. In other words, the seller doesn’t know it’s the government who’s buying it. This is a pretty standard technique to get past this, but it’s an ongoing cat and mouse game to be sure.Continue reading → What do we do with a company that regularly pumps metric tons of virtual toxic sludge onto the Internet and yet refuses to clean up their act? If ever there were a technology giant that deserved to be named and shamed for polluting the Web, it is Xiongmai — a Chinese maker of electronic parts that power a huge percentage of cheap digital video recorders (DVRs) and Internet-connected security cameras. A rendering of Xiongmai’s center in Hangzhou, China. Source: xiongmaitech.com Security experts soon discovered that a majority of Mirai-infected devices were chiefly composed of components made by Xiongmai (a.k.a. Hangzhou Xiongmai Technology Co., Ltd.) and a handful of other Chinese tech firms that seemed to have a history of placing product market share and price above security. Since then, two of those firms — Huawei and Dahua — have taken steps to increase the security of their IoT products out-of-the-box. But Xiongmai — despite repeated warnings from researchers about deep-seated vulnerabilities in its hardware — has continued to ignore such warnings and to ship massively insecure hardware and software for use in products that are white-labeled and sold by more than 100 third-party vendors. On Tuesday, Austrian security firm SEC Consult released the results of extensive research into multiple, lingering and serious security holes in Xiongmai’s hardware. SEC Consult said it began the process of working with Xiongmai on these problems back in March 2018, but that it finally published its research after it became clear that Xiongmai wasn’t going to address any of the problems. “Although Xiongmai had seven months notice, they have not fixed any of the issues,” the researchers wrote in a blog post published today. “The conversation with them over the past months has shown that security is just not a priority to them at all.” PROBLEM TO PROBLEM A core part of the problem is the peer-to-peer (P2P) communications component called “XMEye” that ships with all Xiongmai devices and automatically connects them to a cloud network run by Xiongmai. The P2P feature is designed so that consumers can access their DVRs or security cameras remotely anywhere in the world and without having to configure anything. The various business lines of Xiongmai. Source: xiongmaitech.com To access a Xiongmai device via the P2P network, one must know the Unique ID (UID) assigned to each device. The UID is essentially derived in an easily reproducible way using the device’s built-in MAC address (a string of numbers and letters, such as 68ab8124db83c8db). Electronics firms are assigned ranges of MAC address that they may use, but SEC Consult discovered that Xiongmai for some reason actually uses MAC address ranges assigned to a number of other companies, including tech giant Cisco Systems, German printing press maker Koenig & Bauer AG, and Swiss chemical analysis firm Metrohm AG. SEC Consult learned that it was trivial to find Xiongmai devices simply by computing all possible ranges of UIDs for each range of MAC addresses, and then scanning Xiongmai’s public cloud for XMEye-enabled devices. Based on scanning just two percent of the available ranges, SEC Consult conservatively estimates there are around 9 million Xiongmai P2P devices online. [For the record, KrebsOnSecurity has longadvised buyers of IoT devices to avoid those advertise P2P capabilities for just this reason. The Xiongmai debacle is yet another example of why this remains solid advice]. BLANK TO BANK While one still needs to provide a username and password to remotely access XMEye devices via this method, SEC Consult notes that the default password of the all-powerful administrative user (username “admin”) is blank (i.e, no password). The admin account can be used to do anything to the device, such as changing its settings or uploading software — including malware like Mirai. And because users are not required to set a secure password in the initial setup phase, it is likely that a large number of devices are accessible via these default credentials. The raw, unbranded electronic components of an IP camera produced by Xiongmai. Even if a customer has changed the default admin password, SEC Consult discovered there is an undocumented user with the name “default,” whose password is “tluafed” (default in reverse). While this user account can’t change system settings, it is still able to view any video streams. Normally, hardware devices are secured against unauthorized software updates by requiring that any new software pushed to the devices be digitally signed with a secret cryptographic key that is held only by the hardware or software maker. However, XMEye-enabled devices have no such protections. In fact, the researchers found it was trivial to set up a system that mimics the XMEye cloud and push malicious firmware updates to any device. Worse still, unlike with the Mirai malware — which gets permanently wiped from memory when an infected device powers off or is rebooted — the update method devised by SEC Consult makes it so that any software uploaded survives a reboot. Continue reading → Citing “extraordinary cooperation” with the government, a court in Alaska on Tuesday sentenced three men to probation, community service and fines for their admitted roles in authoring and using “Mirai,” a potent malware strain used in countless attacks designed to knock Web sites offline — including an enormously powerful attack in 2016 that sidelined this Web site for nearly four days. The men — 22-year-old Paras Jha Fanwood, New Jersey, Josiah White, 21 of Washington, Pa., and Dalton Norman from Metairie, La. — were each sentenced to five years probation, 2,500 hours of community service, and ordered to pay $127,000 in restitution for the damage caused by their malware. Not long after Mirai first surfaced online in August 2016, White and Jha were questioned by the FBI about their suspected role in developing the malware. At the time, the men were renting out slices of their botnet to other cybercriminals. Weeks later, the defendants sought to distance themselves from their creation by releasing the Mirai source code online. That action quickly spawned dozens of copycat Mirai botnets, some of which were used in extremely powerful denial-of-service attacks that often caused widespread collateral damage beyond their intended targets. A depiction of the outages caused by the Mirai attacks on Dyn, an Internet infrastructure company. Source: Downdetector.com. The source code release also marked a period in which the three men began using their botnet for far more subtle and less noisy criminal moneymaking schemes, including click fraud — a form of online advertising fraud that costs advertisers billions of dollars each year. In September 2016, KrebsOnSecurity was hit with a record-breaking denial-of-service attack from tens of thousands of Mirai-infected devices, forcing this site offline for several days. Using the pseudonym “Anna_Senpai,” Jha admitted to a friend at the time that the attack on this site was paid for by a customer who rented tens of thousands of Mirai-infected systems from the trio. Google in the coming weeks is expected to fix a location privacy leak in two of its most popular consumer products. New research shows that Web sites can run a simple script in the background that collects precise location data on people who have a Google Home or Chromecast device installed anywhere on their local network. Craig Young, a researcher with security firm Tripwire, said he discovered an authentication weakness that leaks incredibly accurate location information about users of both the smart speaker and home assistant Google Home, and Chromecast, a small electronic device that makes it simple to stream TV shows, movies and games to a digital television or monitor. Young said the attack works by asking the Google device for a list of nearby wireless networks and then sending that list to Google’s geolocation lookup services. “An attacker can be completely remote as long as they can get the victim to open a link while connected to the same Wi-Fi or wired network as a Google Chromecast or Home device,” Young told KrebsOnSecurity. “The only real limitation is that the link needs to remain open for about a minute before the attacker has a location. The attack content could be contained within malicious advertisements or even a tweet.” It is common for Web sites to keep a record of the numeric Internet Protocol (IP) address of all visitors, and those addresses can be used in combination with online geolocation tools to glean information about each visitor’s hometown or region. But this type of location information is often quite imprecise. In many cases, IP geolocation offers only a general idea of where the IP address may be based geographically. This is typically not the case with Google’s geolocation data, which includes comprehensive maps of wireless network names around the world, linking each individual Wi-Fi network to a corresponding physical location. Armed with this data, Google can very often determine a user’s location to within a few feet (particularly in densely populated areas), by triangulating the user between several nearby mapped Wi-Fi access points. [Side note: Anyone who’d like to see this in action need only to turn off location data and remove the SIM card from a smart phone and see how well navigation apps like Google’s Waze can still figure out where you are]. “The difference between this and a basic IP geolocation is the level of precision,” Young said. “For example, if I geolocate my IP address right now, I get a location that is roughly 2 miles from my current location at work. For my home Internet connection, the IP geolocation is only accurate to about 3 miles. With my attack demo however, I’ve been consistently getting locations within about 10 meters of the device.” Young said a demo he created (a video of which is below) is accurate enough that he can tell roughly how far apart his device in the kitchen is from another device in the basement. “I’ve only tested this in three environments so far, but in each case the location corresponds to the right street address,” Young said. “The Wi-Fi based geolocation works by triangulating a position based on signal strengths to Wi-Fi access points with known locations based on reporting from people’s phones.” Beyond leaking a Chromecast or Google Home user’s precise geographic location, this bug could help scammers make phishing and extortion attacks appear more realistic. Common scams like fake FBI or IRS warnings or threats to release compromising photos or expose some secret to friends and family could abuse Google’s location data to lend credibility to the fake warnings, Young notes. “The implications of this are quite broad including the possibility for more effective blackmail or extortion campaigns,” he said. “Threats to release compromising photos or expose some secret to friends and family could use this to lend credibility to the warnings and increase their odds of success.” When Young first reached out to Google in May about his findings, the company replied by closing his bug report with a “Status: Won’t Fix (Intended Behavior)” message. But after being contacted by KrebsOnSecurity, Google changed its tune, saying it planned to ship an update to address the privacy leak in both devices. Currently, that update is slated to be released in mid-July 2018. Continue reading → A monster distributed denial-of-service attack (DDoS) against KrebsOnSecurity.com in 2016 knocked this site offline for nearly four days. The attack was executed through a network of hacked “Internet of Things” (IoT) devices such as Internet routers, security cameras and digital video recorders. A new study that tries to measure the direct cost of that one attack for IoT device users whose machines were swept up in the assault found that it may have cost device owners a total of $323,973.75 in excess power and added bandwidth consumption. My bad. But really, none of it was my fault at all. It was mostly the fault of IoT makers for shipping cheap, poorly designed products (insecure by default), and the fault of customers who bought these IoT things and plugged them onto the Internet without changing the things’ factory settings (passwords at least.) The botnet that hit my site in Sept. 2016 was powered by the first version of Mirai, a malware strain that wriggles into dozens of IoT devices left exposed to the Internet and running with factory-default settings and passwords. Systems infected with Mirai are forced to scan the Internet for other vulnerable IoT devices, but they’re just as often used to help launch punishing DDoS attacks. By the time of the first Mirai attack on this site, the young masterminds behind Mirai had already enslaved more than 600,000 IoT devices for their DDoS armies. But according to an interview with one of the admitted and convicted co-authors of Mirai, the part of their botnet that pounded my site was a mere slice of firepower they’d sold for a few hundred bucks to a willing buyer. The attack army sold to this ne’er-do-well harnessed the power of just 24,000 Mirai-infected systems (mostly security cameras and DVRs, but some routers, too). These 24,000 Mirai devices clobbered my site for several days with data blasts of up to 620 Gbps. The attack was so bad that my pro-bono DDoS protection provider at the time — Akamai — had to let me go because the data firehose pointed at my site was starting to cause real pain for their paying customers. Akamai later estimated that the cost of maintaining protection against my site in the face of that onslaught would have run into the millions of dollars. We’re getting better at figuring out the financial costs of DDoS attacks to the victims (5, 6 or 7 -digit dollar losses) and to the perpetrators (zero to hundreds of dollars). According to a report released this year by DDoS mitigation giant NETSCOUT Arbor, fifty-six percent of organizations last year experienced a financial impact from DDoS attacks for between $10,000 and $100,000, almost double the proportion from 2016. If we accept the UC Berkeley team’s assumptions about costs borne by hacked IoT device users (more on that in a bit), the total cost of added bandwidth and energy consumption from the botnet that hit my site came to $323,973.95. This may sound like a lot of money, but remember that broken down among 24,000 attacking drones the per-device cost comes to just $13.50. So let’s review: The attacker who wanted to clobber my site paid a few hundred dollars to rent a tiny portion of a much bigger Mirai crime machine. That attack would likely have cost millions of dollars to mitigate. The consumers in possession of the IoT devices that did the attacking probably realized a few dollars in losses each, if that. Perhaps forever unmeasured are the many Web sites and Internet users whose connection speeds are often collateral damage in DDoS attacks. Companies around the globe are scrambling to comply with new European privacy regulations that take effect a little more than three months from now. But many security experts are worried that the changes being ushered in by the rush to adhere to the law may make it more difficult to track down cybercriminals and less likely that organizations will be willing to share data about new online threats. On May 25, 2018, the General Data Protection Regulation (GDPR) takes effect. The law, enacted by the European Parliament, requires technology companies to get affirmative consent for any information they collect on people within the European Union. Organizations that violate the GDPR could face fines of up to four percent of global annual revenues. In response, the Internet Corporation for Assigned Names and Numbers (ICANN) — the nonprofit entity that manages the global domain name system — is poised to propose changes to the rules governing how much personal information Web site name registrars can collect and who should have access to the data. Specifically, ICANN has been seeking feedback on a range of proposals to redact information provided in WHOIS, the system for querying databases that store the registered users of domain names and blocks of Internet address ranges (IP addresses). Under current ICANN rules, domain name registrars should collect and display a variety of data points when someone performs a WHOIS lookup on a given domain, such as the registrant’s name, address, email address and phone number. (Most registrars offer a privacy protection service that shields this information from public WHOIS lookups; some registrars charge a nominal fee for this service, while others offer it for free). In a bid to help domain registrars comply with the GDPR regulations, ICANN has floated several proposals, all of which would redact some of the registrant data from WHOIS records. Its mildest proposal would remove the registrant’s name, email, and phone number, while allowing self-certified 3rd parties to request access to said data at the approval of a higher authority — such as the registrar used to register the domain name. The most restrictive proposal would remove all registrant data from public WHOIS records, and would require legal due process (such as a subpoena or court order) to reveal any information supplied by the domain registrant. ICANN’s various proposed models for redacting information in WHOIS domain name records. The full text of ICANN’s latest proposed models (from which the screenshot above was taken) can be found here (PDF). A diverse ICANN working group made up of privacy activists, technologists, lawyers, trademark holders and security experts has been arguing about these details since 2016. For the curious and/or intrepid, the entire archive of those debates up to the current day is available at this link. WHAT IS THE WHOIS DEBATE? To drastically simplify the discussions into two sides, those in the privacy camp say WHOIS records are being routinely plundered and abused by all manner of ne’er-do-wells, including spammers, scammers, phishers and stalkers. In short, their view seems to be that the availability of registrant data in the WHOIS records causes more problems than it is designed to solve. Meanwhile, security experts are arguing that the data in WHOIS records has been indispensable in tracking down and bringing to justice those who seek to perpetrate said scams, spams, phishes and….er….stalks. Continue reading → In December 2017, the U.S. Department of Justice announced indictments and guilty pleas by three men in the United States responsible for creating and using Mirai, a malware strain that enslaves poorly-secured “Internet of Things” or IoT devices like security cameras and digital video recorders for use in large-scale cyberattacks. The FBI and the DOJ had help in their investigation from many security experts, but this post focuses on one expert whose research into the Dark Web and its various malefactors was especially useful in that case. Allison Nixon is director of security research at Flashpoint, a cyber intelligence firm based in New York City. Nixon spoke with KrebsOnSecurity at length about her perspectives on IoT security and the vital role of law enforcement in this fight. Brian Krebs (BK): Where are we today with respect to IoT security? Are we better off than were a year ago, or is the problem only worse? Allison Nixon (AN): In some aspects we’re better off. The arrests that happened over the last year in the DDoS space, I would call that a good start, but we’re not out of the woods yet and we’re nowhere near the end of anything. BK: Why not? AN: Ultimately, what’s going with these IoT botnets is crime. People are talking about these cybersecurity problems — problems with the devices, etc. — but at the end of the day it’s crime and private citizens don’t have the power to make these bad actors stop. BK: Certainly security professionals like yourself and others can be diligent about tracking the worst actors and the crime machines they’re using, and in reporting those systems when it’s advantageous to do so? AN: That’s a fair argument. I can send abuse complaints to servers being used maliciously. And people can write articles that name individuals. However, it’s still a limited kind of impact. I’ve seen people get named in public and instead of stopping, what they do is improve their opsec [operational security measures] and keep doing the same thing but just sneakier. In the private sector, we can frustrate things, but we can’t actually stop them in the permanent, sanctioned way that law enforcement can. We don’t really have that kind of control. BK: How are we not better off? AN: I would say that as time progresses, the community that practices DDoS and malicious hacking and these pointless destructive attacks get more technically proficient when they’re executing attacks, and they just become a more difficult adversary. BK: A more difficult adversary? AN: Well, if you look at the individuals that were the subject of the announcement this month, and you look in their past, you can see they’ve been active in the hacking community a long time. Litespeed [the nickname used by Josiah White, one of the men who pleaded guilty to authoring Mirai] has been credited with lots of code. He’s had years to develop and as far as I could tell he didn’t stop doing criminal activity until he got picked up by law enforcement. BK: It seems to me that the Mirai authors probably would not have been caught had they never released the source code for their malware. They said they were doing so because multiple law enforcement agencies and security researchers were hot on their trail and they didn’t want to be the only ones holding the source code when the cops showed up at their door. But if that was really their goal in releasing it, doing so seems to have had the exact opposite effect. What’s your take on that? AN: You are absolutely, 100 million percent correct. If they just shut everything down and left, they’d be fine now. The fact that they dumped the source was a tipping point of sorts. The damages they caused at that time were massive, but when they dumped the source code the amount of damage their actions contributed to ballooned [due to the proliferation of copycat Mirai botnets]. The charges against them specified their actions in infecting the machines they controlled, but when it comes to what interested researchers in the private sector, the moment they dumped the source code — that’s the most harmful act they did out of the entire thing. BK: Do you believe their claimed reason for releasing the code? AN: I believe it. They claimed they released it because they wanted to hamper investigative efforts to find them. The problem is that not only is it incorrect, it also doesn’t take into account the researchers on the other end of the spectrum who have to pick from many targets to spend their time looking at. Releasing the source code changed that dramatically. It was like catnip to researchers, and was just a new thing for researchers to look at and play with and wonder who wrote it. If they really wanted to stay off law enforcement’s radar, they would be as low profile as they could and not be interesting. But they did everything wrong: They dumped the source code and attacked a security researcher using tools that are interesting to security researchers. That’s like attacking a dog with a steak. I’m going to wave this big juicy steak at a dog and that will teach him. They made every single mistake in the book. BK: What do you think it is about these guys that leads them to this kind of behavior? Is it just a kind of inertia that inexorably leads them down a slippery slope if they don’t have some kind of intervention? AN: These people go down a life path that does not lead them to a legitimate livelihood. They keep doing this and get better at it and they start to do these things that really can threaten the Internet as a whole. In the case of these DDoS botnets, it’s worrying that these individuals are allowed to go this deep before law enforcement catches them. Continue reading → Most readers here have likely heard or read various prognostications about the impending doom from the proliferation of poorly-secured “Internet of Things” or IoT devices. Loosely defined as any gadget or gizmo that connects to the Internet but which most consumers probably wouldn’t begin to know how to secure, IoT encompasses everything from security cameras, routers and digital video recorders to printers, wearable devices and “smart” lightbulbs. Throughout 2016 and 2017, attacks from massive botnets made up entirely of hacked IoT devices had many experts warning of a dire outlook for Internet security. But the future of IoT doesn’t have to be so bleak. Here’s a primer on minimizing the chances that your IoT things become a security liability for you or for the Internet at large. -Rule #1: Avoid connecting your devices directly to the Internet — either without a firewall or in front it, by poking holes in your firewall so you can access them remotely. Putting your devices in front of your firewall is generally a bad idea because many IoT products were simply not designed with security in mind and making these things accessible over the public Internet could invite attackers into your network. If you have a router, chances are it also comes with a built-in firewall. Keep your IoT devices behind the firewall as best you can. -Rule #2:If you can, change the thing’s default credentials to a complex password that only you will know and can remember. And if you do happen to forget the password, it’s not the end of the world: Most devices have a recessed reset switch that can be used to restore to the thing to its factory-default settings (and credentials). Here’s some advice on picking better ones. I say “if you can,” at the beginning of Rule #2 because very often IoT devices — particularly security cameras and DVRs — are so poorly designed from a security perspective that even changing the default password to the thing’s built-in Web interface does nothing to prevent the things from being reachable and vulnerable once connected to the Internet. Also, many of these devices are found to have hidden, undocumented “backdoor” accounts that attackers can use to remotely control the devices. That’s why Rule #1 is so important. Continue reading → A U.K. man who pleaded guilty to launching more than 2,000 cyberattacks against some of the world’s largest companies has avoided jail time for his role in the attacks. The judge in the case reportedly was moved by pleas for leniency that cited the man’s youth at the time of the attacks and a diagnosis of autism. In early July 2017, the West Midlands Police in the U.K. arrested 19-year-old Stockport resident Jack Chappell and charged him with using a now-defunct attack-for-hire service called vDOS to launch attacks against the Web sites of Amazon, BBC, BT, Netflix, T-Mobile, Virgin Media, and Vodafone, between May 1, 2015 and April 30, 2016. One of several taunting tweets Chappell sent to his DDoS victims. Chappell also helped launder money for vDOS, which until its demise in September 2016 was by far the most popular and powerful attack-for-hire service — allowing even completely unskilled Internet users to launch crippling assaults capable of knocking most Web sites offline. Using the Twitter handle @fractal_warrior, Chappell would taunt his victims while launching attacks against them. The tweet below was among several sent to the Jisc Janet educational support network and Manchester College, where Chappell was a student. In total, Chappell attacked his school at least 21 times, prosecutors showed. Another taunting Chappell tweet. Chappell was arrested in April 2016 after investigators traced his Internet address to his home in the U.K. For more on the clues that likely led to his arrest, check out this story. Nevertheless, the judge in the case was moved by pleas from Chappell’s lawyer, who argued that his client was just an impressionable youth at the time who has autism, a range of conditions characterized by challenges with social skills, repetitive behaviors, speech and nonverbal communication. The defense called on an expert who reportedly testified that Chappell was “one of the most talented people with a computer he had ever seen.” “He is in some ways as much of a victim, he has been exploited and used,” Chappell’s attorney Stuart Kaufman told the court, according to the Manchester Evening News. “He is not malicious, he is mischievous.” The same publication quoted Judge Maurice Greene at Chappell’s sentencing this week, saying to the young man: “You were undoubtedly taken advantage of by those more criminally sophisticated than yourself. You would be extremely vulnerable in a custodial element.” Judge Greene decided to suspend a sentence of 16 months at a young offenders institution; Chappell will instead “undertake 20 days rehabilitation activity,” although it’s unclear exactly what that will entail. ANALYSIS/RANT It’s remarkable when someone so willingly and gleefully involved in a crime spree such as this can emerge from it looking like the victim. “Autistic Hacker Had Been Exploited,” declared a headline about the sentence in the U.K. newspaper The Times. After reading the coverage of this case in the press, I half expected to see another story saying someone had pinned a medal on Chappell or offered him a job. Continue reading → One of the biggest cybersecurity stories of 2016 was the surge in online attacks caused by poorly-secured “Internet of Things” (IoT) devices such as Internet routers, security cameras, digital video recorders (DVRs) and smart appliances. Many readers here have commented with ideas about how to counter vulnerabilities caused by out-of-date software in IoT devices, so why not pitch your idea for money? Who knows, you could win up to $25,000 in a new contest put on by the U.S. Federal Trade Commission (FTC). Electronics giant LG said today at the Consumer Electronics Show (CES) that all of its appliances from now on will have Wi-Fi built in and be connected to the cloud. Image: Mashable The FTC’s IoT Home Inspector Challenge is seeking ideas for a tool of some sort that would address the burgeoning IoT mess. The agency says it’s offering a cash prize of up to $25,000 for the best technical solution, with up to $3,000 available for as many as three honorable mention winner(s). Continue reading →
CULTURAL IDENTITY South Korea's homogeneous population shares a common ethnic, cultural, and linguistic heritage. National self-image is, on one level, unambiguously defined by the convergence of territorial, ethnic, linguistic, and cultural identities. Yet intense feelings of nationalism, so evident in athletic events like the 1986 Asian Games and the 1988 Olympic Games held in Seoul, revealed anxiety as well as pride concerning South Korea's place in the world. More than Western peoples and even more than the Japanese, South Korean individuals are inclined to view themselves as a tightly knit national community with a common destiny. In a rapidly changing world, however, it is often difficult for them to define exactly what being a South Korean is. To outsiders, the intense concern with identity is perhaps difficult to understand; it reflects a history of subordinate relations to powerful foreign states and the tragedy of national division after World War II. Many modernized, urban-dwelling South Koreans embark on a search for the "essence" of their culture, which commonly expresses itself as hostility to foreign influences. For example, the poet Kim Chi-ha, whose opposition to the Park regime in the 1970s was a model for a younger generation of dissidents, attacked the government as much for its neglect of traditional values as for its antidemocratic tendencies. Seoul has not been slow to employ traditionalism for its own ends. In 1987 the government adopted guidelines for the revision of history textbooks instructing publishers to describe the foundation of the Korean nation by Tan'gun in 2333 B.C. as "a reflection of historical facts" rather than simply a myth. The legendary Tan'gun was, according to the myth, the son of god and a bear-woman. According to a Far Eastern Economic Review commentator, ". . . people ranging from reputable university scholars to chauvinist mystics regard Tan'gun as the personification of ethics and values that emphasize a native Korean identity against the foreign religions and philosophies of Buddhism, neo-Confucianism, Christianity and Marxism that have otherwise dominated Korean history and thought." Tangun's legendary kingdom is older than China's first legendary dynasty, the Xia (2205-1766 B.C.), and its antiquity asserts Korea's cultural autonomy in relation to its largest neighbor. There have been proposals that the government subsidize the rites of the numerically small community of believers in Taejonggyo and other cults that worship Tan'gun. Problems of cultural identity are closely connected to the tragedy of Korea's division into two hostile states. Many members of the younger generation of South Koreans born after the Korean War fervently embrace the cause of t'ongil, or reunification, and believe that it is the superpowers, the United States and the Soviet Union, who are to blame for Korea's national division. The South Korean government's dependence on the United States has been cited as one of the principal reasons for the lack of improvement in north-south ties. While a majority of South Koreans remains suspicious of the North Koreans, many South Koreans also share the sentiments expressed by Kim Chi-ha: "our name is division, and this soiled name, like an immovable destiny, oppresses all of us." When parts of the wall dividing East Berlin and West Berlin were knocked down in November 1989, Koreans reflected sadly that breaching the DMZ would not be such a simple task. Korea and Japan National or ethnic groups often need an "other," a group of outsiders against whom they can define themselves. While Western countries with their individualistic and, from a Confucian perspective, self-centered ways of life provide important images of "otherness" for South Koreans, the principal source of such images for many years has been Japan. Attitudes toward Japan as an "other" are complex. On the most basic level, there is hostility fed by memories of invasion and colonial oppression, present-day economic frictions, and the Japanese government's inability or unwillingness to do anything about discriminatory treatment of the large Korean minority in Japan. The two countries have a long history of hostility. Admiral Yi Sun-sin, whose armor-plated boats eventually defeated the Japanese navy's damaging attacks in the 1590s, was South Korea's most revered national hero. The Japanese Ministry of Education, Science, and Culture's adoption in the 1980s of revised textbook guidelines, softening the language used to describe Japan's aggression during World War II, inspired outrage in South Korea as well as in other Asian countries. The textbook controversy was a major impetus for a national campaign to build an Independence Hall, located about 100 kilometers south of Seoul, to keep alive memories of Japanese colonial exploitation. Opened on August 15, 1987, the anniversary of Korea's liberation from Japan, the building houses grim exhibits depicting the atrocities of the Japanese military against Korean nationalists during the colonial period. During the colonial period, and particularly during World War II, the Japanese initiated assimilation policies designed to turn Koreans into obedient subjects of the Japanese emperor. Under the slogan Nissen ittai (Japan and Korea as One), newspapers and magazines published in the Korean language were closed, the Korean Language Society was disbanded, and Korean writers were forced to publish only in Japanese. Students who spoke Korean in school were punished. There was pressure to speak Japanese at home, adopt Japanese family and given names, and worship at Shinto shrines, the religious basis for which had been transplanted from the home islands. Korean Christians who refused to show reverence to the emperor as a divinity were imprisoned or ostracized. In the words of historian Ki-baik Lee (called Yi Kibeck in Korean), "Japan's aim was to eradicate consciousness of Korean national identity, roots and all, and thus to obliterate the very existence of the Korean people from the face of the earth." This shared historical experience has provoked not only hostility but also a desire to purge Korean culture of lingering Japanese influences. In the late 1980s, the government continued to prohibit the distribution of Japanese-made movies and popular music within the country in order to prevent unwanted contemporary influences from crossing the Korea Strait. On a more polite level, depiction of Japan as the "other" involves contrasting the "essences" of the two countries' cultures. This process has spawned a popular literature that compares, among other things, the naturalness and "resonance" of Korean art and music and the alleged imitativeness and constriction of their Japanese counterparts; the "individualism" (of a non-Western sort) of Koreans and the "collectivism" or group consciousness of the Japanese; and the lyric contrast between the rose of Sharon, Korea's national flower, which blooms robustly all summer long, and the Japanese cherry blossom, which has the "beauty of frailty" in springtime. The search for a cultural "essence" involves serious contradictions. The literature of Korean cultural distinction is strikingly similar to Japanese attempts to prove the "uniqueness" of their own cultural heritage, although "proof" of Japan's uniqueness is usually drawn from examples of Western countries (the significant "other" for modernized Japanese). Ironically, official and unofficial sponsorship of the Tangun myth, although a minor theme, bears an uncanny resemblance to pre World War II Japanese policies promoting historical interpretations of the nation's founding based on Shinto mythology. Mixed in with feelings of hostility and competition, however, is genuine admiration for Japanese economic, technological, and social achievements. Japan has become an important market for South Korean manufactured products. Both countries have been targets of criticism by Western governments accusing them of unfair trading practices. Friendly interest in South Korea is growing among the Japanese public despite old prejudices, and large numbers of young Japanese and South Koreans visit each others' countries on school and college excursions. Like South Koreans, Japanese liberals have been disturbed by official attempts to revise wartime history. The Korean Language Modern Korean language is descended from the language of the Silla Kingdom, which unified the peninsula in the seventh century. As Korean linguist Yi Ki-mun notes, the more remote origins of the Korean language are disputed, although many Korean linguists together with a few western scholars, continue to favor the now widely-contested nineteenth-century theory of an Altaic family of languages supposed to include Korean, Japanese, and Mongolian, among other languages. Although a historical relationship between Korean and Japanese has not been established, modern Korean and Japanese have many similar grammatical features, no doubt in part due to close contacts between the two during the past century. These similarities have given rise to considerable speculation in the popular press. The linguist Kim Chin-wu, for example, has hypothesized that Korea and Japan stood at the end of two routes of large-scale migration in ancient times: a northern route from Inner Asia and southern route from southern China or Southeast Asia. In a variant on the "southern origins" theory of some Japanese scholars, he views the two languages as reflecting disparate "northern" and "southern" influences, with Korean showing more influence from the northern, Inner Asian strain. Both Korean and Japanese possess what is sometimes called "polite" or "honorific" language, the use of different levels of speech in addressing persons of superior, inferior, or equal rank. These distinctions depend both on the use of different vocabulary and upon basic structural differences in the words employed. For example, in Korean the imperative "go" can be rendered kara when speaking to an inferior or a child, kage when speaking to an adult inferior, kaseyo when speaking to a superior, and kasipsio when speaking to a person of still higher rank. The proper use of polite language, or levels of polite speech, is an extremely complex and subtle matter. The Korean language, like Japanese, is extremely sensitive to the nuances of hierarchical human relationships. Two persons who meet for the first time are expected to use the more distant or formal terms, but they will shift to more informal or "equal" terms if they become friends. Younger people invariably use formal language in addressing elders; the latter will use "inferior" terms in "talking down" to those who are younger. The Korean language may be written using a mixture of Chinese ideograms (hancha) and a native Korean alphabet known as han'gul, or in han'gul alone, much as in a more limited way Indo-European languages sometimes write numbers using Arabic symbols and at other times spell numbers out in their own alphabets or in some combination of the two forms. Han'gul was invented by scholars at the court of King Sejong (1418-50), not solely to promote literacy among the common people as is sometimes claimed, but also, as Professor Gari K. Ledyard has noted, to assist in studies of Chinese historical phonology. According to a perhaps apocryphal decree of the king, an intelligent man could learn han'gul in a morning's time, while even a fool could master it in ten days. As a result, it was scorned by scholars and relegated to women and merchants. The script, which in its modern form contains forty symbols, is considered by linguists to be one of the most scientific ever devised; it reflects quite consistently the phonemes of the spoken Korean language. Because of its greater variety of sounds, Korean does not have the problem of the Japanese written language, which some experts have argued needs to retain a sizable inventory of Chinese characters to distinguish a large number of potentially ambiguous homophones. Since 1948 the continued use of Chinese characters in South Korea has been criticized by linguistic nationalists and some educators and defended by cultural conservatives, who fear that the loss of character literacy could cut younger generations off from a major part of their cultural heritage. Since the early 1970s, Seoul's policy governing the teaching and use of Chinese characters has shifted several times, although the trend clearly has been toward writing in han'gul alone. By early 1990, all but academic writing used far fewer Chinese characters than was the case in the 1960s. In 1989 the Korean Language and Education Research Association, citing the need for Chinese character literacy "at a time when the nation is entering into keen competition with Japan and China" and noting that Japanese educators were increasing the number of Chinese characters taught in elementary schools, recommended to the Ministry of Education that instruction in Chinese characters be reintroduced at the primary-school level. Although the Korean and Chinese languages are not related in terms of grammatical structure, more than 50 percent of all Korean vocabulary is derived from Chinese loanwords, a reflection of the cultural dominance of China over 2 millennia. In many cases there are two words--a Chinese loanword and an indigenous Korean word--meaning the same thing. The Chinese-based word in Korean sometimes has a bookish or formal flavor. Koreans select one or the other variant to achieve the proper register in speech or in writing, and to make subtle distinctions of meaning in accordance with established usage. Large numbers of Chinese character compounds coined in Japan in the nineteenth or twentieth centuries to translate modern Western scientific, technical, and political vocabulary came into use in Korea during the colonial period. Post-1945 United States influence has been reflected in a number of English words that have been absorbed into Korean. Unlike Chinese, Korean does not encompass dialects that are mutually unintelligible, with the possible exception of the variant spoken on Cheju Island. There are, however, regional variations both in vocabulary and pronunciation, the range being comparable to the differences that might be found between Maine and Alabama in the United States. Despite several decades of universal education, similar variations also have been heard between highly educated and professional speakers and Koreans of working class or rural backgrounds. Standard Korean is derived from the language spoken in and around Seoul. More than forty years of division has meant that there are also some divergences in the development of the Korean language north and south of the DMZ.
Seroprevalence and herd-level risk factors for seroprevalence of Leptospira spp. in sheep, beef cattle and deer in New Zealand. AIMS To determine seroprevalence of Leptospira borgpetersenii serovar Hardjo and L. interrogans serovar Pomona in beef cattle, sheep and deer in New Zealand and the association between farm-level risk factors and seroprevalence. METHODS Between June 2009 and July 2010, 20 serum samples per flock or herd were collected from 162 sheep flocks, and 116 beef cattle and 99 deer herds from 238 farms, along with farm data by interview. Samples were tested for antibodies to serovars Hardjo and Pomona by microscopic agglutination testing, with a titre ≥48 being positive. Species-specific associations between herd-level seroprevalence (number of seropositive animals, for each serovar, divided by the number of animals tested) and herd-level risk factors were determined by multivariable logistic regression analysis. Vaccinated animals were excluded from seroprevalence estimates but included in multivariable analyses. RESULTS For sheep (n=3,339), animal-level seroprevalence was 43.6 (95% CI=41.9-45.3)% for serovar Hardjo and 14.1 (95% CI=12.9-15.3)% for serovar Pomona; for beef cattle(n=1,886), it was 45.6 (95% CI=43.3-47.9)% for Hardjo and 19.6 (95% CI=17.9-21.5)% for Pomona; and for deer (n=1,870), it was 26.3 (95% CI=24.3-28.4)% for Hardjo, 8.8 (95% CI=7.6-10.2)% for Pomona. In sheep flocks (n=161), flock-level prevalence for Hardjo varied from 77.9-91.3%, and for Pomona from 40.4-73.9%, when ≥1, ≥2 or ≥3 animals were seropositive. In beef herds (n=95), herd-level prevalence for Hardjo varied from 79.0-90.5%, and for Pomona from 42.1-68.4%. In deer herds (n=93), herd-level prevalence for Hardjo varied from 45.2-59.1%, and for Pomona from 22.6-48.4%. For sheep flocks, herd-level seroprevalence for Hardjo was associated with flock size (OR=1.56) and number of dogs (OR=0.75), and for Pomona, seroprevalence varied with region. For beef cattle, herd-level seroprevalence for Hardjo was associated with herd size (OR=1.4), presence of dams (OR=0.6) and vaccination (OR=2.9), and for Pomona, co-grazing with deer (OR=0.4), vaccination (OR=3.22), presence of dams (OR=0.2) and streams (OR=2.7). For deer herds, seroprevalence for Hardjo or Pomona was associated with herd size (OR=1.6 and 1.8) and varied with region, and for Pomona seroprevalence varied with season (summer vs. winter: OR=4.8). CONCLUSIONS Serovars Hardjo and Pomona were highly prevalent at herd and animal levels, with serovar Hardjo highest in all species. Larger herd size was the common risk factor for seroprevalence in all livestock species.
Q: Assume that $X,X_1,X_2,...$ are iid with characteristic function $\phi(t)=\mathbb E[e^{itx}]$, and let $S_n = X_1 + X_2 + X_3 + ...$. Assume that $X,X_1,X_2,...$ are iid with characteristic function $\phi(t)=\mathbb E[e^{itx}]$, and let $S_n = X_1 + X_2 + X_3 + ...$. (a) For a random variable $X$, $X$ and $-X$ have the same distribution iff $\phi$ is real. Comment: I can show this by the inversion formula. I just plug in the formula; however, is there a simple way to see this rather than writing all the steps out? (b) Express the characteristic function of the sample average, $\phi_{\frac{S_n}{n}}(t)$, in terms of $\phi$. Comment: This one is easy. $\phi_{\frac{S_n}{n}}(t) = [\phi(\frac{t}{n})]^n$. (c) Assume $\phi'(0)=0$. Show that $\frac{S_n}{n}$ converges to zero in probability. I have no idea about this one. For (d) and (e), we assume $X$ has density: $f(x)=c\frac{1}{x^2 ln|x|} \chi_{\{|x|>4\}}$, where $c$ is the appropriate normalizing constant. (d) Show $\mathbb E{|X|}=\infty$ Commnet: Just plug in the definition formula of the expectation. (e) Show that the ch.f for $X$ has $\phi'(0)=0$. Like (c), I don't know how to show this one either. Thanks. A: Hints: (a) $X$ and $Y$ have the same distribution iff their characteristic functions are equal; (c) Lévy theorem; (e) $$1-\phi(t) = 2c\int_4^\infty \frac{(1-\cos tx)\, dx}{x^2\ln x} = 2ct \int_{4t}^\infty \frac{(1-\cos z)\, dz}{z^2(\ln z-\ln t)} = o(t),\ t\to 0. $$ in view of the dominated convergence theorem.
Increased occurrence of PGP 9.5-immunoreactive epidermal Langerhans cells in rat plantar skin after sciatic nerve injury. This study examines the occurrence and distribution of epidermal dendritic cells (DCs) in cryostate sections from plantar skin in normal rats and in rats with a crush injury or neurotomy and suture of the sciatic nerve. The dendritic cells were visualized with antibodies against protein-gene product 9.5 (PGP 9.5). Counts under the fluorescence microscope showed that the occurrence of dendritic cells is increased and that the proportion of dendritic cells in the basal layer is elevated 3 months after sciatic neurotomy and suture but not after a crush lesion. The countings also revealed that the number of cells is elevated as soon as 1 week after neurotomy and suture. Labelling with specific antibodies showed that the dendritic cells examined represent Langerhans cells (LCs). These observations show that there is a neural influence on the occurrence and distribution of PGP 9.5-immunoreactive epidermal Langerhans cells. Whether this influence is direct or indirect remains to be ascertained.
A winner of England's National Book Award, the acclaimed debut novel tells the outrageously funny, fantastic adventure story of Harry Potter, who escapes a hideous foster home thanks to a scholarship to The Hogwarts School for Witchcraft and Wizardry. Details ITEM#: 2647075 A winner of England's National Book Award, the acclaimed debut novel tells the outrageously funny, fantastic adventure story of Harry Potter, who escapes a hideous foster home thanks to a scholarship to The Hogwarts School for Witchcraft and Wizardry. Questions & Answers Shopping Guides Best Toys for Kids Ages 10-12 The list of hot toys for tweens is different every year because kids ages 10 to 12 are quick to embrace new fads and the latest trends. Regardless of the year, however, the basic criteria will never change. Toys and hobbies for this age group must always be creative, cutting-edge, and fun. Toys that let pre-teens express themselves and show their interests are sure to be a hit. Facts about Soccer Balls Obviously, having the right soccer ball is pretty important if you want to play a competitive soccer game. Once you've gotten your soccer cleats, soccer jerseys, soccer socks and other soccer gear ready to go, you aren't going to get very far without a soccer ball. There are three basic sizes of soccer balls. Players who are 5 to 8 years old play with a size three soccer ball. Youth soccer, ages 4 to 12, play with a size four, and anyone 13 and over plays with a size five. After that, soccer balls come in a variety of different materials and panel designs. A soccer ball has three basic pieces: the cover, the lining and the bladder. Each affects the "feel" and "control" of the ball. Rolex FAQ FAQs about Pre-Owned Rolex Watches | Overstock.comFAQs about Pre-Owned Rolex Watchesby Shawna Edwards I've never made a large purchase online. Why pick Overstock.com?Overstock.com is one of the largest retailers of high-end jewelry and watches. We have taken the time to create a Web environment that caters to our customers by allowing them to comfortably shop for wristwatches from the privacy of their homes. We offer our customers a wide variety of timepieces at the most competitive prices available. In addition to this, we want them to feel secure purchasing from us. Overstock.com is one of a handful of online high-end watch merchants that are capable of processing your credit card for your entire purchase. This allows "first-time buyers" to feel more secure in making a large purchase because they have an added layer of security via their credit card company. Do all your Rolex watches come with their serial numbers?Every Rolex watch sold by Overstock.com will have its unique Rolex serial and reference numbers in place and viewable by removing the watch band from the six o'clock and twelve o'clock ends. What is meant by "Perfect Like New Condition?""Perfect like new (day one) condition" watches are pre-owned Rolex timepieces that are purchased by Overstock.com in pristine, mint and immaculate condition. This obviously is the case cosmetically and mechanically. Every timepiece is thoroughly inspected to ensure that they are authentic and meet our quality standards. These luxury watches are so pristine that, in most cases, they are indistinguishable from new watches. Our men's watches and women's watches may have miniscule markings, and the watch bracelets will have miniscule amounts of stretch. Will my watch come with documentation?Every watch will come with detailed documentation stating a full watch description, serial number and model number. Being that the manufacturer's warranty has expired, you will receive a limited one-year warranty from our vendor. Will my watch be covered by a warranty, and what about post warranty service?Being that the manufacturer's warranties on these timepieces have expired, our vendor issues a one-year limited warranty on every watch. The warranty work is done by expert watchmakers who use only original manufacturers' parts and have decades of experience working with Rolex watches. After the one-year limited warranty has expired, you may continue to request service through our vendor who will service the watch when needed at industry cost prices. How can I be sure that the watch will fit my wrist?All our watches will fit up to a 6-and-a-half-inch wrist for a woman and for a man will fit up to a 7-and-a-half-inch wrist (extra links are available for additional charges). Rolex watches can be easily resized to fit any wrist by your local jeweler. How do I measure for my wrist size?You can get an approximate measurement of your wrist by using a soft measuring tape or measuring the inside of your best fitting watch. If you don't have a soft measuring tape, you can wrap a ribbon or a piece of string around your wrist at the wrist bone, mark the spot where it meets, and measure it against a ruler to determine your approximate wrist size. To get the best fit, measure fairly snug at the wrist bone. This is approximate sizing not a 100 percent guarantee of prefect sizing.If the watch is a gift and you do not know the recipient's wrist size, you can use the following as a guide (as with all products, the standard sizes depend on the manufacturer):Men's Standard Bracelet SizesInside, including watch face while bracelet is closedAdult Small5-1/2" to 6-1/2"Adult Average6-1/2" to 7-1/2"Adult Large7-1/2" to 8-1/2"Adult X-Large8-1/2" to 9-1/2" Women's Standard Bracelet SizesInside, including watch face while bracelet is closedAdult Small4-1/2" to 5-1/2"Adult Average5-1/2" to 6-1/2"Adult Large6-1/2" to 7-1/2"Adult X-Large7-1/2" to 8-1/2" Will the watch be fully water-resistant? And can I go swimming or shower with my watch?Every Rolex watch is fully tested for water resistance; the total depth rating is listed with every model. Drawing on years of experience, it is our recommendation that, though Rolex watches are water resistant, because of the fine nature of the timepiece, we discourage our customers from making a practice of taking them in the shower or pool. If for some reason the stem, which is the round mechanism found on the side of the case, which is unscrewed to set the time, is not completely screwed down, water could leak into the movement and damage the watch. (Please refer to your warranty card regarding water damage.) The chances are incredibly slim that this will happen, but nonetheless it is our recommendation that our customers refrain from taking their Rolex watches into the water to avoid any unnecessary problems. How does Overstock.com offer such great prices when my local jeweler has a similar piece for considerably more?Overstock.com has built the best connections in the business, affording us the ability to buy from dealers at the highest level of the industry. Through these connections we can buy in the largest quantities while getting the best pricing. Being that we are not an authorized dealer of Rolex or affiliated with Rolex, USA we are able to offer our customers rock bottom pricing without being subject to any manufacturer's price controls or policies. Do I need to be present to sign for the package?For your safety, you will need to sign for the package that contains your watch. If you are not present when it arrives, the package will not be left at your door. A door tag will be left to inform you when the courier will come to redeliver your package. Alternatively, you can call the courier to arrange a better delivery time or pick-up (with photo identification) at the local hub. What is the benefit of buying a pre-owned Rolex over a new one?Unlike new Rolex watches, pre-owned Rolex watches do not depreciate in value immediately after purchase. Therefore, buying a new Rolex watch is like buying a brand new car: The moment you drive it off the lot it has lost 20 to 30 percent of its value. With buying a pre-owned watch, you have effectively cut out any value depreciation and retail markup. Rolex watches hold their value over time; in most cases, a pre-owned Rolex can be resold at a price very close to your purchase price.Rolex designs don't change too often; therefore, owning a perfect condition pre-owned timepiece is as good as a new one, with no one knowing that the watch was purchased pre-owned. No one can spot a used Rolex on your wrist. With the proper care and maintenance, a Rolex lasts forever. How do I determine the age of my watch?You are guaranteed to receive a desirable modern watch with a fully automatic self-winding (or quartz movement depending on your purchase), with quickset date feature. Due to the fact that Rolex models are manufactured for a number of years, the year of your watch will be circa 1980s or 1990s. Every Rolex watch sold by Overstock.com will have its unique Rolex serial number, which determines the year of manufacture. Overstock.com and our Rolex Vendors are not affiliated with Rolex or Rolex, USA Inc., and are not an authorized Rolex dealer. Third party One-Year Warranty. Buy Pre-Owned Rolex Watches Back to Guides Directory Buy Pre-Owned Rolex Watches FAQs about Soccer Equipment Purchasing the right soccer equipment is essential to a good game. While you can get started with just a goal and a soccer ball, some additional soccer equipment is a good idea. Buying clothing and shoes specifically made for soccer improves comfort, while safety gear prevents injuries. How to Choose Kids Bicycles Buying a bicycle for a child is a big deal. If you choose the right bike, you may quickly be elevated to "Coolest Parent/Grandparent/Other Adult Ever." On the other hand, if you choose the wrong one, you will probably find yourself on the unpopular list for quite some time. Aside from knowing their favorite colors and selecting baskets or bells, there are many factors to consider when choosing children's bicycles. FAQs About Banned Books John Steinbeck, Toni Morrison, William Faulkner, Judy Blume, Maya Angelou, J.K. Rowling, Stephen King, and Mark Twain: What does each of these authors have in common? They have all written books that have been banned at one time or another. Combined, they have written some of the most influential novels in modern history and broken many records on bestseller lists. While a book can be banned for any number of reasons, banned books don't necessarily live up to their nefarious image. Here are a few of the most frequently asked questions about banned books. International Children's Clothing Sizing Guide If the children's clothing you're shopping for uses a sizing system you aren't familiar with, it can be a challenge to know what will fit. These size conversion charts will give you an easy reference when you're online shopping for newborn clothes, toddler clothes, boys' clothes, and girls' clothes. Check out the Overstock.com Apparel Size Guides to find the right U.S. sizes. Remember that, even with this clothing size conversion chart, children's clothes from different manufacturers often fit differently. You may find that some brands work better for tall, slim children, while other brands tend to fit short, chubby kids. Once you find a brand that fits your child's build, you may want to keep shoppping for it as they grow. Estate Jewelry Buying Guide If you love jewelry and fashion but find today's design trends don't inspire your senses, it's time to look at estate jewelry. Interest in vintage decor, accessories and heirlooms has increased in recent years, and this trend includes a renewed appreciation for vintage jewelry from the past. If you've ever seen stunning Art Deco rings or Edwardian brooches at auction, in pictures or in the media and wished you could wear such beautiful jewels, you'll be thrilled to search for these treasures among the varied offerings of estate jewelry. Perhaps you're intrigued by the creativity expressed in antique jewelry but are worried that you don't know how to buy vintage jewelry and get a good deal. This estate jewelry buying guide offers advice on purchasing and appreciating this jewelry to help you make an informed decision. 10 Fun Facts about Disney When Disneyland® opened in 1955, Walt Disney said: "Here age relives fond memories of the past ... here youth may savor the challenge and promise of the future. Disneyland is dedicated to the ideals, the dreams, and the hard facts that have created America ... with the hope that it will be a source of joy and inspiration to all the world." For decades, the beloved films and theme parks created by Disney® have captured the imaginations of young and old. Disney® has a long, exciting history, and here are some fun and lesser known facts. International Shoe Sizing Buying Guide If shoe sizes are listed using a system you aren't familiar with, it can be difficult to know how to buy shoes that will fit. Most of the shoes listed on Overstock.com are in U.S. sizes, which can make purchasing shoes online confusing if you are shopping internationally. This international shoe size conversion guide is here to give you an easy reference when you're shopping for shoes online. If it has been a while since you measured your feet, you'll want to do that first. Measure them late in the day, as they tend to be larger at this time. You should also wear the socks you plan to wear with your shoes. Have a friend trace your foot on a piece of paper, so you can stand up straight. Measure the tracing, finding the length of your foot in inches closest to the next 16th inch. Find the width of your foot, and then measure your other foot; use the measurements from the largest foot when referring to the shoe size conversion table. Remember that, even with the right shoe size, shoes from different manufacturers will fit differently. Be sure to read customer reviews to see if the shoes you are shopping for run true to size. FAQs about Certified Diamonds Diamond jewelry is an investment, so it's important to make sure you get what you pay for. Certified diamonds are popular because you'll know that you're getting the best diamond in your price range. Several laboratories in the diamond jewelry industry are trusted sources in certified diamonds; each follows a number of set guidelines for certifying and rating diamonds. Here are the answers to the most frequently asked questions about certified diamonds. Tips on Choosing a Baseball Glove When choosing a baseball glove, there are many factors to consider. Size, comfort and the position you are playing are important factors when making your choice, as is the material it is made from. Baseball gloves provide protection from speeding baseballs, and some gloves have more padding than others, depending on the position played. Whether you are choosing a baseball glove for your little league baseball player or yourself, you will need one that fits comfortably and is designed for the position that is being played. If the glove does not fit right, it can affect the performance of your game. Soccer Equipment Buying Guide Goooaaalll! You need correct soccer equipment if you love to hear that beautiful sound. As with any other sports equipment, the quality of soccer gear varies greatly from product to product. If you mainly get your soccer fix by playing in pick-up games here and there, there's no reason to splurge, but if you plan on playing competitively, you'll probably want to invest in some quality soccer gear. To help you save money on the right gear for your game, we've created this soccer equipment buying guide. Baseball Equipment Buying Guide It's no accident that baseball and softball continue to grow in popularity all over the world. Including the major leagues, minor leagues, college and semi-pro teams, baseball and softball is the most widely played team sport in America. This baseball equipment buying guide will help you select baseball gear that will help you learn to swing for the fences. International Clothing Sizing Buying Guide If the women's clothing you're shopping for is listed in a sizing system you aren't familiar with, it can be a challenge to know how to what will fit. This international clothing size conversion chart will give you an easy reference when you're online shopping for women's clothing, including plus-size women's clothing and juniors' clothing. Check out the Overstock.com Women's Measurement Guide for tips on measuring and use the Overstock.com Apparel Size Guides to find your U.S. size. Remember that, even with this clothing size conversion chart, women's clothes from different manufacturers will fit differently. How to Size Your Room For an Area Rug A rug in the right size can complement the whole room, accent furnishings, bring life to a dull room, or make a subtle statement. However, if it's too big or too small, it may leave the impression of an unfinished or poorly decorated room. Before you start shopping for area rugs, you'll want to size the room. This guide will help you to select the right size rug in any room. Best Educational Toys for Christmas Give your children the gift of learning by shopping for Christmas toys that are educational as well as fun. From the baby toys that develop early math skills to the kits that help older children explore science concepts, this year's top educational games and toys will keep kids entertained while they learn and grow. Tiger's Eye Jewelry Fact Sheet The tiger's eye is a widely sought-after gemstone from the quartz family. Tiger's eye is beautiful, mystical and versatile. This multihued gem is traditionally associated with the ninth wedding anniversary, and tiger's eye jewelry is resilient enough to withstand the rigors of everyday wear in a variety of settings and styles. Tiger's eye works well in a variety of jewelry selections, including tiger's eye earrings, necklaces, rings, brooches and bracelets. Add some tiger's eye jewelry to your collection to give your wardrobe a fantastical style. FAQs about Cal King Mattresses When talking about the rulers of the bedding kingdom there's no doubt that Cal king mattresses are the winner. This size of mattress is quickly becoming one of the most popular on the market. People love Cal king mattresses for a number of reasons, but everyone agrees: their jumbo size is simply terrific. Cal king mattresses are a great choice for people of all sizes, so whether you are 7'2" or 4'9", you will love the extra space they provide. If you are in the market for a new mattress and are considering a California king, you undoubtedly have questions. Feel free to take a look at the article below, where you will find answers to frequently asked questions about Cal king mattresses. Choosing a Projector Screen for Your Home Theater Once you've chosen a projector, it's time to complete your home theater with peripheral electronics and projector accessories. A good projection screen is essential for getting the best picture from your home theater projector. Several projector screen types will work in different home theater situations. Shipping & Returns Shipping: This item will be delivered to you via USPS Trackable Media Mail or UPS Mail Innovations and will take from 2 days to 3 weeks from the time the item leaves our warehouse. * Standard Return Policy: Items must be returned in new or unused condition and contain all original materials included with the shipment. More Details FINAL SALE EXCLUSION: Items marked as FINAL SALE are not returnable unless the problem you experience is the result of our error. * For your protection, all orders are screened for security purposes. If your order is selected for review, our Loss Prevention Team may contact you by phone or email. There may be a two business day delay to process your order. ** Most Oversize orders are delivered within 1-4 weeks. Some orders may take 6 weeks to be delivered. Featured Shop Overstock™ and find the best online deals on everything for your home and your family. We work every day to bring you discounts on new products across our entire store. Whether you're looking for memorable gifts or everyday essentials, you can buy them here for less.
Warning: Declaration of MD5::hash($input) should be compatible with Cryptography::hash($input, $algorithm = 'pbkdf2') in /homepages/15/d372878181/htdocs/angelika-waitschies/cms/symphony/lib/toolkit/cryptography/class.md5.php on line 54 Warning: Declaration of MD5::compare($input, $hash) should be compatible with Cryptography::compare($input, $hash, $isHash = false) in /homepages/15/d372878181/htdocs/angelika-waitschies/cms/symphony/lib/toolkit/cryptography/class.md5.php on line 54 Warning: Declaration of SHA1::hash($input) should be compatible with Cryptography::hash($input, $algorithm = 'pbkdf2') in /homepages/15/d372878181/htdocs/angelika-waitschies/cms/symphony/lib/toolkit/cryptography/class.sha1.php on line 53 Warning: Declaration of SHA1::compare($input, $hash) should be compatible with Cryptography::compare($input, $hash, $isHash = false) in /homepages/15/d372878181/htdocs/angelika-waitschies/cms/symphony/lib/toolkit/cryptography/class.sha1.php on line 53 Warning: Declaration of PBKDF2::compare($input, $hash) should be compatible with Cryptography::compare($input, $hash, $isHash = false) in /homepages/15/d372878181/htdocs/angelika-waitschies/cms/symphony/lib/toolkit/cryptography/class.pbkdf2.php on line 170 Warning: Declaration of AuthorDatasource::execute(&$param_pool) should be compatible with DataSource::execute(?array &$param_pool = NULL) in /homepages/15/d372878181/htdocs/angelika-waitschies/cms/symphony/lib/toolkit/data-sources/class.datasource.author.php on line 170 Warning: Declaration of SectionDatasource::execute(array &$param_pool) should be compatible with DataSource::execute(?array &$param_pool = NULL) in /homepages/15/d372878181/htdocs/angelika-waitschies/cms/symphony/lib/toolkit/data-sources/class.datasource.section.php on line 532 Warning: Declaration of StaticXMLDatasource::execute(&$param_pool) should be compatible with DataSource::execute(?array &$param_pool = NULL) in /homepages/15/d372878181/htdocs/angelika-waitschies/cms/symphony/lib/toolkit/data-sources/class.datasource.static.php on line 40 Warning: Declaration of DynamicXMLDatasource::execute(&$param_pool) should be compatible with DataSource::execute(?array &$param_pool = NULL) in /homepages/15/d372878181/htdocs/angelika-waitschies/cms/symphony/lib/toolkit/data-sources/class.datasource.dynamic_xml.php on line 200 Warning: Declaration of NavigationDatasource::execute(&$param_pool) should be compatible with DataSource::execute(?array &$param_pool = NULL) in /homepages/15/d372878181/htdocs/angelika-waitschies/cms/symphony/lib/toolkit/data-sources/class.datasource.navigation.php on line 110 Warning: Declaration of FrontendPage::generate($page) should be compatible with XSLTPage::generate() in /homepages/15/d372878181/htdocs/angelika-waitschies/cms/symphony/lib/toolkit/class.frontendpage.php on line 23 Fatal error: Uncaught TypeError: Argument 1 passed to GenericExceptionHandler::handler() must be an instance of Exception, instance of Error given in /homepages/15/d372878181/htdocs/angelika-waitschies/cms/symphony/lib/core/class.errorhandler.php:72 Stack trace: #0 [internal function]: GenericExceptionHandler::handler(Object(Error)) #1 {main} thrown in /homepages/15/d372878181/htdocs/angelika-waitschies/cms/symphony/lib/core/class.errorhandler.php on line 72
[Changes in the biological properties of the pertussis microbe exposed to antibiotics]. Experimental modeling of the process of variation of the pertussis causative agent grown on the casein-carbon agar medium with subtoxic doses of the widely used antibiotics was performed. Significant changes in the morphological, cultural and serological properties of the pertussis microbe, in its sensitivity to the antibiotics and bacteriocins, in the activity of glutamine synthetase and in the electrophoretic mobility of the protein components were shown. The antigen structure determined with the method of immune electrophoresis in the agar gel and the biochemical properties were the stable characteristics defining the population taxonomic position as Bordetella pertussis. Possible occurrence of atypical strains of the pertussis causative agent in the patients with the cough syndrome treated with the antibiotics is indicated. It is suggested that antibiotics may play a significant role in redistribution of subpopulations with different functional properties in the population of the pertussis microbe.
// // NSObject+Alive.swift // Pods // // Created by zixun on 16/12/13. // // import Foundation //-------------------------------------------------------------------------- // MARK: - NSObject+Alive // DESCRIPTION: NSObject extension for judge if the instance is alive //-------------------------------------------------------------------------- extension NSObject { //-------------------------------------------------------------------------- // MARK: INTERNAL FUNCTION //-------------------------------------------------------------------------- func judgeAlive() -> Bool { if self.isKind(of: UIViewController.classForCoder()) { return self.judge(self as! UIViewController) }else if self.isKind(of: UIView.classForCoder()) { return self.judge(self as! UIView ) }else { return self.judge(self) } } //-------------------------------------------------------------------------- // MARK: PRIVATE FUNCTION //-------------------------------------------------------------------------- /// judeg a comman instance is alive fileprivate func judge(_ common:NSObject) -> Bool { var alive = true if common.agent?.host == nil { alive = false } return alive } /// judge the controller instance is alive fileprivate func judge(_ controller:UIViewController) -> Bool { //1. self.view is not in the window //2. self is not in the navigation controllers var visiable = false var view = controller.view while ((view?.superview) != nil) { view = view?.superview } if view!.isKind(of: UIWindow.self) { visiable = true } var holdable = false if controller.navigationController != nil || controller.presentingViewController != nil { holdable = true } if visiable == false && holdable == false { return false }else { return true } } /// judge the view instance is alive fileprivate func judge(_ view:UIView) -> Bool { var alive = true var onUIStack = false var v = view while v.superview != nil { v = v.superview! } if v.isKind(of: UIWindow.classForCoder()) { onUIStack = true } if view.agent?.responder == nil { var r = view.next while r != nil { if r!.next == nil { break }else { r = r!.next } if (r?.isKind(of: UIViewController.classForCoder()))! { break } } view.agent?.responder = r } if onUIStack == false { alive = false if let r = view.agent?.responder { alive = r.isKind(of: UIViewController.classForCoder()) } } return alive } }
Q: MATLAB: How to publish figures in line instead of the bottom Matlabs 'publish' function creates a html with all my code, comments and figures. However, I would like the figures to appear at the location where I give the plot command (like e.g. in iPython) and not at the bottom like Matlab (R 2010b) does. I have looked at the 'Edit publish configurations' of publish but could not find the appropriate setting. Here is an example, where I would expect the figures to be plotted before the next data set is defined, however Matlab (R 2010b) plots them all the bottom. data1 = 1:10 figure plot(data1) data2 = 5:15 figure plot(data2) data3 = 1:30 figure plot(data3) data4 = 5:50 figure plot(data4) A: Put each plotting command within its own cell (defined by a %% line), for example: %% data1 = 1:10 figure plot(data1) %% data2 = 5:15 figure plot(data2) %% data3 = 1:30 figure plot(data3) %% data4 = 5:50 figure plot(data4) When publishing a script, cells get processed one by one, and the output gets held together in one place. You can include headings for each cell following the %% characters.
Background {#Sec1} ========== Preparation of high-quality genomic DNA is critical for biotechnology applications, as well as molecular genetic studies. Isolation of DNA from agronomically important crops, such as sugarcane, rice, citrus, potato and tomato remains a limiting step due to the presence of high polysaccharides, polyphenols, and other secondary metabolites \[[@CR1]--[@CR5]\]. Furthermore, levels of these compounds accumulate in plants under abiotic and biotic stresses, such as drought or pathogen infection \[[@CR6], [@CR7]\]. These metabolites tend to copurify with DNA, interfering with downstream applications, including Southern blot hybridization, marker-assisted polymorphism detection, next-generation sequencing, PCR sequencing, and bacterial artificial chromosome library construction \[[@CR5], [@CR8]--[@CR11]\]. A growing number of methods exist for isolating DNA from tissues of plant species with a high content of polysaccharides and/or secondary metabolites. These methods mainly use detergent-based extraction buffers containing cetyltrimethylammonium bromide (CTAB) \[[@CR12]--[@CR16]\], sodium dodecyl sulfate (SDS) \[[@CR17]--[@CR20]\] and guanidine \[[@CR21]\]. Some methods have included in the CTAB or SDS extraction buffer, sugars such as mannitol \[[@CR22]\] or sorbitol \[[@CR23], [@CR24]\], antioxidants such as PVP-40 (polyvinylpyrrolidone; molecular weight, 40,000) \[[@CR3], [@CR5], [@CR11], [@CR25]--[@CR30]\], or high salt \[[@CR31], [@CR32]\]. Most methods use phenol/chloroform for purification of the extracted DNA; while others add a purification step, by binding the extracted DNA to glass fiber coated plate wells \[[@CR33]\] or to an anion exchange column \[[@CR34]\]. Here, we describe a simple, rapid and scalable procedure for isolation of high-quality and -quantity DNA from sugarcane, rice, citrus, potato, and tomato leaf tissue. The procedure is a simplified SDS extraction method with sequential steps of purification to remove polysaccharides and polyphenols using 2-mercaptoethanol and potassium acetate, chloroform partitioning, and sodium acetate/ethanol precipitation. We achieved high yields and quality of DNA consistently from small amounts of tissue samples for these different plant species in a short period of time with this new isolation method. Methods {#Sec2} ======= Genetic constructs and plant transformation {#Sec3} ------------------------------------------- The *gus* gene (*gusA*, 1.811 kilobase \[kb\]) was cloned into the binary vector pBIN34S carrying the selectable marker neomycin phosphotransferase gene, to produce pBIN34S:*GUS* \[[@CR35]\] for citrus transformation. pBIN34S:*GUS* was transformed into sweet orange (*Citrus sinensis* L. cv. Hamlin) and potato (*Solanum tuberosum* L. cv. Atlantic) using *Agrobacterium tumefaciens* strain EHA105 \[[@CR36]\] and seedling-derived epicotyl (citrus) and internodal (potato) segments \[[@CR35]\]. The pCAMBIA1301 binary vector carrying the *SHDIR16*:*GUS* construct (*gus* gene under the control of the culm-regulated *Saccharum* spp. hybrids *dirigent16* promoter) \[[@CR37]\] was used for transformation of rice (*Oryza sativa* subspecies *japonica*, cultivar Taipei 309), using embryo-derived calli and *A. tumefaciens* strain EHA105 \[[@CR38]\]. The *SHDIR16*:*GUS* construct together with the *Ubi1*:*BAR*/pUC8 (pAHC20) plasmid containing the *bar* (bialaphos resistance) selectable marker (under the control of the maize *ubiquitin 1* promoter) \[[@CR39]\], were introduced into embryonic callus established from young leaf bases and immature flowers of commercial sugarcane (*Saccharum* spp. hybrids, cv. CP72-1210) by particle gun bombardment, as described previously \[[@CR40]\]. Plant growth {#Sec4} ------------ Sugarcane, rice and sweet orange were grown in Redi-Earth mix (Scotts, Hope, AR) in a controlled-environment greenhouse (28 °C with 14-h-light/10-h-dark). Tomato and potato were grown in Sunshine MVP mix (Sun Gro Horticulture, Agwam, MA, USA) in a controlled-environment room with sodium lamps (24 °C with 14-h-light/10-h-dark). DNA isolation protocol {#Sec5} ---------------------- A simple and rapid protocol (TENS-CO), as described below, was developed for isolating DNA from sugarcane, rice, citrus, potato, and tomato tissues. The protocol steps are also outlined in Table [1](#Tab1){ref-type="table"}.Table 1Major steps of the TENS-CO protocol used for plant genomic DNA isolation(1) ExtractionTENS buffer^a^ and CO^b^5 M potassium acetate(2) Precipitation3 M sodium acetate (pH 5.2) (0.1× volume)Ethanol (2.0× volume)^a^ TENS buffer: 100 mM Tris (hydroxymethyl) aminomethane (Tris Base) (pH 8.0), 50 mM ethylenediamine-tetraacetic acid (EDTA) (pH 8.0), 500 mM sodium chloride (NaCl), 1% (w/v) sodium dodecyl sulfate (SDS), and 2% (v/v) 2-mercaptoethanol^b^ *CO* chloroform:octanol (24:1) ### Isolation of DNA by the TENS-CO method {#Sec6} #### Extraction {#Sec7} Fresh tissue from young leaves (0.15 g) (snap frozen in liquid nitrogen, mostly used) was homogenized in 2 ml screw-cap microcentrifuge tubes for 20 s at 5000 rpm with the Precellys 24 homogenizer (MO BIO Laboratories, Carlsbad, CA, USA) in the presence of two steel BB air gun beads (BB refers to the bead size, 4.5 mm-diameter) (Walmart Supercenter, Bentonville, AR, USA). Up to 24 samples could be processed at a time with this homogenizer. Alternative to liquid nitrogen, microcentrifuge tubes with leaf samples were frozen at -- 80 °C for at least 1 h before homogenizing. Extraction buffer (1.25 ml) was added to each homogenized leaf sample and mixed by vortexing. The extraction buffer consisted of 100 mM Tris (hydroxymethyl) aminomethane (Tris Base), 50 mM ethylenediamine-tetraacetic acid (EDTA) (pH 8.0), 500 mM sodium chloride (NaCl), 1% (w/v) sodium dodecyl sulfate (SDS), and 2% (v/v) 2-mercaptoethanol. The homogenate was incubated at 65 °C for 30 min and centrifuged at 10,000×*g* for 10 min. The collected supernatant (1.3 ml) was mixed with 0.4× volume of 5 M potassium acetate (KOAc) (520 µl), vigorously mixed by hand, and incubated on ice for 20 min. The mixture was centrifuged at 10,000×*g* for 15 min at 4 °C. The supernatant (1.4 ml) was collected and mixed with 0.5× volume of chloroform:octanol (24:1) (700 µl) vigorously by inversion for 10 min, and centrifuged at 13,000×*g* for 15 min. The upper aqueous phase (1.2 ml) was collected, mixed with 66 µg of RNase (6.6 µl of 10 mg/ml), and incubated in a 37 °C water bath for 1 h. #### Precipitation {#Sec8} The mixture was added to 0.1× volume of 3 M sodium acetate (pH 5.2) and 2× volume of ice-cold 100% (v/v) ethanol and incubated at -- 20 °C for 1 h. The DNA pellet was recovered by centrifugation at 12,000×*g* for 10 min at 4 °C, washed with 70% (v/v) ethanol, air-dried, and dissolved in 200--400 µl of nuclease-free water. ### Comparative analysis of the TENS-CO method with standard isolation methods {#Sec9} An SDS-based method (modified from Tai and Tanksley \[[@CR20]\]) and a CTAB-based method (modified from Chee et al. \[[@CR41]\]) conventionally used for sugarcane and citrus (3.0 g of tissue), respectively, were tested in parallel with the TENS-CO method (0.15 g of tissue) for DNA extraction. Two commercial kits, PowerPlant Pro DNA Isolation Kit (SDS-based; MO BIO Laboratories; for rice, potato and tomato) (0.15 g of tissue) and Synergy Plant DNA Extraction Kit (CTAB-based; OPS Diagnostics, Lebanon, NJ, USA; for potato and tomato) (0.05 g of tissue) were also tested. DNA yield and purity {#Sec10} -------------------- DNA was quantified by measuring the concentration and absorbance (A) level at 230, 260, and 280 nm using a NanoDrop 1000 Spectrophotometer (Thermo Fisher Scientific, Wilmington, DE, USA). The absorbance ratios of A~260:280~ and A~260:230~ were used to determine the purity of DNA. The quality of DNA was examined by electrophoresis on 0.8% agarose gels stained with ethidium bromide. Southern blot analysis {#Sec11} ---------------------- Genomic DNA was isolated from young leaves of 6-month-old transgenic sweet orange and potato plants, and 3--4 month-old transgenic sugarcane and rice plants. Genomic DNA (15 µg each lane) was digested overnight with either *Hind*III (sweet orange and potato) or *Sac*I (sugarcane and rice), electrophoresed on 0.8% (w/v) agarose gels and transferred to nylon membranes (Amersham Hybond-XL, GE Healthcare Bio-Sciences Corp., Piscataway, NJ, USA) in an alkaline solution (0.4 M sodium hydroxide) \[[@CR42]\]. DNA blots were hybridized with the full-length coding region of *gusA* (2.28 kb). The *gusA*-specific probe was obtained from pAHC27 \[[@CR39]\] by *BamH*I and *Sac*I digestion. Probes were labeled with \[^32^P\] α-dCTP by random priming using the Random Primers DNA Labeling kit (Invitrogen, Carlsbad, CA, USA). Pre-hybridization, hybridization, washing and detection of DNA gel blots were performed as described by Mangwende et al. \[[@CR43]\], using Church's buffer. Quantitative real-time PCR {#Sec12} -------------------------- DNA was isolated from leaves of 6 week-old healthy and *Candidatus* Liberibacter solanacearum (Lso) infected potato plants. Top-most fully expanded non-inoculated leaves were collected from healthy and Lso infected plants (10 psyllids per plant) at 21 days post infestation. Quantitative real-time PCR (qPCR) was used to detect Lso in infected and healthy samples with CL-ZC primers specific for detection of Lso \[[@CR44]\] and *TOMATO RIBOSOMAL PROTEIN L2* (RPL2) (GenBank accession no. X64562) endogenous reference gene primers \[[@CR45]\]. The primer sets for Lso (CL-ZC-F: 5′-ACCCTGAACCTCAATTTTACTGAC-3′ and CL-ZC-R: 5′-TCGGATTTAGGAGTGGGTAAGTGG-3′) and RPL2 (RPL2-F: 5′-GAGG-GCGTACTGAGAAACCA-3′; RPL2-R: 5′-CTTTTGTCCAGGAGGTGCAT-3′) were used to perform qPCR on a CFX384™ Real-Time PCR Detection System (Bio-Rad Laboratories, Inc., Hercules, CA, USA) with the i*Taq*™ universal SYBR^®^ Green supermix (Bio-Rad Laboratories, Inc.), 0.2 µM of target specific primer and 50 ng of genomic DNA, according to the manufacturer's instructions. qPCR was performed on DNA from four biological samples with three technical replicates per sample using the following conditions: one cycle at 95 °C for 3 min, 39 two-step cycles each at 95 °C for 15 s and 55 °C for 30 s, and a final melting curve of 65--95 °C for 5 s. Results were analyzed and recorded as C~t~ (threshold cycle) values, and melt curve analysis was performed to detect non-specific amplification. Quantification of Lso in the infected versus healthy tissues was determined relative to that of the *RPL2* gene using the comparative C~t~ method (2^− ΔΔCt^) \[[@CR46]\]. Marker-assisted selection {#Sec13} ------------------------- The co-dominant Sequence Characterized Amplified Regions (SCAR) marker P6-25 linked to *Tomato yellow leaf curl virus* (TYLCV) resistance gene *Ty*-*3* \[[@CR47]\] was used to select for resistant plants. DNA was isolated from leaves of segregating tomato lines at the Vegetable Breeding Program, Texas A&M AgriLife Research-Weslaco, Texas. PCR was performed on a C1000 Touch™ thermal cycler (Bio-Rad Laboratories, Inc.) in a total reaction volume of 25 µl using 100 ng of DNA, 0.2 µM of each target specific primer, 1.0 U of Platinum™ *Taq* DNA polymerase (Invitrogen), 1× PCR buffer, 1.5 mM of MgCl~2~ and 0.2 mM of each dNTP. PCR conditions were: one denaturing cycle at 94 °C for 4 min, 35 cycles each at 94 °C for 30 s, 53 °C for 1 min and 72 °C for 1 min, and a final extension cycle at 72 °C for 10 min. PCR amplicons were separated by electrophoresis on a 1.5% (w/v) agarose gel stained with ethidium bromide. Allele identification was performed based on fragment sizes as reported by Ji et al. \[[@CR47]\]. Results and discussion {#Sec14} ====================== Preparation of high-quality and -quantity DNA by the TENS-CO method {#Sec15} ------------------------------------------------------------------- The TENS-CO method yielded DNA with high-purity and -integrity from liquid nitrogen and − 80 °C frozen tissue as reflected by the intact bands in gel electrophoresis (Fig. [1](#Fig1){ref-type="fig"}a, b) and low levels of polysaccharides/phenols as indicated by the spectrophotometric A~260~:A~230~ ratio values of 2.04, 2.18, 2.08, 2.23 and 2.10 for sugarcane, rice, sweet orange, potato, and tomato, respectively (Table [2](#Tab2){ref-type="table"}). Ratio values above 1.9 are considered acceptable and indication of high-quality DNA. The presence of high amounts of NaCl (0.5 M) in the TENS-CO extraction buffer was efficient in increasing the solubility of polysaccharides, reducing their coprecipitation with the DNA in subsequent steps \[[@CR48]\]. In addition, the incorporation of 2-mercaptoethanol into the extraction buffer helped in reducing phenolics oxidation and precipitation with DNA.Fig. 1Assessment of the integrity of the genomic DNA isolated with the TENS-CO method by gel electrophoresis. DNA extracted from leaves of different plant species using TENS-CO after freezing (snap) in liquid nitrogen (**a**, **b**) or to -- 80 °C (**b**) as well as two commercial DNA isolation kits (**c**) was electrophoresed on a 0.8% (w/v) agarose gel stained with ethidium bromide (approximately 300--400 ng per lane) Table 2Comparison of the TENS-CO method with standard DNA isolation procedures for the crop species used in the current studyMethodDNA yield (µg/mg tissue)DNA purityA~260~:A~230~A~260~:A~280~*Grass*Sugarcane (*Saccharum* spp. hybrids) TENS-CO0.46 ± 0.052.04 ± 0.111.85 ± 0.01 Standard SDS (modified from Tai and Tanksley \[[@CR20]\])0.10 ± 0.011.61 ± 0.071.96 ± 0.02*Cereal*Rice (*Oryza sativa* L. sp. *japonica*) TENS-CO0.35 ± 0.052.18 ± 0.071.93 ± 0.01 MO BIO PowerPlant Pro Kit0.10 ± 0.012.02 ± 0.051.84 ± 0.01*Citrus*Sweet orange (*Citrus sinensis* L. cv. Hamlin) TENS-CO0.64 ± 0.082.08 ± 0.042.00 ± 0.01 Standard CTAB (modified from Chee et al. \[[@CR43]\])0.12 ± 0.012.32 ± 0.091.92 ± 0.02*Vegetables*Potato (*Solanum tuberosum* L. cv. Atlantic) TENS-CO0.50 ± 0.042.23 ± 0.0061.91 ± 0.04 MO BIO PowerPlant Pro Kit0.05 ± 0.0042.41 ± 0.051.94 ± 0.03 Synergy Plant DNA Kit0.20 ± 0.012.18 ± 0.051.93 ± 0.02Tomato (*Solanum lycopersicum* L. cv. Lance) TENS-CO0.66 ± 0.062.10 ± 0.051.93 ± 0.01 MO BIO PowerPlant Pro Kit0.05 ± 0.0041.87 ± 0.081.80 ± 0.01 Synergy Plant DNA Kit0.11 ± 0.011.93 ± 0.031.81 ± 0.01*CTAB* cetyltrimethylammonium bromide and *SDS* sodium dodecyl sulfate The TENS-CO method was also efficient in removing proteins, with DNA samples repeatedly exhibiting A~260~:A~280~ ratio values of 1.85 for sugarcane, 1.93 for rice, 2.00 for sweet orange, 1.91 for potato, and 1.93 for tomato (Table [2](#Tab2){ref-type="table"}). The A~260~:A~230~ and A~260~:A~280~ ratios for MO BIO PowerPlant Pro DNA Isolation and Synergy Plant DNA kits were acceptable (Table [2](#Tab2){ref-type="table"}), but the low yield restricts the applicability of the isolated DNA (Table [2](#Tab2){ref-type="table"}). The incorporation of high concentrations of KOAc (5 M) aided in neutralizing the lysis produced by the TENS-CO buffer reaction and precipitating proteins that bind to SDS, thereby eliminating excess of proteins that form in the pellet after centrifugation. The TENS-CO method produced good yields of DNA, equally from liquid nitrogen and − 80 °C frozen tissue, for sugarcane (0.46 ± 0.05 µg/mg), rice (0.35 ± 0.05 µg/mg), sweet orange (0.64 ± 0.08 µg/mg), potato (0.50 ± 0.04 µg/mg), and tomato (0.66 ± 0.06 µg/mg) (Table [2](#Tab2){ref-type="table"}). The DNA concentrations were significantly higher than those obtained with the high-volume detergent-based standard isolation methods containing SDS (sugarcane, 0.10 µ/mg) and CTAB (sweet orange, 0.12 µg/mg) (Table [2](#Tab2){ref-type="table"}). The commercial kits yielded low amounts of DNA for all species tested, i.e. rice (0.10 µg/mg for the SDS-based MO BIO PowerPlant Pro DNA isolation kit), potato (0.05 µg/mg for the MO BIO kit and 0.2 µg/mg for the CTAB-based Synergy Plant DNA kit), and tomato (0.05 µg/mg for the MO BIO kit and 0.11 µg/mg for the Synergy Plant DNA kit) (Table [2](#Tab2){ref-type="table"}); furthermore, there was a mild degradation of the DNA as a result of the harsh homogenization suggested in the manufacturer's protocols (Fig. [1](#Fig1){ref-type="fig"}c). The TENS-CO method also resulted in higher yields of DNA from sugarcane than those reported by Vaze et al. \[[@CR49]\] (0.025--0.1 µg/mg), and Honeycutt et al. \[[@CR50]\] (0.28 µg/mg) (Additional file [1](#MOESM1){ref-type="media"}: Table S1). Similar results were observed for citrus and tomato DNA yields, which were less than 0.15 and 0.08 µg/mg, respectively (Additional file [1](#MOESM1){ref-type="media"}: Table S1) \[[@CR4], [@CR10], [@CR51]\]. Optimization of the TENS-CO isolation method was achieved by reducing the leaf tissue weight from 0.4 to 3.0 g usually required for standard isolation methods for sugarcane, rice, citrus, potato and tomato to 0.15. Automated tissue homogenization allowed the extraction of 24 samples in a very short period of time (20 s) in small tubes (2 ml), using a reduced extraction volume (1.25 ml). High-throughput extractions could be achieved with TENS-CO by using higher capacity homogenizers. The TENS-CO method is a simplified DNA isolation technique that uses SDS and an antioxidant (2-mercaptoethanol) for extraction and one precipitation step (ethanol) to yield high-quantity and -quality DNA from small amounts of tissue (0.15 g). The method is simplified and rapid in terms of requiring minimal manipulation, smaller extraction volume, reduced time needed for tissue homogenization (20 s) and DNA precipitation (one precipitation for 1 h). The procedure is scalable and can be used to study a larger number of samples. DNA isolated with the TENS-CO method is suitable for Southern blot analysis {#Sec16} --------------------------------------------------------------------------- Southern blot analysis is a robust technique widely used for molecular characterization of transgenics. A total of 11 sugarcane, 17 rice, six sweet orange and seven potato transgenic lines constitutively expressing the *gusA* reporter gene were used in this study. To demonstrate the suitability of the TENS-CO method for detecting specific genes, we determined the presence of the *gusA* transgene in transgenic sugarcane, rice, sweet orange and potato lines using Southern blot hybridization. Sugarcane and sweet orange genomic DNA, isolated by the TENS-CO and the standard methods (SDS- and CTAB-based methods for sugarcane and sweet orange, respectively) was digested with *Hind*III and *Sac*I, respectively and subsequently hybridized with the *gusA* probe. Transgenic sugarcane (Fig. [2](#Fig2){ref-type="fig"}) and sweet orange (Fig. [3](#Fig3){ref-type="fig"}) lines exhibited similar profiles of DNA isolated with the TENS-CO and standard methods. Binding of the *gusA* probe was as specific with DNA extracted by the TENS-CO as the one isolated with the standard methods (Figs. [2](#Fig2){ref-type="fig"}, [3](#Fig3){ref-type="fig"}, respectively), indicating that the DNA is intact. Furthermore, DNA extracted from the rice and potato transgenic lines using the TENS-CO and the traditional SDS- and CTAB-based methods displayed the same DNA hybridization profiles (data not shown). This indicates that the DNA isolated with the TENS-CO method is reproducible and can be used for screening a large number of transgenic lines of diverse plant species with high polysaccharides and secondary metabolites.Fig. 2Southern blot analysis of *Hind*III-digested genomic DNA of representative sugarcane lines overexpressing the *gusA* reporter gene hybridized with a ^32^P-labeled DNA probe specific for *gusA*. DNA (15 µg each lane) was digested, blotted, hybridized, washed and imaged as described in methods Fig. 3Southern blot analysis of *Sac*I-digested genomic DNA of representative citrus (sweet orange) lines overexpressing the *gusA* reporter gene hybridized with a ^32^P-labeled DNA probe specific for *gusA*. DNA (15 µg each lane) was digested, blotted, hybridized, washed and imaged as described in methods DNA isolated with the TENS-CO method is successfully used for molecular diagnostics and pathogen detection {#Sec17} ---------------------------------------------------------------------------------------------------------- *Candidatus* Liberibacter solanacearum (Lso), an unculturable, phloem-limited bacterium transmitted by the potato/tomato psyllid *Bactericera cockerelli*, causes Zebra chip disease, which is a serious threat to potato and other Solanaceous crops, leading to significant economic losses in Central America, Mexico and the United States \[[@CR52]--[@CR54]\]. To date, no Lso-resistant varieties of potato or tomato have been reported. Recent control strategies of Zebra chip disease involved the use of insecticides to control psyllid populations in Lso-infected fields. Early detection of Lso in host leaves is crucial to strategies for the containment of the disease in its early stages, and qPCR is commonly used for this purpose \[[@CR53]--[@CR55]\]. The sensitivity and specificity of qPCR to detect pathogen in host tissue is dependent on various factors, including the quality of DNA. We tested the quality of DNA extracted by the TENS-CO method, as compared to the standard CTAB method for the detection of the Lso titer present in leaves of four potato plants infected with Lso (Lso1, Lso2, Lso3 and Lso4) using qPCR analysis. The qPCR results (from four biological samples and three technical replicates per sample) showed the presence of higher bacterial levels in all four Lso-infected potato samples as compared to non-infected ones, using DNA isolated with both TENS-CO and standard CTAB methods (Fig. [4](#Fig4){ref-type="fig"}a, b). The Lso levels detected with DNA from both methods were comparable, i.e. they were 434.5 (TENS-CO) or 338.6 (CTAB), 552.6 (TENS-CO) or 456.8 (CTAB), 573.6 (TENS-CO) or 486.8 (CTAB) and 675.6 (TENS-CO) or 606.8 (CTAB) fold more in Lso1, Lso2, Lso3 and Lso4 potato plants than in non-infected ones, respectively (Fig. [4](#Fig4){ref-type="fig"}a and b). The detection of different levels of Lso in all tested samples indicates that the TENS-CO DNA is of high quality to generate reproducible detection of microbial pathogens in host tissue.Fig. 4Quantification of the Zebra chip bacterium *Candidatus* Liberibacter solanacearum (Lso) in potato using quantitative PCR. Lso is detected in leaf DNA extracted with the TENS-CO method (**a**) or the standard CTAB-based method (modified from Chee et al. \[[@CR43]\]) (**b**). Error bars indicate standard error of four biological replicates and at least three technical replicates DNA isolated with the TENS-CO method is successfully used for marker-assisted selection {#Sec18} --------------------------------------------------------------------------------------- Crop cultivar development can be accelerated by the utilization of molecular tools that can reduce the time and cost of screening plants with desired traits. Marker-assisted selection has been successfully used in the selection of several specific genes/alleles for crop improvement to trace favorable alleles, pyramid desired genes into one genetic background, eliminate unwanted traits by breaking undesirable linkage, and increase the frequency of desired alleles in early segregating populations \[[@CR56]\]. A major disease affecting tomato production worldwide, especially in tropical and subtropical areas is TYLCV, vectored by whiteflies (*Bemisia tabaci*). Once tomato plants are infected, leaves curl upward and show strong crumpling, interveinal, and marginal yellowing, negatively impacting yield. Several major resistance genes for TYLCV have been identified, including the *Ty*-*3* gene from tomato wild-relative *S. chilense* \[[@CR57]\]; however, this gene needs to be introgressed and stacked into locally adapted cultivars to ensure long-lasting disease resistance. Since marker-assisted selection requires genotyping large segregating populations, nucleic acid isolation methods that are simple, rapid and efficient will be useful. In order to test the TENS-CO method for marker-assisted breeding purposes, tomato plants from F~2~ segregating populations carrying the *Ty*-*3* resistance gene were evaluated for the presence or absence of the linked co-dominant SCAR marker P6-25. PCR amplification using DNA extracted with the TENS-CO method resulted in distinct P6-25 polymorphic amplicons linked to the *Ty*-*3* resistance gene (Fig. [5](#Fig5){ref-type="fig"}a). The amplicons obtained with DNA from the TENS-CO method were of the same size but of a higher intensity than those generated with DNA from the standard CTAB method (Fig. [5](#Fig5){ref-type="fig"}a, b). The 450-base pair (bp) and 650-bp fragments are linked to *Ty*-*3* resistance locus introgressed from *S. chilense* accessions LA2779 (*Ty*-*3*) and LA1932 (*Ty*-*3a*), respectively; while the 320-bp fragment corresponded to the sequence of the cultivated susceptible *S. lycopersicum* (*ty*-*3*) \[[@CR57]\]. By this procedure, resistant homozygous and heterozygous plants can be distinguished from susceptible homozygous plants prior to field evaluation. DNA extraction with the TENS-CO method is cost effective, time saving, and amenable for semi-automated genotyping to screen large populations using conventional molecular laboratory equipment as part of a marker-assisted selection program.Fig. 5Marker-assisted selection using the co-dominant SCAR marker P6-25 linked to *Ty3* resistance gene in tomato \[[@CR57]\]. PCR amplicons from DNA extracted with the TENS-CO method (**a**) or the standard CTAB-based method (modified from Chee et al. \[[@CR43]\]) (**b**); were separated by electrophoresis on a 1.5% (w/v) agarose gel Conclusions {#Sec19} =========== Genomic DNA isolation procedures have improved drastically over the past decade and are a powerful tool in molecular genetic and genomic research. To facilitate molecular genetic studies in major agronomic crops, we have developed a simple, rapid, reproducible and scalable protocol enabling efficient and robust isolation of high-quality and -quantity DNA from sugarcane, rice, citrus, potato, and tomato, thereby reducing significantly the time and resources used for DNA isolation. Compared to other protocols, the TENS-CO method is a simplified method consisting of one extraction step, using SDS and chloroform with 2-mercaptoethanol as an antioxidant, and one step of precipitation (sodium acetate/ethanol). We have demonstrated that the method accelerates screening of large amounts of plant tissues from species that are rich in polysaccharides and secondary metabolites for Southern blot analysis, marker-assisted selection and quantitative PCR applications. Additional file {#Sec20} =============== **Additional file 1: Table S1.** Comparison of the TENS-CO method with other DNA isolation procedures used for plant species with high level of secondary metabolites.  BAR : bialaphos resistance C~T~ : threshold cycle CTAB : cetyltrimethylammonium bromide EDTA : ethylenediamine-tetraacetic acid GUS : β-glucuronidase KOAc : potassium acetate Lso : *Candidatus* Liberibacter solanacearum NaCl : sodium chloride PVP : polyvinylpyrrolidone qPCR : quantitative polymerase chain reaction RPL2 : *tomato ribosomal protein L2* SCAR : sequence characterized amplified regions *SHDIR16* : *Saccharum* spp. hybrids *dirigent16* SDS : sodium dodecyl sulfate TYLCV : *tomato yellow leaf curl virus* *Ubi1* : maize *ubiquitin 1* Kelvin T. Chiong and Mona B. Damaj contributed equally to this work **Electronic supplementary material** The online version of this article (10.1186/s13007-017-0255-6) contains supplementary material, which is available to authorized users. KTC, MBD, CSP, CAA and SRP conceived and designed the experiments. KTC, CSP, SRP, NRR, MBD and DVC performed the experiments. KTC, MBD, SRP, CSP, CAA and DVC analyzed the data. MBD, KTC, CSP, CAA, SRP, TEM and KKM contributed to manuscript preparation. All authors read and approved the final manuscript. Acknowledgements {#FPar1} ================ The authors wish to thank Joe Molina and Denise Rossi (Texas A&M AgriLife Research) for excellent technical support. Competing interests {#FPar2} =================== The authors declare that they have no competing interests. Availability of data and materials {#FPar3} ================================== All data generated or analyzed during this study are included in this manuscript and its supplementary information file (Additional file [1](#MOESM1){ref-type="media"}: Table S1). Ethics and consent {#FPar4} ================== Not applicable. Funding {#FPar5} ======= This study was funded by Southern Gardens Citrus (Clewiston, Florida) to T.E.M., Texas A&M AgriLife Research Bioenergy/Bioproducts Grant to K.K.M., and Texas A&M AgriLife Research Grant FY16 124185-96180 to C.A.A. All experiments have been conducted following the guidelines of Texas A&M University Institutional Biosafety Committee. Publisher's Note {#FPar6} ================ Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
It's a whole lot better than the last Raw Tanned Leather I bought. I haven't seen anything close to the quality of this product in this price range. It's very good value for the product price. Shaheer Ansari Shaheer AnsariAug 16, 2019 5 Most valuable product Raw Tanned Leather I have ever puchased and I really suggest you guys to have it as well. Dawit Bahre Dawit BahreAug 10, 2019 5 Dongguan Mulsanne Leather Company Ltd. is a very good company. Very professional. Sarojini A/p Sellathurai Sarojini A/p SellathuraiAug 02, 2019 5 Great, I'm very satisfied with the quality of this Raw Tanned Leather . My product has been in production for half a month. My products are also very popular with customers, I really appreciate Dongguan Mulsanne Leather Company Ltd. . Billy Parker Billy ParkerJul 15, 2019 5 The Raw Tanned Leather is perfect, with reasonable price and brilliant quality. Eduardo Coopman Moreno Eduardo Coopman MorenoJul 14, 2019 5 The Raw Tanned Leather is very nice. I would like to purchase it and the smart thing next time. Bobby Hohenadel Bobby HohenadelJul 05, 2019 4 Very happy with the Raw Tanned Leather . Great value. Raido Ring Raido RingJul 04, 2019 5 What a wonerful Raw Tanned Leather ! Nice! Yar Khan Yar KhanJun 21, 2019 5 This company can be well to meet our needs on Raw Tanned Leather quantity and delivery time, so we always choose them when we have procurement requirements. Michael Bilog Michael BilogJun 14, 2019 5 The sales person is professional and responsible, warm and polite, we had a pleasant conversation and no language barriers on communication.I highly recommend Dongguan Mulsanne Leather Company Ltd. team. Asvaldur Fridriksson Asvaldur FridrikssonJun 09, 2019 5 After the signing of the contract, we received satisfactory Raw Tanned Leather in a short term, this is a commendable manufacturer. Mrs.jacquelyn Marrufo Mrs.jacquelyn MarrufoJun 05, 2019 5 This supplier's raw material quality is stable and reliable, has always been in accordance with the requirements of our company to provide the Raw Tanned Leather that quality meet our requirements. Assume full duty to satisfy all demands of our clients; reach steady advancements by marketing the development of our purchasers; grow to be the final permanent cooperative partner of clientele and maximize the interests of customers for Raw Tanned Leather , raw tanned leather , fabric and leather , Welcome to put in place long-term connection with us. Best Price For good High-quality in China. We didn't put all products on website. If you can't find the product you're looking for, please contact us for more information. Subject:Content: "Our firm promises all users on the first-class products and solutions along with the most satisfying post-sale assistance. We warmly welcome our regular and new buyers to join us for Raw Tanned Leather , raw tanned leather , fabric and leather , We welcome customers from all over the world come to discuss business. We supply high quality products reasonable prices and good services. We hope to sincerely build business relationships with customers from at home and abroad jointly striving for a resplendent tomorrow.
Mills, John Haymes by John R. Woodard, 1991 9 July 1831–15 Dec. 1898 John Haymes Mills, educator and founder of orphanages, was born in Halifax County, Va., the son of John Garland and Martha Williams Haymes Mills. The Mills family descended from Sir John Mills of England. John H. Mills's great-great-grandfather, John Mills, settled in Hanover County, Va. Mills's father, John Garland, the fifth son of Robert and Mary Mills, was born on 12 Mar. 1804; he was a farmer and a Baptist minister in Hanover County, Va. John H. Mills grew up as a sturdy farmer's boy in a slaveholding family. After his education at a local academy, his father decided that Mills would attend Wake Forest College. Mills made himself a trunk, got aboard a batteau, and went down the Dan and Roanoke rivers to Gaston, where he took the train for Wake Forest. At college the six-foot-two-inch "Jack" participated in debates and was graduated with honors and a B.A. degree in 1854. Three years later he received an M.A. degree from Wake Forest. He taught in an academy in Milton, and when this proved unprofitable, he moved to Melrose Academy near his home in Halifax, Va. In January 1855 Mills began teaching mathematics in Oxford Female Seminary, Oxford, under Dr. Samuel Wait. Wait retired in 1858, and since the institution was in debt, the trustees sold the buildings and grounds to Mills. He was president of Oxford Female Seminary from 1858 to 1866 through the trying Civil War period. In 1866 he sold the property and for one year conducted his school at St. John's College, which had been built in Oxford by the Masons of the state but since then abandoned. In 1867 he purchased the Biblical Recorder in Raleigh. An early biographer said that during his editorship, from 1868 to 1873, Mills's discussion of issues was strong and he often disposed of his adversary in a short paragraph or even in one epigrammatic sentence. The Recorder had few long editorials and certainly not a dull one under his administration. He made a live paper that enjoyed a wide circulation, not only among Baptists but also among people of other faiths. While editor of the Biblical Recorder, Mills traveled throughout North Carolina observing the hardships that had resulted from the Civil War. These privations had fallen mainly on women and children, particularly indigent orphans. As Mills saw the wretched condition of the orphaned children and remembered the orphaned boy who had grown up with his family in Virginia, he felt compelled to help them. When the Grand Lodge of Masons met in Raleigh to decide what to do with the buildings of St. John's College in Oxford, he pleaded with the lodge to establish an orphanage on the site. As a result of his efforts, the lodge set aside two thousand dollars and the legislature in 1873 made a small appropriation, thus making it possible for the facility to open with Mills as its first manager. This was the first orphanage in North Carolina. Mills "struggled for 11 years against poverty, indifference, and sometimes hostility." His health was broken and he resigned. After resting for a short time at his farm near Thomasville, he began to agitate for the formation of a Baptist orphanage. Although the Baptist State Convention opposed his proposal at its annual meeting in 1884, the North Carolina Baptist Orphanage Association was formed that year and Mills began traveling across the state to raise money. On 12 Jan. 1885 he became the general manager of the Baptist Orphanage of North Carolina, established at Thomasville, and on 14 July 1887 he began publishing Charity and Children, the institution's newspaper. Mills introduced the cottage unit system at the orphanage; he also established a school and a church. In 1895 he retired to his farm near Thomasville. In June 1898 Mills gave specific directions regarding his funeral and burial. In December he was taken ill and died a few days after his brother had visited him. Following a Masonic funeral service, Mills was buried in a plain white oak coffin in the Rich Fork cemetery. On 28 Feb. 1856 he married Elizabeth N. Williams, a teacher at the Oxford Female Institute. They had one child, Martha (Mrs. J. D. Newton). Add a comment PLEASE NOTE: NCpedia will not publish personal contact information in comments, questions, or responses. If you would like a reply by email, please note thats some email servers are blocked from accepting messages from outside email servers or domains. These often include student email addresses from public school email accounts. If you prefer not to leave an email address, check back at your NCpedia comment for a reply. Please allow one business day for replies from NCpedia. Complete guidelines are available at http://ncpedia.org/comments.
June 2017. The officially licensed System Backpack – Switch Elite Edition holds and protects the Nintendo Switch console and has additional spacious pockets for the Pro Controller, AC adapter, Switch game cards, a 15 laptop and additional personal items for the gamer on-the-go. Don't leave anything behind with this sturdy, durable backpack and protect your Switch console and accessories. Modern, durable backpack provides complete storage and transportation for your Nintendo Switch console accessories and personal items. Spacious design fits console, Pro Controller, AC adapter, Switch game cards, 15 laptop and other personal accessories. Padded straps and carry handle make it easy to use and transport. Officially licensed by Nintendo.
Q: NetworkStream exceptions and return codes I'm trying to educate myself on the intricacies of reading from a NetworkStream, and understanding the various ways in which problems can occur. I have the following code: public async Task ReceiveAll() { var ns = this.tcp.GetStream(); var readBuffer = new byte[1000]; while (true) { int bytesRead; try { bytesRead = await ns.ReadAsync(readBuffer, 0, readBuffer.Length); if (bytesRead == 0) { // Remote disconnection A? break; } } catch (IOException) { // Remote disconnection B? break; } catch (ObjectDisposedException) { // Local disconnection? break; } /*Do something with readBuffer */ } } I've marked three points in the code where the program says 'something has gone awry, there is no point continuing'. The 'Local disconnection' isn't exactly something wrong, it will happen when I locally close the socket which is the only way to exit the loop under normal circumstances. I don't think anything else can cause this, so I think I'm safe to just swallow the exception. The two 'Remote disconnection' points are what I'm not sure about. I know ReadAsync will return 0 if the connection is terminated remotely (A), but the IOException also seems to fire in some circumstances. If my remote client is a C# console, then closing the socket seems to make 'A' happen, and closing the console window seems to be make 'B' happen. I'm not sure I understand what the difference is between these scenarios? Finally, a bit of a general question, but is there anything glaringly wrong with this bit of code or my above assumptions? Thanks. EDIT: In response to my use of ObjectDisposedException to abort out of the loop: This is what my 'Stop' method looks like (from the same class as above): public void Stop() { this.tcp.Close(); } This causes the pending 'ReadAsync' to except with ObjectDisposedException. AFAIK there isn't any other way to abort this. Changing this to: public void Stop() { this.tcp.Client.Shutdown(SocketShutdown.Both); } Doesn't appear to actually do anything to the pending call, it just continues waiting. A: When NetworkStream returns 0, this means that the socket has received a disconnect packet from the remote party. This is how network connections are supposed to end. The correct way to shut down the connection (especially if you are in a full-duplex conversation) is to call socket.Shutdown(SocketShutdown.Send) and give the remote party some time to close their send channel. This ensures that you receive any pending data instead of slamming the connection shut. ObjectDisposedException should never be part of the normal application flow. Any exceptions thrown indicate that something went wrong, and I think it's safe to say you can no longer rely on the current connection. TL;DR I don't see anything wrong with your code, but (especially in full-duplex communication) I'd shut down the send channel and wait for a 0-byte packet to prevent receiving ObjectDisposedExceptions by default: use tcp.Shutdown(SocketShutdown.Send) to tell the remote party you want to disconnect your loop may still receive data that the remote party was sending your loop will, if everything went right, then receive a 0-byte packet, indicating that the remote party is disconnecting loop terminates the right way you may want to decide to dispose the socket after a certain amount of time, if you haven't received the 0-byte packet
New semicarbazones as gorge-spanning ligands of acetylcholinesterase and potential new drugs against Alzheimer's disease: Synthesis, molecular modeling, NMR, and biological evaluation. Two new compounds (E)-2-(5,7-dibromo-3,3-dimethyl-3,4-dihydroacridin-1(2H)-ylidene)hydrazinecarbothiomide (3) and (E)-2-(5,7-dibromo-3,3-dimethyl-3,4-dhihydroacridin-1(2H)-ylidene)hydrazinecarboxamide (4) were synthesized and evaluated for their anticholinesterase activities. In vitro tests performed by NMR and Ellman's tests, pointed to a mixed kinetic mechanism for the inhibition of acetylcholinesterase (AChE). This result was corroborated through further docking and molecular dynamics studies, suggesting that the new compounds can work as gorge-spanning ligands by interacting with two different binding sites inside AChE. Also, in silico toxicity evaluation suggested that these new compounds can be less toxic than tacrine.
Pipettes and automatic aspirators are constructed preferably with disposable tips or containers, means for mounting the tips or containers, and means for pressurizing or evacuating the contents of the tips or containers. The pressurizing means then comprise a piston chamber, a piston, and means for reciprocating the piston. Most commonly, the piston uses sealing rings that rub against the inside wall of the piston chamber or outside wall of the piston. Because such rings are subject to wear, bellows have been suggested as an alternative since they have a much longer wear capability. Such bellows can be prestressed and simply compressed manually, as shown in U.S. Pat. No. 4,296,071, or they can be driven by a motor as shown in U.S. Pat. No. 4,041,995, FIGS. 6 and 8. In either case, some manufacturing difficulties are encountered. In the case of a simple bellows that is of the type shown in the '995 patent, it is difficult to attach the base portion of the bellows to the bottom of the piston chamber, simply because of inaccessibility. A solution would be to assemble the chamber housing in several parts, but it is preferred, e.g., for convenience, to have such a housing be one integral part. One approach to this problem has been to use a flat elastomoeric membrane in place of a bellows, for example, as shown in U.S. Pat. No. 4,444,062, since such a membrane can be secured to the top of the piston chamber. As the piston is advanced, FIG. 4 of the '062 patent, the membrane (68) is stretched into a cylindrical shape. However, such a design encounters the following disadvantages: the elastomeric membrane tends to crack under the high stress that is delivered, and is therefore short-lived. Furthermore, it provides a non-linear displacement since the cross-sectional shape changes as the piston is advanced. A bellows does not suffer these disadvantages. Thus, such a flat membrane is not a suitable substitute for a bellows. Therefore, prior to this invention there has been a need to provide a more readily manufacturable bellows design as a piston ring replacement. Yet another problem exists with such bellows construction. Many pipettes have a disposable tip ejector comprising a rod extending from the tip mounting surface, back into the end of the piston chamber nearest to the disposable tip. Such rods need to be pushed at the appropriate moment, such as by extending the piston until it contacts the rod. However, when a bellows is disposed in between the piston and the end of the chamber at which the rod is located, excessive power is required to activate the rod. That is, not only must the piston push against the resistance of the rod and tip, but also it must collapse the bellows. For the above reasons, bellows have had limited utility in use as replacement of piston seals, in spite of their advantage in wearing.
Q: Find Most Common Value and Corresponding Count Using Spark Groupby Aggregates I am trying to use Spark (Scala) dataframes to do groupby aggregates for mode and the corresponding count. For example, Suppose we have the following dataframe: Category Color Number Letter 1 Red 4 A 1 Yellow Null B 3 Green 8 C 2 Blue Null A 1 Green 9 A 3 Green 8 B 3 Yellow Null C 2 Blue 9 B 3 Blue 8 B 1 Blue Null Null 1 Red 7 C 2 Green Null C 1 Yellow 7 Null 3 Red Null B Now we want to group by Category, then Color, and then find the size of the grouping, count of number non-nulls, the total size of number, the mean of number, the mode of number, and the corresponding mode count. For letter I'd like the count of non-nulls and the corresponding mode and mode count (no mean since this is a string). So the output would ideally be: Category Color CountNumber(Non-Nulls) Size MeanNumber ModeNumber ModeCountNumber CountLetter(Non-Nulls) ModeLetter ModeCountLetter 1 Red 2 2 5.5 4 (or 7) 1 Yellow 1 2 7 7 1 Green 1 1 9 9 1 Blue 1 1 - - 2 Blue 1 2 9 9 etc 2 Green - 1 - - 3 Green 2 2 8 8 3 Yellow - 1 - - 3 Blue 1 1 8 8 3 Red - 1 - - This is easy to do for the count and mean but more tricky for everything else. Any advice would be appreciated. Thanks. A: As far as I know - there's no simple way to compute mode - you have to count the occurrences of each value and then join the result with the maximum (per key) of that result. The rest of the computations are rather straight-forward: // count occurrences of each number in its category and color val numberCounts = df.groupBy("Category", "Color", "Number").count().cache() // compute modes for Number - joining counts with the maximum count per category and color: val modeNumbers = numberCounts.as("base").join(numberCounts.groupBy("Category", "Color").agg(max("count") as "_max").as("max"), $"base.Category" === $"max.Category" and $"base.Color" === $"max.Color" and $"base.count" === $"max._max") .select($"base.Category", $"base.Color", $"base.Number", $"_max") .groupBy("Category", "Color") .agg(first($"Number", ignoreNulls = true) as "ModeNumber", first("_max") as "ModeCountNumber") .where($"ModeNumber".isNotNull) // now compute Size, Count and Mean (simple) and join to add Mode: val result = df.groupBy("Category", "Color").agg( count("Color") as "Size", // counting a key column -> includes nulls count("Number") as "CountNumber", // does not include nulls mean("Number") as "MeanNumber" ).join(modeNumbers, Seq("Category", "Color"), "left") result.show() // +--------+------+----+-----------+----------+----------+---------------+ // |Category| Color|Size|CountNumber|MeanNumber|ModeNumber|ModeCountNumber| // +--------+------+----+-----------+----------+----------+---------------+ // | 3|Yellow| 1| 0| null| null| null| // | 1| Green| 1| 1| 9.0| 9| 1| // | 1| Red| 2| 2| 5.5| 7| 1| // | 2| Green| 1| 0| null| null| null| // | 3| Blue| 1| 1| 8.0| 8| 1| // | 1|Yellow| 2| 1| 7.0| 7| 1| // | 2| Blue| 2| 1| 9.0| 9| 1| // | 3| Green| 2| 2| 8.0| 8| 2| // | 1| Blue| 1| 0| null| null| null| // | 3| Red| 1| 0| null| null| null| // +--------+------+----+-----------+----------+----------+---------------+ As you can imagine - this might be slow, as it has 4 groupBys and two joins - all requiring shuffles... As for the Letter column statistics - I'm afraid you'll have to repeat this for that column separately and add another join.
ENCEPHALITIS CONFIRMED Two chickens thought to be infected with mosquito-borne St. Louis encephalitis virus have been confirmed, a state Department of Health and Rehabilitative Services spokeswoman said on Friday. "We are continuing to monitor the situation, and we urge people to take precautions against getting bitten, especially at night," spokeswoman Beth Owen said. Nighttime is when the Culex nigripalpus mosquito, which carries the virus, is active. The two infected birds, called sentinel chickens, are in flocks kept in western Boca Raton and western Lake Worth, Owen said. She said there have been no recent reports of humans contracting the virus in South Florida. Health officials suggest that people wear long sleeves and full-length pants at night and consider using insect repellent.
The present invention relates to spinal implant devices and associated techniques for promoting fusion of two or more vertebrae. It is known that when an intervertebral disc degenerates or is damaged, there is often a compression of the disc and a reduction in the normal intervertebral height. Typically, this condition results in abnormal motions that become a source of pain. In order to treat a pathology of this type, the disc is often stabilized to eliminate the abnormal motions caused by disc disorders or injuries. Generally, one approach is to prevent articulation between the two vertebrae situated on each side of the damaged disc by bone fusion. This fusion fixes the vertebrae to each other, eliminating the relative mobility causing the pain. Various spinal implants to promote fusion between adjacent vertebrae have been proposed. It has been proposed to interconnect the two vertebrae by a kind of rigid U-shaped stirrup which restores the discal height with a bone graft material disposed inside the stirrup. However, one drawback of this proposal is its diminishing effectiveness over a period of time. An spinal cage is also known which consists of a cylindrical member provided with a series of openings and provided with anchoring points. This implant is placed in a recess formed in the intervertebral disc and penetrates the opposite cortical plates of the two vertebrae which were previously hollowed out to receive the implant. This penetration forms openings in the sub-chondral plates to place spongy bone of the vertebrae in contact with bone graft material placed inside the implant, facilitating bone fusion. U.S. Pat. No. 5,015,247 provides one example of this approach. FR 2,736,538 discloses an intersomatic cage formed by a body having inclined upper and lower surfaces and parallel lateral walls, provided at their end portions with anti-backward movement teeth. In such a structure the central and end surfaces are in the same plane so that the major part of the bearing surface is provided by the central part, that is in contact with the spongy bone, of which the strength is lower than the strength of cortical plates. Hence such structure is not entirely satisfying. Proper performance of a spinal implant of this type requires balancing the need to promote fusion between the spongy bone and the need to form a reliable load bearing relationship with the stronger cortical bone. As a result, the spinal cage must be neither engaged too far into the openings provided in the cortical plates to provide a sufficiently dense load bearing surface, nor insufficiently inserted, in which case the bone fusion between the two vertebrae would be adversely affected by a poor anchorage. Thus, there is a demand for devices and techniques that facilitate attaining the proper balance between fusion and load support. The present invention meets this demand and provides other significant benefits and advantages. The present invention relates to spinal fusion implants and techniques. Various aspects of the present invention are novel, nonobvious, and provide various advantages. While the actual nature of the invention covered herein can only be determined with reference to the claims appended hereto, certain forms which are characteristic of the preferred embodiments disclosed herein are described briefly as follows. According to one form of the invention, the spinal implant comprises a body having a central part arranged to allow arthrodesis and at least one terminal part for bearing against the cortical bone of the vertebral end plates. The central part is adapted to penetrate the vertebral end plates, transversely projecting from the terminal bearing part. Thus the invention achieves a separation between the end parts constituting the load bearers, and the intermediate part of the implant which permits fusion. In addition, the central part may include at least one cavity for receiving a bone graft material. In another form of the present invention, an implant for insertion between a first vertebra having a first cortical bone plate and a second vertebra having a second cortical bone plate includes two terminal parts. The first terminal part defines a first bearing surface to bear against the first cortical bone plate and a second bearing surface opposite the first surface to bear against the second cortical bone plate. The second terminal part opposes the first terminal part and defines a third bearing surface to bear against the first cortical bone plate and a fourth bearing surface opposite the third surface to bear against the second cortical bone plate. The implant has an elongated central part defining an upper projection extending past the first and third surfaces, and a lower projection extending past the second and fourth surfaces. These projections correspondingly pass through openings in the first and second cortical bone plates when the first and third surfaces bear against the first cortical bone plate and the second and fourth surfaces bear against the second cortical bone plate. The terminal parts are dimensioned to facilitate restoration of the natural geometry of the intervertebral space (lordosis, cyphosis, and parallel discs). Thus, the first and second surfaces may be separated by a first distance, and the third and fourth surface may be separated by a second distance greater than the first distance to accommodate a natural curvature of the spine. In a further form of the present invention, an implant with two terminal parts also has an elongated central part that includes a pair of longitudinal walls defining a cavity. The walls define a first edge projecting past the first and third surfaces and a second edge projecting past the second and fourth surfaces. The first and second edges correspondingly penetrate the first and second cortical bone plates when the first and third surfaces bear against the first cortical bone plate and the second and fourth surfaces bear against the second cortical bone plate. According to another form, the bearing surfaces of the terminal end parts are defined by flanges extending from opposing ends of the implant along its longitudinal axis. Preferably, the bearing surfaces are generally flat for bearing against the cortical bone of the vertebral end plates of the two adjacent vertebrae. It is also preferred that openings be cut into the cortical plates in their central regions corresponding to the length of a central part of the implant along the longitudinal axis and leaving a region of the cortical bone plates around the periphery of the openings. The length of the remaining peripheral plate corresponds to the length of the bearing surfaces along the longitudinal axis. When the implant is placed in position, the edges of the walls of the central part engage the openings cut in the cortical plates and consequently do not substantially bear against the remaining peripheral portion of the plates. A cavity may be defined by the central part that holds bone graft material in contact with the spongy bone of the two vertebrae. In contrast, the bearing surfaces of the flanges are disposed adjacent the edges of the openings of the cortical plates and bear against the remaining portions of the plates to establish a strong load bearing relationship. Thus, both bone fusion and support are distinctly accommodated by different parts of the implant structure, which permits obtaining a satisfactory support of the vertebral bodies on the implant and an excellent arthrodesis. Yet another form of the present invention includes a cutting tool accessory to prepare the cortical plates of two adjacent vertebrae for insertion of an implant. This tool comprises a proximal handle connected to an elongate shaft configured to rotate about a longitudinal axis of the tool. The tool also includes a first non-cutting portion with the shaft extending therethrough and being configured to rotate relative thereto. A cutting portion is fixed to the shaft to rotate therewith and is positioned distal to the first non-cutting portion. The cutting portion includes a first pair of generally parallel opposing faces and a second pair of opposing faces each extending between the first pair of faces. The second pair of faces each define a number of cutting teeth. A second non-cutting portion is fixed to the cutting portion that includes a distal head. The first non-cutting portion, the cutting portion, and the second non-cutting portion have a rotatably selectable alignment that presents a generally constant height corresponding to the intersomatic space defined between the cortical bone plates to facilitate insertion therein. Once inserted, the cutting portion may be rotated out of this alignment to cut a first opening in the first cortical bone plate and a second opening into the second cortical bone plate. The cutting portion and to non-cutting portions may be arranged to provide uniform, symmetrical cutting of these openings with a predetermined length corresponding to the dimensions of a given implant device. In an additional form, a technique of spinal fixation includes cutting adjacent vertebrae and inserting an implant therebetween to promote fusion and provide suitable support. The implant may be inserted by anterior or posterior surgical approaches. The cutting may be performed by the cutting tool of the present invention and may include initially inserting the tool so that a first pair of faces are in contact with a respective one of the first and second cortical bone plates, turning a handle to rotate the cutting portion to remove cortical bone with cutting teeth defined by a second pair of faces, and withdrawing the tool. The tool may be used to form openings readily positioned in the central region of the adjacent vertebrae that leaves cortical bone plate about the openings. The insertion of the implant may include positioning the implant of the present invention between the first and second vertebrae and turning the implant about one quarter of a turn. It is envisioned that the implants of the present invention may be used with other tools and procedures, that the tools of the present invention may be used with other implants and procedures, and that the procedures of the present invention may be used with other implants and tools as would occur to those skilled in the art without departing from the spirit of the present invention. Accordingly, one object of the invention is to provide a spinal implant arranged to facilitate proper fusion of two or more vertebrae. The implant may be arranged to have at least one structural part to promote bone fusion through contact with spongy vertebral bone and one or more other structural parts adapted for contact with cortical bone to provide load support. Another object is to provide a tool accessory to facilitate implantation of devices suitable to promote fusion. Still another object is to provide a technique for preparing a site between two vertebrae to be fused and inserting an implant. Other objects, features, benefits, forms, aspects, and advantages of the present invention will become apparent from the description and drawings herein.
Changes occurring in mucosal contractility of the inferior turbinate and mucociliary clearance following total laryngectomy: A prospective clinical trial. In this study, changes occurring in the contractility capacity of the inferior turbinate and mucociliary clearance time due to the interruption of nasal air flow were examined. A total of 23 patients undergone total laryngectomy between June 2010 and June 2012 were included in the study. Acoustic rhinometry test was performed in the patients before and after 0.05% oxymetazoline nasal topical decongestant administration. In addition, saccharin test was applied in order to measure mucociliary clearance. The same measurements were repeated at the postoperative months 1, 6 and 12 and the data obtained were statistically compared. In evaluation of the patients' contractility capacity at MCA-1 and MCA-2, contractility capacity was found to be significantly decreased from the postoperative first month compared to the preoperative values. The contractility capacity at the postoperative 6th month was significantly lower than that of the postoperative first month. The contractility capacity at the postoperative 12th month was significantly lower than that of the postoperative 6th month. Mucociliary clearance time did not change significantly at the postoperative first month compared to the preoperative value, while this value was significantly decreased at the postoperative 6th month. No statistically significant difference was observed in mucociliary clearance between the postoperative 6th and 12th months. Contractility capacity of the inferior turbinate decrease over time in patients undergoing total laryngectomy. This indicates that the dysfunction developing in the nasal mucosal structure in the chronical absence of nasal air flow may be resulted from the decreased choncal contractility.
Q: Convert String to DateTime with pattern "MM/dd/yyyy hh:mm:ss" I have a string variable containing "02/27/2014 23:00:28" When I use this following code to convert it to Datetime type, the conversion fails (test returns false and parsedDate contains "01/01/0001 00:00:00") code: string date = "02/27/2014 23:00:28" string pattern = "MM/dd/yyyy hh:mm:ss"; DateTime parsedDate; bool parsedSuccessfully = DateTime.TryParseExact(date, pattern, null, DateTimeStyles.None, out parsedDate); Thank you! A: You need to use uppercase HH for the hours since you are using 24h format. MM/dd/yyyy HH:mm:ss You also need to use CultureInfo.InvariantCulture instead of null to ensure that / will be used as date separator. Otherwise it is replaced by your cultures actual date separator. * bool test = DateTime.TryParseExact(date, "MM/dd/yyyy HH:mm:ss", CultureInfo.InvariantCulture, DateTimeStyles.None, out parsedDate); The "/" Custom Format Specifier * A: hh specifier is for 01 to 12. Use HH specifier which is for 00 to 23. (24-hour clock based) And I think you should use date instead of test in your DateTime.TryParseExact method. string date = "02/27/2014 23:00:28"; string pattern = "MM/dd/yyyy HH:mm:ss"; DateTime parsedDate; bool test= DateTime.TryParseExact(date, pattern, CultureInfo.InvariantCulture, DateTimeStyles.None, out parsedDate); Console.WriteLine(test); // True Since you using null in your IFormatProvider parameter, it uses CurrentCulture. From documentation; If provider is null, the CultureInfo object that corresponds to the current culture is used. But / format specifier has a special meaning of "replace me with the current culture date seperator" in your string format. That means, if your current culture's date separator is not /, your parsing operation will be fail. That's why you should use InvariantCulture in such a case. Here an another answer: TryParseExact returns false, though I don't know why
934 F.2d 290 CHRYSLER CAPITAL CORPORATION, Plaintiff-Appellant, Cross Appellee,v.Larry C. LAVENDER, James H. White, III,Defendants-Appellees, Cross Appellants. No. 90-7177. United States Court of Appeals,Eleventh Circuit. June 24, 1991. Paul A. Liles, Richard F. Ogle, David O. Upshaw, Schoel, Ogle, Benton, Gentle & Centeno, Birmingham, Ala., for plaintiff-appellant, cross-appellee. Clarence M. Small, Jr., Richard E. Smith, Rives & Peterson, Birmingham, Ala., for defendants-appellees, cross-appellants. Appeals from the United States District Court for the Northern District of Alabama. Before JOHNSON and BIRCH, Circuit Judges, and MERHIGE*, Senior District Judge. BIRCH, Circuit Judge: 1 This diversity case involves the issue of whether a lessor's refusal to consent to a proposed sublease by its lessee was unreasonable under Alabama law. The lessor, Chrysler Capital Corporation ("Chrysler"), sought damages against Larry C. Lavender and James H. White, III for breach of a Guaranty Agreement ("Guaranty") in connection with the lease of a hydraulic bumper press (the "Press"). Lavender and White responded that the default was caused by Chrysler's unreasonable refusal to consent to a proposed sublease of the Press to Southern Stampings, Inc. ("SSI"), and also alleged that Chrysler intentionally interfered in their contractual or business relationship with SSI. After a jury trial in the United States District Court for the Northern District of Alabama, the jury excused Lavender and White from further responsibility under the lease agreement. The jury verdict also held Chrysler responsible for intentional interference with contractual or business relations, but the trial judge subsequently set aside the jury's finding of intentional interference. Both parties have appealed to this court. For the reasons that follow, we AFFIRM. I. BACKGROUND 2 Lavender and White are the principal owners of American Bumper Company ("ABC"), which sold recycled automobile bumpers and tractor-trailer bumpers. The business required bumper stamping and plating equipment. In late 1985, ABC sought to purchase the Press for $170,000 and was referred to Chrysler for financing.1 In November, 1985, the parties agreed to terms for a five-year lease, and ABC retained an option to purchase the Press for its fair market value at the end of the lease term. ABC agreed to pay Chrysler approximately $3,400 per month, and also agreed not to sublease the Press or assign its rights under the lease without prior approval from Chrysler. At that time, Lavender and White executed the Guaranty to secure ABC's debt to Chrysler. 3 By mid-1986, ABC was experiencing financial difficulty. Bob Groh, the president of SSI, contacted Lavender in August, 1986 and offered to purchase all of ABC's bumper stamping assets, including the Press. Groh suggested that SSI could sell stamped bumpers to ABC for plating, which would allow ABC to remain in business after the sale. Lavender was interested in this proposal and contacted Chrysler to determine the remaining balance on the lease. He was advised that ABC owed $141,000 at that time. 4 Lavender and Groh negotiated a tentative agreement whereby SSI would purchase certain equipment from ABC and assume the lease obligations on the Press. The documents were signed on December 31, 1986, but the transaction was closed in escrow because ABC had not obtained Chrysler's written permission to assign its obligations under the lease, and certain liens on other equipment had not yet been released. In January, 1987, Lavender contacted Chrysler and was told that the buyout value of the lease was $248,000, because Chrysler wanted to recoup prospective investment tax credits, sales tax, and the fair market value of the Press in addition to the total of the remaining lease payments. ABC and SSI were unwilling to satisfy the lease on those terms. 5 Groh next offered to sublease the Press for $2400 per month, with an option to purchase at the end of the lease term if the price was acceptable. Under this arrangement, ABC would pay Chrysler $1,000 per month on the lease, but ABC would be reimbursed by SSI if SSI exercised its option to purchase the Press. The Guaranty would remain in effect, and ABC would remain liable on the lease. Chrysler tentatively agreed to approve the revised transaction if ABC and SSI provided proof of insurance, an address where the Press would be located, and a landlord's consent and waiver to permit Chrysler to enter the property and repossess the Press upon default by ABC. ABC and SSI thought they could satisfy these conditions, and prepared a revised sublease agreement that included an escape clause for SSI if Chrysler did not consent to the sublease by April 15, 1987. 6 On April 8, 1987, Chrysler informed Lavender that it would not approve the sublease unless SSI agreed to assume all of ABC's obligations under the original lease. This new condition had not been discussed previously and was unacceptable to SSI. Without Lavender's knowledge or consent, Groh telephoned Chrysler regarding this matter and allegedly was told that ABC was delinquent on its lease payments and that the Press would be available for $85,000 if ABC defaulted on the lease. Groh cancelled the sublease with ABC on May 21, 1987. Lavender unsuccessfully tried to resurrect the sublease during conversations with Groh and Chrysler through August, 1987. 7 On November 10, 1988, Chrysler filed its complaint in this action against Lavender and White for breach of the Guaranty. Chrysler sought $133,963.40, plus costs and attorneys' fees, as damages for ABC's default on the lease and Lavender and White's refusal to honor the terms of the Guaranty. Lavender and White answered the complaint and added two counterclaims, alleging that Chrysler's refusal to consent to the sublease was unreasonable under Alabama law and that Chrysler intentionally interfered in ABC's relationship with SSI. Lavender and White sought damages of $250,000 for Chrysler's refusal to consent to the sublease, $500,000 for intentional interference with contractual or business relations, plus a declaration that the lease agreement and the Guaranty were void as a result of Chrysler's conduct. 8 The jury found for Lavender and White and excused ABC from further performance under the lease agreement. The jury also determined that Chrysler was liable for intentional interference and awarded Lavender and White damages of $225,068.80. Chrysler moved for judgment notwithstanding the verdict ("JNOV") or a new trial. The district judge denied the motion, but set aside the jury's finding on the intentional interference claim. Lavender and White appeal that decision, and Chrysler appeals the denial of its post-trial motion. II. DISCUSSION A. Chrysler's Appeal 9 We apply different standards to review the district court's decision to deny Chrysler's alternative motions for JNOV or new trial. A motion for new trial is reviewed under the abuse of discretion standard. Sentry Indemnity Co. v. Peoples, 856 F.2d 1479, 1481 (11th Cir.1988). However, on a motion for JNOV, we must independently determine whether the facts and inferences point so overwhelmingly in favor of the movant, Chrysler, that reasonable people could not arrive at a contrary verdict. See Carter v. City of Miami, 870 F.2d 578, 581 (11th Cir.1989). 10 Under Alabama law, "a landlord may not unreasonably and capriciously withhold his consent to a sublease agreement. The landlord's rejection should be judged under a test applying a reasonable commercial standard." Homa-Goff Interiors, Inc. v. Cowden, 350 So.2d 1035, 1038 (Ala.1977). The issue of commercial reasonableness is a jury question. Id.; see also Leasing Service Corp. v. River City Constr. Co., 743 F.2d 871, 878 (11th Cir.1984). In this case, the jury found that ABC was excused from further performance under the lease because Chrysler's refusal to consent to the proposed sublease was unreasonable. 11 At trial, Lavender testified that he contacted Ron M. Sperier, a District Operations Manager for Chrysler, in January, 1987 regarding the proposed sublease. He was told that the sublease could be approved if ABC requested approval in writing and provided: (1) a landlord's consent and waiver, (2) proof of insurance on the Press, and (3) an address where the Press would be located if the sublease was approved. R2-83. Bob Groh at SSI signed and executed the landlord's consent and waiver and returned the document to Chrysler. R1-10-Affidavit of Ron M. Sperier at 3. Lavender testified that he provided Sperier with the new location of the Press, and Groh testified that SSI was willing and able to provide proof of insurance. R2-87; R3-188. 12 Lavender introduced evidence that his attempt to sublet the Press was unsuccessful because Chrysler later added a fourth condition for final approval of the agreement. That condition was included in an Addendum to the Second Sublease prepared by Chrysler, and would have required SSI to become liable for all of ABC's obligations under the lease. Defendants' Exhibit 42 at 3. SSI refused to sign the Addendum, and the sublease was never approved. Lavender and White argued that the fourth condition was unreasonable because it would have placed Chrysler in a better position under the sublease to SSI than it occupied under the lease to ABC. Without the fourth condition, ABC and the guarantors, Lavender and White, would have remained fully obligated on the lease. Therefore, Chrysler would have had the same security under the sublease that it accepted upon approval of the original lease to ABC. 13 The jury could reasonably conclude that Chrysler added the fourth condition because ABC's uncertain financial condition led Chrysler to seek additional security from SSI. However, a refusal to consent may be considered arbitrary and unreasonable if the landlord conditions his consent upon approval of a new agreement that changes the terms of the original lease. See, e.g., B.M.B. Corp. v. McMahan's Valley Stores, 869 F.2d 865, 869 (5th Cir.1989). The evidence supports the jury's finding that Chrysler's refusal to consent to the sublease was commercially unreasonable. Chrysler's arguments on the reasonableness of its failure to consent are not implausible, but they are not strong enough to preclude reasonable jurors from reaching a contrary conclusion. Accordingly, Chrysler's motion for JNOV was properly denied. Moreover, the district court did not abuse its discretion by denying Chrysler's alternative motion for a new trial under these circumstances. B. Lavender and White's Appeal 14 The jury awarded Lavender and White $225,068.80 in damages on their counterclaim for intentional interference with contractual or business relations. The district judge set aside the factual finding of intentional interference, and Lavender and White appeal that decision. We apply the same standard of review on this issue that we used to consider Chrysler's motion for JNOV, which is whether the facts and inferences point so strongly in favor of Chrysler that no reasonable jury could reach a contrary verdict. See Carter v. City of Miami, 870 F.2d at 581. 15 The Supreme Court of Alabama requires proof of five elements to maintain a claim for intentional interference with contractual or business relations. The elements are: (1) the existence of a contract or business relation; (2) defendant's knowledge of the existence of that relationship; (3) intentional interference in the relationship by the defendant; (4) an absence of justification for the interference; and (5) damage to the plaintiff as the result of defendant's interference. Gross v. Lowder Realty Better Homes and Gardens, 494 So.2d 590, 597 (Ala.1986). 16 Lavender and White contend that Chrysler intentionally interfered in ABC's relationship with SSI when it told Groh that ABC was in danger of defaulting on the lease agreement. Lavender and White argued at trial that Chrysler abused its position as a creditor of ABC by improperly providing credit information to SSI without ABC's knowledge or approval. 17 It is undisputed that ABC and SSI had a business relationship and that Chrysler knew the relationship existed. A jury could also reasonably conclude that Chrysler interfered in the relationship. However, there is no evidence in the record that any interference was intentional and unjustified. Chrysler acted to protect its interest in the lease agreement, and Lavender and White did not offer any evidence showing that Chrysler deliberately attempted to interfere in ABC's relationship with SSI. 18 Lavender and White also alleged that they were damaged by the interference in the amount of Chrysler's claimed damages under the lease. Brief of Appellees/Cross Appellants Larry C. Lavender and James H. White, III at 27. They offered no proof of damages at trial, however, and any damages resulting from the lease evaporated when the jury excused ABC from further performance on the agreement. Without proof of damages, the claim of intentional interference cannot stand. See Gross, 494 So.2d at 597. Accordingly, we AFFIRM the district court's decision to set aside the jury's finding of intentional interference. 19 AFFIRMED. * Honorable Robert R. Merhige, Jr., Senior U.S. District Judge for the Eastern District of Virginia, sitting by designation 1 Chrysler is the successor in interest to Chrysler Financial Corporation and E.F. Hutton Credit Corporation. In this opinion, references to "Chrysler" will be deemed to include its predecessors in interest
1. Field of Invention The present invention relates to a liquid crystal display and an electronic device. More specifically, the invention relates to a technique of obtaining a high-contrast display having a wide viewing angle in a transflective liquid crystal display that performs display in both a reflective mode and a transparent mode. 2. Description of Related Art Since reflective liquid crystal displays have no light sources, such as a backlight, they consume low power, and thus can be used for various portable electronic devices. However, the reflective liquid crystal displays perform display using outside light, such as sunlight and illumination light. Thus, these displays are subject to low visibility in a dark place. Therefore, the related art includes liquid crystal displays capable of making display visible using outside light in a light place, as in general reflective liquid crystal displays, and using an inside light source, such as a backlight, in a dark place. In other words, such liquid crystal displays employ a reflective and transparent display system, thereby allowing clear display even in low light while reducing power consumption by switching the display system between the reflective mode and the transparent mode depending on the surrounding brightness. Hereinafter, in this specification, liquid crystal displays of this type are referred to as “transflective liquid crystal displays.” Such related art transflective liquid crystal displays include a liquid crystal display having a structure in which a liquid crystal layer is sandwiched between an upper substrate and a lower substrate. A reflective film having a light-transmitting window in a metallic film made of aluminum or the like is provided on the inner surface of the lower substrate, and this reflective film functions as a transflective film. In this case, in a reflective mode, outside light that has entered from the upper substrate passes through the liquid crystal layer, is then reflected by the reflective film, again passes through the liquid crystal layer, and outgoes from the upper substrate, thus contributing to display. On the other hand, in a transparent mode, light from the backlight, which has entered from the lower substrate, passes through the liquid crystal layer from the window of the reflective film, and then emerges from the upper substrate to the exterior, thereby contributing to display. Accordingly, in the reflective-film formed area, the area which has the window serves as a transparent display area and the other area serves as a reflective display area. Liquid crystal alignment modes include a twisted nematic (hereinafter “TN”) mode in which liquid crystal molecules exhibit a twisted alignment substantially parallel to the substrate surface and vertical to the substrate; and a vertical alignment mode in which liquid crystal molecules exhibit vertical alignment, under a no voltage applied state. Although, in the related art, the TN mode can be viewed as reliable, the related art also includes liquid crystal displays that in the vertical alignment mode can provide some excellent characteristics. For example, in the vertical alignment mode, since the state in which the liquid crystal molecules are aligned vertically to the substrate surface (there is no optical retardation as viewed from the normal) is used as black display, the black display is superior in quality, thus providing high contrast. In vertical-alignment LCDs which are superior in front contrast, the range of viewing angle in which a fixed contrast can be obtained is wider than that of the horizontal-alignment-mode TN liquid crystal. Furthermore, employing an alignment dividing (multidomain) technique of dividing the alignment orientation of a liquid crystal in pixels provides a remarkably wide viewing angle. In the transflective liquid crystal display with the aforesaid structure, the retardation of the liquid crystal in the reflective display area is expressed by: 2×Δn·d, because the incident light passes through the liquid crystal layer two times and then reaches the observer, where the thickness of the liquid crystal layer is d, the refractive index anisotropy of the liquid crystal is: Δn, and the retardation of the liquid crystal which is expressed as their integrated value is: Δn·d. On the other hand, the retardation of the liquid crystal in the transparent display area is expressed by: 1×Δn·d, because the light from the backlight passes through the liquid crystal layer only once. As described above, when the alignment of the liquid crystal molecules of the liquid crystal layer is controlled, even with the structure having different retardation values in the reflective display area and in the transparent display area, an electric field has been applied to the liquid crystal at the same driving voltage in both display modes. In such a case, when the liquid crystal with different display modes, in other words, the liquid crystal with different retardations between the transparent display area and the reflective display area is aligned at the same driving voltage, it poses a problem of obtaining no high-contrast display. In order to address or solve the problem, a liquid crystal display is disclosed in Japanese Unexamined Patent Application Publication No. 11-242226 that has a structure having different thicknesses of the liquid crystal layer in the transparent display area and in the reflective display area.
After Motorola, How to Play Carl Icahn's Next Move in Chesapeake Energy? Carl Icahn has a pretty simple formula for investing: Find a company with unappreciated assets and a sleepy management team, rattle a few cages, and wait for shares to finally appreciate. That's what he did with Motorola (MOT) and many other companies over the years. [Read my take on that here.] He doesn't always succeed, but several big hits have pushed him into the billionaire's club (he's actually worth an estimated $8.9 billion, according to Forbes). He's at it again. Icahn has been buying up shares of natural gas firm Chesapeake Energy (NYSE:CHK), and is gearing up some fresh cage rattling. Icahn just announced in a 13-D filing that his firm now owns 5.8% of the company and "intends to seek to continue to have conversations with the company's management to discuss the business & operations of the company and the maximization of shareholder value." There's one small problem: Chesapeake's CEO Aubrey McClendon is stubborn as a mule, and not likely to warm to Icahn's overtures. As I noted this summer, McClendon thinks he's smarter than his peers and can identify cheap assets better than anyone else. But I also concluded that he "thinks that other industry players lack Chesapeake's savvy, when they really lack Chesapeake's moxie." So Icahn is going to have a hard time explaining to McClendon that he isn't so sharp. Why Chesapeake? Analysts are generally scratching their heads on this one. Most think shares are fairly valued, trading at similar values on a price-to-cash flow basis as most other natural gas plays. Shares trade for around $25 (thanks to an 8% spike on Monday), and even the most optimistic analysts think shares are worth no more than $30, when measured in terms of cash flow. But that's not the whole story. Chesapeake may look just OK in terms of cash flow, but many agree that the value of its massive real estate holdings are worth well more, perhaps more than $40 a share on a net asset value (NAV) basis. Yet there's a reason shares sell for 38% less than the NAV. "CHK has terrific (natural gas) shale assets but has been criticized for too aggressively acquiring undeveloped acreage ... and a perception of poor financial discipline has caused CHK to trade at a steep discount to NAV" wrote analysts at UBS on Monday morning. What's Icahn's next move? It's extremely unlikely that Icahn can simply bully his way through the door and force management to break up the company (as he did with Motorola). Instead, he's likely to suggest ways that the company's financial picture can improve, perhaps by selling off assets that are unlikely to be big cash flowgenerators in the near-term. He might also implore the company to throttle back capital spending plans to boost free cash flow in the near-term. A jump in cash flow would likely lead analysts to upwardly revise their price targets above the $30 mark. Then again, Icahn doesn't get involved in a situation that mayyield 20% upside. He's hoping for much more... So perhaps he thinks the company can make these short-term moves to get the stock rolling, and then wait and hope for natural gas prices to rebound, which is clearly the real panacea for this stock. Trouble is, few expect gas prices to move up off of these lows for at least a few years, when supply and demand finally come back into balance. That imbalance may even get worse before it gets better: gas drilling techniques are getting even better, allowing producers to boost production while lowering costs. Goldman Sachs thinks we'll have to wait until 2014 for gas prices to firm, which is when a round of coal-fired power plants will be retired and is expected to boost demand for gas-fueled plants. The Goldman analysts tacitly agree with Icahn. "For a sustained rally (in CHK's shares), we believe confidence is needed in CHK's capital spending levels." That echoes Icahn's likely sentiment that the company needs to start showing its cash flow strength and stop pouring money into every asset that comes up for sale. Action to Take --> It's often been a wise move to ride Icahn's coattails. But there's not much he can do in the near-term (beyond Monday's 8% spike) to get shares moving much higher. Icahn is likely to announce his plans soon, and if successful, get Chesapeake started on a 12-18 month process that boosts the company's profile on Wall Street. Shares are unlikely to budge on such news, but you may be wise to get involved at that point, especially if Icahn's stated plans are met with a favorable response. Then again, Aubrey McClendon doesn't like to take advice, so Icahn's quest may simply prove quixotic. But this is a great situation for investors to watch. David Sterman started his career in equity research at Smith Barney, culminating in a position as Senior Analyst covering European banks. David has also served as Director of Research at Individual Investor and a Managing Editor at TheStreet.com. Read More... Disclosure: Neither David Sterman nor StreetAuthority, LLC hold positions in any securities mentioned in this article. About the author: Street Authority StreetAuthority, LLC is a research-intensive financial publishing firm that aims to level the playing field for small investors by giving them access to the ideas and insights of some of the country's top investment researchers, analysts and writers. Although we specialize in income and international investment research, we publish a wide variety of newsletters that are geared towards helping EVERY kind of investor profit from today's volatile marketplace. Visit StreetAuthority. Disclaimers: GuruFocus.com is not operated by a broker, a dealer, or a registered investment adviser. Under no circumstances does any information posted on GuruFocus.com represent a recommendation to buy or sell a security. The information on this site, and in its related newsletters, is not intended to be, nor does it constitute, investment advice or recommendations. The gurus may buy and sell securities before and after any particular article and report and information herein is published, with respect to the securities discussed in any article and report posted herein. In no event shall GuruFocus.com be liable to any member, guest or third party for any damages of any kind arising out of the use of any content or other material published or available on GuruFocus.com, or relating to the use of, or inability to use, GuruFocus.com or any content, including, without limitation, any investment losses, lost profits, lost opportunity, special, incidental, indirect, consequential or punitive damages. Past performance is a poor indicator of future performance. The information on this site, and in its related newsletters, is not intended to be, nor does it constitute, investment advice or recommendations. The information on this site is in no way guaranteed for completeness, accuracy or in any other way. The gurus listed in this website are not affiliated with GuruFocus.com, LLC. Stock quotes provided by InterActive Data. Fundamental company data provided by Morningstar, updated daily.
Q: Why aren't DC motors getting enough power? UPDATE: I really appreciate your help! I´ve found the error, and it was a very basic one. I´m posting it here in case it helps someone out there in the future. I didn´t realised (I´m still learning), that you have to power up your arduino AND your motors separately! So Connecting the arduino to power supply (in my case a 9v adaptor, and then a 12v adaptor) didn´t help at all, because the motors have to get ANOTHER power source, in this case using the Vin pin connected to a positive row of the breadboard. Yes, I realise its a silly newbie mistake, but I wanted to go and write this down anyway. I didn´t undertand at first when people answering and commenting asked about what powered my motors... now I get it! THANKS!!! About the squematics... I´m trying to get acquainted with circuitlab, because it is more complicated to understand -to me al least- than fritzing. I´m not posting this as an answer because it is more than a clarification, and there are several comments already to post yet another one :) I'm trying my first Arduino project, a Bluetooth controlled car. I've divided the project into two parts, one that connects the Arduino to Bluetooth and one that makes the DC motors work. I've found lots of tutorials, but I stuck with following one: Controlling speed of DC Motors using Arduino I've been reading a lot about Arduino and DC motors the last couple of weeks and I've tried some smaller things first (LEDs, buttons, light sensors etc). The problem here is that the motors are quite slow (the wheels won't even move when on the floor). I have an Arduino Mega and an Adafruit motor controller. As I don't have a voltmeter right now I started to test without the motor sensor, because I thought that maybe it was consuming too much power. These are the tests results so far: If I connect three AA batteries to both motors directely, they spin vividly, so I think there's no problem with them. The motors are two DC 4.5/6 V. If I connect a 9V/1A DC adaptor, it's even worse: the motors won't move at all. I thought that maybe the adapter was faulty, but I've tried with another one. The second one is a DC adaptor 12V/1.5A center pin positive and the result is the same. No movement. The LED that I've added to the board for test purposes does light though. I've attached those three AA batteries to the Arduino like the diagram below and it moves but oh so slowly! I've added a simple alkaline 9V battery instead of the three AA (and I've put it together with the three AA too!) and the result is the same, no movement or very, very slow movement. As the motors do spin I don't think that I've set the pins incorrectly or that the code isn't working but I fail to understand why this is happening? UPDATE: Sorry about the diagram (I havent posted it, but I did provide the link though). Im new to the arduino and thought that was the kind of diagram that it should be posted. What should I attach instead? A: Your breadboard diagram shows the 9V battery shorted. That is, its terminals are connected by nothing but a wire (internal to the breadboard). This doesn't accomplish anything except make the battery hot. There's no way for the current from the battery to go anywhere except through this short wire. Notably, there's no way it will go through the motors. The only power source for anything on the breadboard is coming from the GND and +5V connections on the Arduino, which are not sufficient to power the motors, because they are not designed to supply much current. You need a voltmeter to do electronics. Trying to troubleshoot a circuit without a voltmeter is like trying to repair a car with your eyes shut. It's impossible to say exactly what is wrong with your circuit if all you can know about it is "it doesn't work". A: What Phil (and others) are saying is ... The black wire from the battery should plug into anywhere in the second row (from bottom) of the breadboard, not the first row. There is an error in the Fritzing diagram in the article you are reading. In that Fritzing diagram, the 9V battery is powering the Arduino through it's "Vin" pin. You probably aren't intended to have any other power supply connected to the Arduino. As you can tell almost everyone who answers questions on this website prefers real circuit diagrams. This is because it makes it much much easier to understand the circuit.
open one of the projects found in the list. All you have to do is click the corresponding link. open a project found on disk. All you have to do is click the "Open a project" button or click the "Open a project from disk" button, then select the requested project file (WDP, WWP or WPP).open a project found on disk. All you have to do is click the "Open a project" button or click the "Open from disk" button, then select the requested project file (WDP, WWP or WPP).open a project found on disk. All you have to do is click the "Open a project" button again or click the "Disk" button, then select the requested project file (WDP, WWP or WPP). open a project found in the SCM (Source Code Manager). All you have to do is click the "Open a project from SCM" button and specify (if necessary) the database location and the project to open. open a project found in the SCM (Source Code Manager). All you have to do is click the "Open from SCM" button and specify (if necessary) the database location and the project to open. open a project found in the SCM (Source Code Manager). All you have to do is click the "SCM" button and specify (if necessary) the database location and the project to open. Versions 22 and lateropen a project from GDS Drive. All you have to do is click the "SCM Drive" button and indicate the identification details to SCM Drive: email, password and team. Connect to PCSCloud for more details. New in version 22open a project from GDS Drive. All you have to do is click the "SCM Drive" button and indicate the identification details to SCM Drive: email, password and team. Connect to PCSCloud for more details. open a project from GDS Drive. All you have to do is click the "SCM Drive" button and indicate the identification details to SCM Drive: email, password and team. Connect to PCSCloud for more details. Versions 19 and lateropen a project from the CLOUD. All you have to do is click the "Open a project from the CLOUD" button, then specify the name of the cloud platform used and the project to open. This option is available from version 190056. New in version 19open a project from the CLOUD. All you have to do is click the "Open a project from the CLOUD" button, then specify the name of the cloud platform used and the project to open. This option is available from version 190056. open a project from the CLOUD. All you have to do is click the "Open a project from the CLOUD" button, then specify the name of the cloud platform used and the project to open. This option is available from version 190056. open a project from the CLOUD. All you have to do is click the "Open from the CLOUD" button, then specify the name of cloud platform used and the project to open. open a project from the CLOUD. All you have to do is click the "PCSCloud" button, then specify the name of the cloud platform used and the project to open. Connect to PCSCloud for more details. Remarks: By default, the home window is displayed whenever the product is started. The option "Don't display this window anymore and re-open the last project automatically" avoids displaying this window and opens the last project used. The home window can be opened at any time via the menu. Versions 20 and laterThe search area allows you to type the name of the project to find among the pinned projects and the recent projects. New in version 20The search area allows you to type the name of the project to find among the pinned projects and the recent projects. The search area allows you to type the name of the project to find among the pinned projects and the recent projects. open one of the projects found in the list. All you have to do is click the corresponding link. open a project found on disk. All you have to do is click the "Open a project" button again or click the "Disk" button, then select the requested project file (WDP, WWP or WPP). open a project found in the SCM (Source Code Manager). All you have to do is click the "SCM" button and specify (if necessary) the database location and the project to open. open a project from GDS Drive. All you have to do is click the "SCM Drive" button and indicate the identification details to SCM Drive: email, password and team. Connect to PCSCloud for more details. open a project from the CLOUD. All you have to do is click the "PCSCloud" button, then specify the name of the cloud platform used and the project to open. Connect to PCSCloud for more details. Remark: The search area allows you to type the name of the project to find among the pinned projects and the recent projects. Opening an example The home window is used to quickly open an example installed with the product used. To do so: Open the home window. Click the "Open an example" button found at the top of the window. The list of examples is displayed. These examples are grouped by category: Complete examples, Training examples, Versions 21 and laterUnit examples, New in version 21Unit examples, Unit examples, Versions 21 and laterComponents. New in version 21Components. Components. You can: find an example by typing a keyword in the "Search" control. The list of examples is automatically refreshed with the examples that use this keyword in their name or in their description. open one of the examples found in the list. All you have to do is click the corresponding link. Versions 23 and laterRemark: When opening an example: If the example is not installed on the computer, the example is automatically downloaded (from a PC SOFT server) and opened. If the example is installed on the computer, a copy is automatically performed in the directory: "My projects\My examples" for WINDEV. "My Mobile projects\My examples" for WINDEV Mobile. "My sites\My examples" for WEBDEV. The opened example corresponds to the copy. This allows you to work or to perform modifications on this copy. Therefore, the initial example is stored. Whenever the example is opened (via the "Open an example" button), you have the ability to work on the modified example or to use the initial example. New in version 23Remark: When opening an example: If the example is not installed on the computer, the example is automatically downloaded (from a PC SOFT server) and opened. If the example is installed on the computer, a copy is automatically performed in the directory: "My projects\My examples" for WINDEV. "My Mobile projects\My examples" for WINDEV Mobile. "My sites\My examples" for WEBDEV. The opened example corresponds to the copy. This allows you to work or to perform modifications on this copy. Therefore, the initial example is stored. Whenever the example is opened (via the "Open an example" button), you have the ability to work on the modified example or to use the initial example. Remark: When opening an example: If the example is not installed on the computer, the example is automatically downloaded (from a PC SOFT server) and opened. If the example is installed on the computer, a copy is automatically performed in the directory: "My projects\My examples" for WINDEV. "My Mobile projects\My examples" for WINDEV Mobile. "My sites\My examples" for WEBDEV. The opened example corresponds to the copy. This allows you to work or to perform modifications on this copy. Therefore, the initial example is stored. Whenever the example is opened (via the "Open an example" button), you have the ability to work on the modified example or to use the initial example. The home page allows you to quickly open an example installed with the product used. To do so: Display the home page. Click "Open an example". The list of examples is displayed. These examples are grouped by category: Complete examples, Training examples, Unit examples, Components. You can: search for an example, by entering a keyword in the search control (identified by a magnifying glass). The list of examples is automatically refreshed with the examples that use this keyword in their name or in their description. Versions 24 and laterA small icon allows you to quickly identify the execution platform of the example. New in version 24A small icon allows you to quickly identify the execution platform of the example. A small icon allows you to quickly identify the execution platform of the example. Versions 24 and laterfilter the examples by platform, using the different icons next to the search area. New in version 24filter the examples by platform, using the different icons next to the search area. filter the examples by platform, using the different icons next to the search area. open one of the examples found in the list. Simply click on the name of the example. Remark: When opening an example: If the example is not installed on the computer, the example is automatically downloaded (from a PC SOFT server) and opened. If the example is installed on the computer, a copy is automatically performed in the directory: "My projects\My examples" for WINDEV. "My Mobile projects\My examples" for WINDEV Mobile. "My sites\My examples" for WEBDEV. The opened example corresponds to the copy. This allows you to work or to perform modifications on this copy. Therefore, the initial example is stored. Whenever the example is opened (via the "Open an example" button), you have the ability to work on the modified example or to use the initial example. Opening an example found in the tutorial WINDEV, WEBDEV and WINDEV Mobile are supplied with a tutorial. This tutorial includes a support (printed manual or PDF file) and exercises. The home window allows you to quickly open the PDF file corresponding to the tutorial support as well as the associated exercises. To do so: Open the home window. Click the "Tutorial" button found at the top of window. You can: Open the PDF file of the lesson via the link displayed at the top of window. Open one of the exercises displayed in the list. These examples are listed in their appearance order in the lesson. To open the requested project, all you have to do is click the corresponding link. Versions 23 and laterRemarks: If the tutorial is not installed, the tutorial examples can be downloaded from the PC SOFT server. When opening a tutorial exercise, a copy is automatically performed in the directory: "My projects\My examples" for WINDEV. "My Mobile projects\My examples" for WINDEV Mobile. "My sites\My examples" for WEBDEV. The opened project corresponds to the copy. This allows you to work or to perform modifications on this copy. Therefore, the initial project is stored. Whenever the exercise is opened (via the "Tutorial" button), you have the ability to work on the modified exercise or to use the initial exercise. New in version 23Remarks: If the tutorial is not installed, the tutorial examples can be downloaded from the PC SOFT server. When opening a tutorial exercise, a copy is automatically performed in the directory: "My projects\My examples" for WINDEV. "My Mobile projects\My examples" for WINDEV Mobile. "My sites\My examples" for WEBDEV. The opened project corresponds to the copy. This allows you to work or to perform modifications on this copy. Therefore, the initial project is stored. Whenever the exercise is opened (via the "Tutorial" button), you have the ability to work on the modified exercise or to use the initial exercise. Remarks: If the tutorial is not installed, the tutorial examples can be downloaded from the PC SOFT server. When opening a tutorial exercise, a copy is automatically performed in the directory: "My projects\My examples" for WINDEV. "My Mobile projects\My examples" for WINDEV Mobile. "My sites\My examples" for WEBDEV. The opened project corresponds to the copy. This allows you to work or to perform modifications on this copy. Therefore, the initial project is stored. Whenever the exercise is opened (via the "Tutorial" button), you have the ability to work on the modified exercise or to use the initial exercise. WINDEV, WEBDEV and WINDEV Mobile are supplied with a tutorial. This tutorial includes paper and online documentation as well as exercises. The home page allows you to quickly open the e-lesson corresponding to the tutorial support, as well as the associated exercises. To do so: Display the home page. Click the "Tutorial" button. You can: See the lesson e-version via the link displayed at the top. Open one of the exercises displayed in the list. These examples are listed in their appearance order in the lesson. To open the requested project, all you have to do is click the corresponding link. Remarks: If the tutorial is not installed, the tutorial examples can be downloaded from the PC SOFT server. When opening a tutorial exercise, a copy is automatically performed in the directory: "My projects\My examples" for WINDEV. "My Mobile projects\My examples" for WINDEV Mobile. "My sites\My examples" for WEBDEV. The opened project corresponds to the copy. This allows you to work or to perform modifications on this copy. Therefore, the initial project is stored. Whenever the exercise is opened (via the "Tutorial" button), you have the ability to work on the modified exercise or to use the initial exercise.
776 F.2d 1056 Hendrixv.Patterson 84-7410 United States Court of Appeals,Eleventh Circuit. 10/24/85 1 N.D.Ala. AFFIRMED
576 F.2d 46 UNITED STATES of America, Plaintiff-Appellee,v.Roosevelt Peter JACKSON, Defendant-Appellant. No. 77-5636Summary Calendar.* United States Court of Appeals,Fifth Circuit. July 5, 1978. Marvin S. Arrington, John J. Goger, Atlanta, Ga., for defendant-appellant. William L. Harper, U. S. Atty., Robert A. Boas, Asst. U. S. Atty., Atlanta, Ga., for plaintiff-appellee. Appeal from the United States District Court for the Northern District of Georgia. Before THORNBERRY, GODBOLD and RUBIN, Circuit Judges. THORNBERRY, Circuit Judge: 1 This is one of a growing number of cases involving doctors who "deal" drugs.1 Appellant Roosevelt P. Jackson, M.D., established a "mental health clinic" apart from his regular practice after suffering a drop in income following his loss of surgical privileges at certain Atlanta hospitals. The clinic quickly became known as a source of "Quaalude," the commercial name for the depressant methaqualone a Schedule II controlled substance that enjoys considerable popularity among the drug set. 2 In January 1977 a federal grand jury in Atlanta returned a 76-count indictment against Dr. Jackson, charging that he had unlawfully dispensed controlled substances in violation of 21 U.S.C. § 841(a)(1).2 Forty-two counts were eventually submitted to the jury, which returned verdicts of guilty on all counts. Dr. Jackson received five-year prison sentences on each count, to run concurrently, plus five years probation. All but six months of the jail term was suspended.3 3 On appeal, Dr. Jackson contends that (1) the indictment did not properly charge all elements of the offense; (2) the district court erroneously failed to order physical and mental examinations of the witnesses; (3) the district court erred in admitting into evidence 5,000 prescriptions for methaqualone issued by Dr. Jackson; (4) the district court improperly limited cross-examination of a government witness; and (5) the evidence was insufficient to support his conviction. For the reasons stated below, we affirm. 4 In United States v. Moore, 423 U.S. 122, 96 S.Ct. 335, 46 L.Ed.2d 333 (1975), the Supreme Court held that physicians registered to dispense drugs may be prosecuted under 21 U.S.C. § 841(a)(1) when "their activities fall outside the usual course of professional practice." Dr. Jackson argues that the indictment in his case was defective in that it failed to charge that he had dispensed controlled substances in such fashion, i. e., without legitimate medical purpose. Even if an indictment charging a physician under § 841(a)(1) were required to contain an allegation of activity outside the scope of usual professional practice,4 we think the indictment in the instant case passes muster. The indictment alleged, in pertinent part: 5 That on or about the dates hereinafter specified, within the Northern District of Georgia, the defendant, ROOSEVELT PETER JACKSON, who at all times hereinafter mentioned was a physician licensed and registered by the United States and by the State of Georgia to dispense, administer, and conduct research with respect to controlled substance in the course of professional practice or research, under the guise and artifice of operating a "mental health clinic" and/or a drug abuse program, did knowingly, intentionally and unlawfully dispense the controlled substance(s) listed below to the person(s) listed below, in violation of Title 21, United States Code, Section 841(a)(1). 6 Although the indictment does not state that Dr. Jackson acted outside the scope of professional practice, it does allege a more specific activity, i. e., that he dispensed drugs unlawfully "under the guise and artifice of operating" his clinic. Even a casual reading of the indictment makes clear that Dr. Jackson was alleged to have utilized his clinic as a "front" for dealing drugs, and the language obviously embraces an activity lacking legitimate medical purpose. The indictment is thus sufficient although it lacks the "magic words" of Moore. See United States v. McGough, 510 F.2d 598, 602 (5 Cir. 1975); United States v. Romero, 495 F.2d 1356, 1359 (5 Cir.), cert. denied, 419 U.S. 995, 95 S.Ct. 307, 42 L.Ed.2d 267 (1974). 7 Dr. Jackson next argues that the district court erroneously denied his motion for physical and psychiatric examination of thirteen witnesses who testified how they obtained prescriptions from him. Because all of these "patients" were drug users, he contends that the examination results might have shown them incompetent to testify or would have been relevant for impeachment purposes. 8 The district court has broad discretion in determining whether to order such examinations. Gurleski v. United States, 405 F.2d 253, 267 (5 Cir. 1968), cert. denied, 395 U.S. 977, 89 S.Ct. 2127, 23 L.Ed.2d 765 (1969). We find no abuse here. The fact that a witness is a narcotics user goes not to his competency, but to his credibility. United States v. Killian,524 F.2d 1268, 1275 (5 Cir. 1975), cert. denied, 425 U.S. 935, 96 S.Ct. 1667, 48 L.Ed.2d 177 (1976); Gurleski v. United States, supra; see also Rule 601, Fed.R.Evid. Defense counsel extensively cross-examined the "patients" about their drug experiences and also had access to questionnaires filled out by the "patients" when they first visited Dr. Jackson, as well as the results of the doctor's own examination of them. Regarding the requested mental examination, psychiatric opinions as to a witness' reliability in distinguishing truth from fantasy is inadmissible for impeachment purposes, for it invades the jury's province to make credibility determinations. United States v. Wertis, 505 F.2d 683, 685 (5 Cir. 1974), cert. denied, 422 U.S. 1045, 95 S.Ct. 2662, 45 L.Ed.2d 697 (1975). Moreover, a court-ordered medical examination is an infringement on a witness' privacy, and this factor must be taken into account by the district court. As the district judge said in the instant case: 9 Such an examination may seriously impinge on a witness' right to privacy, very high on any scale of balancing rights. The examination itself could serve as a tool of harassment, and the likelihood of an examination could deter witnesses from coming forward, producing a chilling effect on crime detection. 10 Dr. Jackson also complains that the district court improperly admitted into evidence more than 5,000 prescriptions for methaqualone, written over a fifteen-month period, that did not relate to any of the counts of the indictment. We disagree. This evidence of "other acts" was relevant to Dr. Jackson's motive, i. e., it helped establish that he was in the business of writing prescriptions for drugs commonly used "on the street". Moreover, each prescription was for twenty-four tablets and each had been filled at the same pharmacy. The prescriptions were relevant for purposes of Dr. Jackson's knowledge that he was acting outside the usual course of professional practice and his intent to dispense the drugs unlawfully. Rule 404(b), Fed.R.Evid.; see also United States v. Greenfield, 574 F.2d 305 (5 Cir. 1978); United States v. Ellzey, 527 F.2d 1306 (6 Cir. 1976). In admitting the evidence, the district judge obviously determined that its probative value outweighed any potential prejudice. Rule 403, Fed.R.Evid. That determination is to be upheld "unless an abuse of discretion is found," United States v. Kirk, 528 F.2d 1057, 1061 (5 Cir. 1976), and we find none here.5 11 One of the government's witnesses was a newspaper reporter from the Atlanta Constitution, who testified about an interview he conducted with Dr. Jackson in preparation for an article on Jackson's "drug practice." There was considerable consternation about the reporter's direct testimony, and the district court eventually ruled that he could testify only about "direct statements by the doctor to the reporter." On cross-examination, defense counsel sought to go beyond matters covered on direct testimony by inquiring into the news story's contents and other aspects of the interview, but the district court refused to permit this line of questioning. Dr. Jackson contends that the district court impermissibly limited cross-examination. 12 Under the "restrictive" federal practice, cross-examination is generally to be "limited to the subject matter of the direct examination and matters affecting the credibility of the witness," although the district court has discretion to permit inquiry into additional matters. Rule 611(b), Fed.R.Evid. Placing restrictions on cross-examination is within the sound discretion of the district court, United States v. Zepeda-Santana, 569 F.2d 1386, 1389 (5 Cir. 1978); United States v. Onori, 535 F.2d 938, 945 (5 Cir. 1976); United States v. Ramirez, 533 F.2d 138, 140 (5 Cir.), cert. denied, 429 U.S. 884, 97 S.Ct. 235, 50 L.Ed.2d 165 (1976), and we find no abuse of discretion here. 13 Finally, Dr. Jackson raises a sufficiency of the evidence challenge by contending that the district court should have granted his motion for acquittal. The evidence, viewed in a light most favorable to the government,6 is more than sufficient to support the conviction. After losing surgical privileges at two Atlanta hospitals, Dr. Jackson established a "mental health clinic" apart from his regular practice. He admitted to the newspaper reporter that the only way he could maintain his previous income level was by treating large numbers of patients with methaqualone. In addition, the reporter testified that Dr. Jackson said he had prescribed methaqualone for some 5,000 persons within a four-month period and acknowledged that these people came to him for the drug because it was cheaper than buying it "on the street," despite the "office visit" charge of $20 or $25. 14 Thirteen persons for whom he had prescribed the drug testified that they went to Dr. Jackson after hearing that it was easy to obtain methaqualone from him. All of these "patients" had had previous drug experiences, and some even admitted on a questionnaire filled out for the doctor that they took drugs to "get high" or "escape from reality." Nonetheless, they received prescriptions for methaqualone after filling out the questionnaires and receiving perfunctory physical examinations. Two medical experts testified that the examinations were inadequate and that the records kept by Dr. Jackson were also insufficient. Moreover, one expert stressed the importance of adequate warnings to the patient, and several "patients" said Dr. Jackson did not give any such warnings or other instructions as to the proper use of the drug. Moreover, the prescriptions were all for the same amount of methaqualone twenty-four 300 milligram tablets. This evidence is clearly sufficient to establish a course of medical activity well outside the usual professional practice. 15 AFFIRMED. * Rule 18, 5 Cir.; see Isbell Enterprises, Inc. v. Citizens Casualty Co. of New York et al., 5 Cir., 1970, 431 F.2d 409, Part I 1 E. g., United States v. Boettjer, 569 F.2d 1078 (9 Cir. 1978); United States v. Davis, 564 F.2d 840 (9 Cir. 1977); United States v. Greenfield, 554 F.2d 179 (5 Cir. 1977); United States v. Fellman, 549 F.2d 181 (10 Cir. 1977); United States v. Hooker, 541 F.2d 300 (1 Cir. 1976); United States v. Hicks, 529 F.2d 841 (5 Cir.), cert. denied, 429 U.S. 856, 97 S.Ct. 154, 50 L.Ed.2d 133 (1976); United States v. Ellzey, 527 F.2d 1306 (6 Cir. 1976) 2 21 U.S.C. § 841(a)(1) provides, in part: (a) Except as authorized by this subchapter, it shall be unlawful for any person knowingly or intentionally (1) to manufacture, distribute, or dispense, or possess with intent to manufacture, distribute, or dispense, a controlled substance 3 Under a special condition of probation, Dr. Jackson was required to pay a fine of $250 on each count, a total of $10,500 4 We leave this question, apparently one of first impression, to another day. Some reported cases have involved indictments utilizing such language as "not in the course of usual professional practice" and "not for a legitimate medical purpose," e. g., United States v. Boettjer, supra, 569 F.2d at 1081, and this is undoubtedly the safer practice. We note, however, that the Supreme Court did not address the question in Moore, and that under the predecessor to the present narcotics statutes no such allegation was required. United States v. Ramzy, 446 F.2d 1184 (5 Cir.), cert. denied, 404 U.S. 992, 92 S.Ct. 537, 30 L.Ed.2d 544 (1971). The general rule, followed in Ramzy, is that the government need not negative statutory exceptions. See United States v. Cook, 17 Wall. (84 U.S.) 168, 21 L.Ed. 538 (1897); McKelvey v. United States, 260 U.S. 353, 43 S.Ct. 132, 67 L.Ed. 301 (1922); 21 U.S.C. § 845(a)(1). Physicians and other medical professionals are excepted from the provisions of § 841(a)(1) if properly registered under § 822 and if they dispense drugs in the usual course of professional practice. United States v. Moore, supra; see also 21 U.S.C. § 802(20) 5 We also note that in a sense the evidence was merely cumulative, since a newspaper reporter had previously testified of an interview in which Dr. Jackson had stated that he had prescribed methaqualone for 5,000 patients during a four-month period 6 Glasser v. United States, 315 U.S. 60, 62 S.Ct. 457, 86 L.Ed. 680 (1942)
Introduction ============ Rheumatoid arthritis (RA is a chronic inflammatory disease characterized by synovial hyperplasia and excessive mononuclear infiltration. Altered apoptosis was proposed as a possible mechanism for cell accumulation. *In vitro* experiments showed that monokines are able to inhibit synovial apoptosis in a dose dependent manner. In this study we aim to investigate synovial apoptosis with respect to disease duration, inflammatory cell type and monokines expression. Materials and methods ===================== Synovial biopsy speciments from eleven patients with longstanding RA (mean disease duration 21 years) and eight with early RA (mean disease duration 5 months) have been investigated. Samples were evaluated for apoptosis (TUNEL method combined with morphologic analysis), cell surface markers (CD3, CD68) and monkine expression (IL1α, IL1β, TNFα and IL6). Tissue sections were then microscopically analysed using comput-erised image analysis. Statistical analysis was done using Mann-Withney test, Spearman correlation test and linear regression. Results ======= Apoptosis level in RA synovium is signficiantly higher in late cases compared with early ones (*P* = 0,001), while macrophage population significantly decreases during disease progession (*P* = 0,003). Macrophage score is negatively correlated with apoptosis level (R=-0,618; *P* = 0,0088). In contrast, no correlation could be observed between apoptosis and monokine expression or T cell score. Discussion ========== Low level of apoptosis in early RA cases suggests an ineffective cell death mechanism that ultimately contributes to cell accumulation into the joint and propagation of the inflammatory response. Apoptosis is restored during disease progression, in parallel with a decrease of the macrophage number. These findings suggest apoptosis as a possible marker for early RA and a promising therapy target.
Trigeminal neuralgia and multiple sclerosis. In a series of patients with trigeminal neuralgia (TN) who were treated with radiofrequency electrocoagulation of the gasserian ganglion and retrogasserian rootlets, either alone or with glycerol, 16 patients with TN and multiple sclerosis (TNMS) are compared with 219 patients with TN without MS. Patients with TNMS were younger and more likely to have bilateral facial pain than those with TN alone. Probability of ipsilateral recurrence was calculated on the basis of Kaplan and Meier product-limit estimates and showed no significant differences in the two groups.
Idina Menzel Is "Absolutely" Interested in Playing Queen Elsa Live in Frozen Broadway Musical Idina Menzel wants to build a snowman… on Broadway! The actress, who voiced Queen Elsa in Disney's record-breaking animated movie, Frozen, told Cosmopolitan.com last Friday, April 25, that she was open to reprising her role in the movie's Broadway adaptation. "Yes! Sure! Absolutely!" she said at Variety's Power of Women luncheon. Menzel, 42, already a Broadway veteran, is currently starring in musical If/Then. The Tony-winning actress received her first taste of mainstream mega-caliber success for lending her vocals to Frozen's smash song "Let It Go," which won the Best Song Oscar last month. "It was such a dream of mine to be in the Disney family and become an animated queen," Menzel told Cosmo. Since its release last November, Frozen has become the highest-grossing animated movie in history, presumably prompting Disney to bring the film to life onstage as it has for other Disney classics like the Lion King, Aladdin, and Beauty and the Beast. Not all fans want Menzel, however, to play Elsa. The actress joked to Cosmo how her 4-year-old son Walker (with estranged husband Taye Diggs) would prefer for his mommy to "dress up like the Michael Jackson zombie from 'Thriller.'" Whether or not she's tapped to revive the role of Elsa on Broadway, Menzel told Backstage magazine in early April that she is trying to live by what's good right now. "I'm always afraid to hope for something because I don't want to be disappointed," Menzel said in the interview. "Instead of worrying, why not enjoy the idea of the positive outcome, and if it doesn't happen, you get over it." Like Menzel, costar Kristen Bell has also expressed interest in reprising her role as Princess Anna on Broadway. "Everybody in Frozen is a Broadway veteran so I certainly hope they try and wrangle us," Bell—who made her Broadway debut back in 2001 in The Adventures of Tom Sawyer—said of Disney to EW Radio. The blonde Veronica Mars star, proving her live performance chops, delivered a flawless rendition of "Do You Want to Build a Snowman" during a Frozen cabaret back in February. "I've wanted to be a Disney princess since I was five years old!" Bell told the crowd. Add a Comment Sign Up for the Us Weekly Newsletter! Please enable javascript to sign up for the newsletter. You will receive the latest news and updates on your favorite celebrities!
Teaching German News North Korea fires two ballistic missiles into sea North Korea has fired two medium-range ballistic missiles days after leader Kim Jong-Un ordered further nuclear warhead and missile tests. The missiles both landed in the sea off the country's eastern coast. US defense officials said they had tracked two launches, both believed to be medium-range Rodong missiles fired from road-mobile launch vehicles. The first missile reported flew about 800 kilometers (500 miles) off the Korean Peninsula's eastern coast before landing in the East Sea, according to South Korea's Yonhap news agency. A ministry spokesman said that the first missile was launched from Sukchon in the country's southwest at 5:55 a.m. on March 18, 2015 (20:55 UTC March 17). The second missile was fired about 20 minutes later, disappearing off radar early into its flight at an altitude of roughly 17 kilometers (10 miles). It originated from the same region near North Korea's west coast. Japanese Prime Minister Shinzo Abe ordered his government to investigate the launch to confirm the safety of shipping in the splashdown zone. Yonhap confirmed that the missiles likely were Rodong types, citing military sources. It added that the second projectile may have disintegrated midair. The Rodong missile is a scaled up Scud variant with a maximum range of around 1,300 kilometers (800 miles). US Defense Secretary Ash Carter criticized China, saying Beijing "could do a lot more" to influence North Korea's behavior. He added, however, that the US was "analyzing the results" of Friday's missile launches. In response to the tests, Japan lodged a protest with North Korea through its embassy in Beijing. Prime Minister Shinzo Abe told the Japanese parliament that Tokyo would take "all necessary measures, such as warning and surveillance activity, to be able to respond to any situations." A UN Security Council meeting to discuss North Korea's missile launches was due to be held in the US on Friday afternoon.
When Iraq War veteran Brian Vargas recalls the moment he nearly lost his life in 2007, he says it's a bit hazy. Vargas, 29, was on a rooftop in Iraq with two fellow Marines on a security watch when a sniper opened fire. "I felt what it's like to be gone and to be able to give up if I wanted to," he said. Vargas was shot several times, and during the gunbattle, his ammunition exploded into his face. He remembers his ammunition box saved his life. "There’s a lot of times in my head that I think I shouldn’t be here," he says. "I should have taken the round straight to the face. My parents would have a folded flag." Vargas made it back home alive, thanks to two of his buddies, he says. But his battle didn't end that day nearly a decade ago. He admits there was a moment when he was so overwhelmed with the grief of losing friends to suicide and with the stress associated with school and marriage that he went looking for his gun lock. "There was a time when I thought, screw it, I’m ready to end it," he remembers. But the contents of his ammo box — pictures of his wife, the rounds that struck him and a list of Marines who served by his side — persuaded him to continue the fight. On Saturday, he will graduate from UC Berkeley with a degree in social work. "Stay in that fight," he says, "our battles aren’t over. We’ve got new battles." With his degree, Vargas plans to start a new suicide prevention program with psychologist Shauna Springer that centers on the ammo box. It's called Live 4 Box. He hopes to inspire other veterans to live for whatever they choose to keep in their box. "If I can prevent one guy from committing suicide, I know I’ve done some service," he says. "Life is OK. You’re fighting a different battle, but you have resources that are here to support you." Vargas has a job lined up with Rep. Eric Swalwell working in veterans affairs and outreach. Meanwhile, the Live 4 Box program is seeking funds to expand. For those seeking help, the national suicide prevention lifeline is open 24/7 at 800-273-8255. NBC Bay Area's Stephen Ellison contributed to this story.
Q: Store images into array and display them into angular view I am making a gallery of images where user can upload images and display it into the view, the problem that I pushed the images into an array but I couldn't display them into the view. this is the view in angular component gallery.componet.html <div class="row"> <div class="col-md-3"> <div class="form-group"> <div class="upload-btn-wrapper"> <img for="profileImage" src="assets/common/add_image.svg" class="upload-placeholder" /> <input #gallery type="file" accept="image/*" name="profile image" (change)="imageUpload($event)"/> <label for="profileImage" class="mt-3 font-weight-bold">Add Photo Gallery</label> </div> </div> </div> <div class="col-md-3"> <div class="gallery" *ngFor="let item of gallery"> <img src="{{item}}" width="300px" height="300px"> </div> </div> </div> function to get the image and push it to the gallery array gallery.component.ts gallery = []; imageUpload(event) { if (event.target.files && event.target.files[0]) { const reader = new FileReader(); reader.readAsDataURL(event.target.files[0]); reader.onload = (e: any) => { this.gallery.push(e.target.result); }; } } stackblitz https://stackblitz.com/edit/angular-z4usrg Error message Cannot find a differ supporting object '[object HTMLInputElement]' of type 'profile image'. NgFor only supports binding to Iterables such as Arrays. A: Your input is also tagged gallery. Try to change it. <input #galleryFileInput type="file" accept="image/*" name="profile image" (change)="imageUpload($event)"/>
Robot-assisted hysterectomy compared to open and laparoscopic approaches: systematic review and meta-analysis. To review the safety and effectiveness of robot-assisted hysterectomy compared to traditional open and conventional laparoscopic surgery, differentiating radical, simple total with node staging, and simple total hysterectomy. Medline, Embase, the Cochrane library, and the Journal of Robotic Surgery were searched for controlled trials and observational studies with historic or concurrent controls. Data were pooled using random effects meta-analysis. Compared to open surgery, robot-assisted radical hysterectomy is associated with reduced hospital stay and blood transfusions. For simple total hysterectomy with node staging, robot-assisted surgery is associated with reduced hospital stay, complications, and blood transfusions compared to open surgery. Compared to conventional laparoscopic surgery, robot-assisted simple total hysterectomy with node staging is associated with complications and conversions. Compared to open surgery, robot-assisted hysterectomy offers benefits for reduced length of hospital stay and blood transfusions. The best evidence of improved outcomes is for simple total hysterectomy with node staging. Study quality was poor.
Photo : George Kraychyk ( Hulu ) Here’s what’s happening in the world of television for Wednesday, April 25. All times are Eastern. Top pick The Handmaid’s Tale (Hulu): Despite the fact that “everything from the photography to the tone is darker” in the second season of Hulu’s adaptation of Margaret Atwood’s searing novel about a fascistic, misogynist future America, our pre-air review insists the series remains a must-watch. It picks up right where season one ended, with Offred in real trouble thanks to her involvement with the underground resistance Mayday. No word on just how bleak things are going to get, but our Allison Shoemaker will be there to report on every single development in Gilead. Regular coverage Survivor (CBS, 8 p.m.) Riverdale (The CW, 8 p.m.) The Expanse (Syfy, 9 p.m.) The Americans (FX, 10 p.m.) Archer (FXX, 10 p.m.) Season premiere Krypton (Syfy, 10 p.m.) Wild card Psychokinesis (Netflix): Oh look, it’s a new movie from Yeon Sang-ho, the South Korean writer-director of 2016's extremely good zombie-outbreak flick Train To Busan. (It even made The A.V. Club’s list of the best movies from 2016 we didn’t review upon initial release.) This one’s apparently a satirical black comedy about a father trying to save his daughter with the help of some unexpected superpowers. Say no more—we’re in.
Q: Crear un RecyclerView con CursorAdapter para base de datos con múltiples tablas En mi aplicación Android estoy intentando introducir una base de datos de 18 tablas y aunque estoy terminando el proceso para introducir la BD en mi app, ya he empezado a mirar como visualizar los datos de una tabla en un RecyclerView y para mi sorpresa he descubierto que tengo que utilizar un RecyclerView con un CursorAdapter personalizado. Se más o menos que es un cursor, pero no encuentro como poder crear un CursorAdapter personalizado para enviar la información de la tabla de la BD al RecyclerView. He estado buscando información por Internet y no encuentro nada que detalle como crearlo. Solo he encontrado librerías que han creado otros programadores, pero no quisiera meter librerías externas si se puede hacer sin ellas. ¿Alguien sabría decirme como crearlo y así poder entenderlo? No creo que se necesite más información para aportar una respuesta, pero si no es así, escribidme un comentario. Gracias de antemano. A: Yo evito también usar librerías, de hecho son pocas las que uso. En un proyecto tengo una implementacion similar y este CustomAdapter es el que uso: CursorRecyclerViewAdapter.java: import android.content.Context; import android.database.Cursor; import android.database.DataSetObserver; import android.support.v7.widget.RecyclerView; /** * Created by skyfishjy. */ public abstract class CursorRecyclerViewAdapter<VH extends RecyclerView.ViewHolder> extends RecyclerView.Adapter<VH> { private Context mContext; private Cursor mCursor; private boolean mDataValid; private int mRowIdColumn; private DataSetObserver mDataSetObserver; public CursorRecyclerViewAdapter(Context context, Cursor cursor) { mContext = context; mCursor = cursor; mDataValid = cursor != null; mRowIdColumn = mDataValid ? mCursor.getColumnIndex("_id") : -1; mDataSetObserver = new NotifyingDataSetObserver(); if (mCursor != null) { mCursor.registerDataSetObserver(mDataSetObserver); } } public Cursor getCursor() { return mCursor; } @Override public int getItemCount() { if (mDataValid && mCursor != null) { return mCursor.getCount(); } return 0; } @Override public long getItemId(int position) { if (mDataValid && mCursor != null && mCursor.moveToPosition(position)) { return mCursor.getLong(mRowIdColumn); } return 0; } @Override public void setHasStableIds(boolean hasStableIds) { super.setHasStableIds(true); } public abstract void onBindViewHolder(VH viewHolder, Cursor cursor); @Override public void onBindViewHolder(VH viewHolder, int position) { if (!mDataValid) { throw new IllegalStateException("this should only be called when the cursor is valid"); } if (!mCursor.moveToPosition(position)) { throw new IllegalStateException("couldn't move cursor to position " + position); } onBindViewHolder(viewHolder, mCursor); } /** * Change the underlying cursor to a new cursor. If there is an existing cursor it will be * closed. */ public void changeCursor(Cursor cursor) { Cursor old = swapCursor(cursor); if (old != null) { old.close(); } } /** * Swap in a new Cursor, returning the old Cursor. Unlike * {@link #changeCursor(Cursor)}, the returned old Cursor is <em>not</em> * closed. */ public Cursor swapCursor(Cursor newCursor) { if (newCursor == mCursor) { return null; } final Cursor oldCursor = mCursor; if (oldCursor != null && mDataSetObserver != null) { oldCursor.unregisterDataSetObserver(mDataSetObserver); } mCursor = newCursor; if (mCursor != null) { if (mDataSetObserver != null) { mCursor.registerDataSetObserver(mDataSetObserver); } mRowIdColumn = newCursor.getColumnIndexOrThrow("_id"); mDataValid = true; notifyDataSetChanged(); } else { mRowIdColumn = -1; mDataValid = false; notifyDataSetChanged(); //There is no notifyDataSetInvalidated() method in RecyclerView.Adapter } return oldCursor; } private class NotifyingDataSetObserver extends DataSetObserver { @Override public void onChanged() { super.onChanged(); mDataValid = true; notifyDataSetChanged(); } @Override public void onInvalidated() { super.onInvalidated(); mDataValid = false; notifyDataSetChanged(); //There is no notifyDataSetInvalidated() method in RecyclerView.Adapter } } } MyListCursorAdapter.java: Raw MyListCursorAdapter.java import android.content.Context; import android.database.Cursor; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; import java.util.List; /** * Created by skyfishjy on 10/31/14. */ public class MyListCursorAdapter extends CursorRecyclerViewAdapter<MyListCursorAdapter.ViewHolder>{ public MyListCursorAdapter(Context context,Cursor cursor){ super(context,cursor); } public static class ViewHolder extends RecyclerView.ViewHolder { public TextView mTextView; public ViewHolder(View view) { super(view); mTextView = view.findViewById(R.id.text); } } @Override public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View itemView = LayoutInflater.from(parent.getContext()) .inflate(R.layout.my_view, parent, false); ViewHolder vh = new ViewHolder(itemView); return vh; } @Override public void onBindViewHolder(ViewHolder viewHolder, Cursor cursor) { MyListItem myListItem = MyListItem.fromCursor(cursor); viewHolder.mTextView.setText(myListItem.getName()); } } Tu adapter tiene que extender de CustomRecyclerViewAdapter, este es el link del código: https://gist.github.com/skyfishjy/443b7448f59be978bc59
Improved dietary treatment with low protein and phosphorus restriction in uremic rats. The independent effect of low-protein or low-phosphorus diets in chronic renal failure were studied. The following four isocaloric diets, which contained various amounts of protein (24%, 6%) and phosphorus (0.5%, 0.12%) were fed to chronically uremic rats: high protein and no phosphorus restriction (HPrNP), high protein and phosphorus restriction (HPrRP), low protein and no phosphorus restriction (LPrNP), and low protein and phosphorus restriction (LPrRP). Adult male rats were made chronically uremic by electrocoagulation of one kidney and contralateral nephrectomy. Two grades of renal damage were produced, one of which was mild and the other severe. The mean number of days of survival in the severely uremic animals was 7.5 +/- (SEM) 2.5 with the HPrNP diet, 17.6 +/- 2.4 with the HPrRP diet, 20.3 +/- 2.3 with the LPrNP diet, and over 41.8 +/- 2.5 with the LPrRP diet during a 50-day period of observation. The BUN, serum creatinine (SCr), calcium (SCa), phosphorus (SP), urea and creatinine clearances (Curea, CCr), and plasma PTH levels before and 3 weeks after the diets were compared in the surviving rats with mild and severe uremia. There were marked reductions in the BUN and SP concentrations with the low-protein diets, whereas the SCa increased with all diets. Curea remained practically unchanged with the low-protein diets, whereas CCr decreased with all diets. Plasma PTH levels varied with each diet, but those rats with elevated PTH levels before dietary therapy experienced a fall in plasma PTH after the low-phosphorus diets were administered, with or without protein restriction.(ABSTRACT TRUNCATED AT 250 WORDS)
/* Copyright 2016 Goldman Sachs. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package com.gs.fw.common.mithra.util; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.Map; import java.util.concurrent.*; import java.util.Comparator; import java.util.concurrent.atomic.AtomicInteger; public class ThreadConservingExecutor implements ExecutorWithFinish { private static final Logger logger = LoggerFactory.getLogger(ThreadConservingExecutor.class); private final BlockingQueue queue; private Future[] executorRunnables; private final int threads; private final Comparator comparator; private Throwable throwable; private int queuedWork; private static final ExecutorService EXECUTOR_SERVICE = Executors.newCachedThreadPool(new ThreadFactory() { private final AtomicInteger threadNumber = new AtomicInteger(0); public Thread newThread(Runnable r) { Thread t = new Thread(r); t.setDaemon(true); t.setName("ThreadConservingThread-" + threadNumber.incrementAndGet()); return t; } }); public static ThreadConservingExecutor fifoQueued(int threads) { return new ThreadConservingExecutor(threads); } public static ThreadConservingExecutor priorityQueued(int threads) { return priorityQueued(threads, new Comparator() { public int compare(Object o1, Object o2) { return ((Comparable)o1).compareTo(o2); } }); } public static ThreadConservingExecutor priorityQueued(int threads, Comparator comparator) { return new ThreadConservingExecutor(threads, new PriorityBlockingQueue(), comparator); } /** * instantiates (threads - 1) threads to do its work. When finish() is called, the calling thread * is also used to do the work. * @param threads */ public ThreadConservingExecutor(int threads) { this(threads, new LinkedBlockingQueue(), null); } private ThreadConservingExecutor(int threads, BlockingQueue queue, Comparator comparator) { this.threads = threads; this.queue = queue; this.comparator = comparator; } private synchronized void setError(Throwable t) { this.throwable = t; this.notify(); } private synchronized boolean hasError() { return this.throwable != null; } private void createThreads() { if (this.executorRunnables == null && threads > 1) { this.executorRunnables = new Future[threads - 1]; for(int i = 0;i < threads - 1;i++) { this.executorRunnables[i] = EXECUTOR_SERVICE.submit(new ExecutorRunnable()); } } } public void checkForError() { if (throwable != null) { if (throwable instanceof RuntimeException) { throw (RuntimeException) throwable; } else { throw new RuntimeException(throwable); } } } public void abort(Throwable e) { if (!hasError()) { this.setError(e); } } public void execute(Runnable command) { this.submit(command); } public void submit(Runnable runnable) { checkForError(); createThreads(); queue.add(new ErrorCatchingRunnable(runnable)); incrementQueuedWork(); } private synchronized void incrementQueuedWork() { this.queuedWork++; this.notify(); } private synchronized void decrementQueuedWork() { this.queuedWork--; this.notify(); } private int getRunningThreadCount() { int result = 1; if (this.executorRunnables != null) { result += this.executorRunnables.length; } return result; } public void finish() { checkForError(); boolean done = false; while(!done) { checkForError(); QueueRunnable runnable = (QueueRunnable) queue.poll(); if (runnable != null) { if (runnable.mustShutdown()) { done = true; } else { runnable.run(); } } else { synchronized (this) { checkForError(); if (queuedWork == 0) { done = true; } else { try { this.wait(); } catch (InterruptedException e) { //ignore } } } } } int toFinish = this.getRunningThreadCount(); for(int i=0;i<toFinish-1;i++) { queue.add(new ShutdownRunnable()); } joinOtherThreads(); } private void joinOtherThreads() { if (this.executorRunnables != null) { for(int i=0;i<this.executorRunnables.length;i++) { try { this.executorRunnables[i].get(); } catch (InterruptedException e) { i--; // ignore the exception and wait for this thread again. } catch (ExecutionException e) { throw new RuntimeException(e); } checkForError(); } } } private interface QueueRunnable extends Runnable, Comparable { public boolean mustShutdown(); public Map getInheritedState(); } private class ErrorCatchingRunnable implements QueueRunnable { private Runnable runnable; private Map inheritedState; public ErrorCatchingRunnable(Runnable runnable) { this.runnable = runnable; this.inheritedState = ThreadLocalRegistry.getInstance().getLocalStateCopy(); } public int compareTo(Object o) { return o instanceof ErrorCatchingRunnable ? comparator.compare(this.runnable, ((ErrorCatchingRunnable) o).runnable) : -1; } public boolean mustShutdown() { return hasError(); } public Map getInheritedState() { return inheritedState; } public void run() { try { runnable.run(); decrementQueuedWork(); } catch(Throwable t) { logger.error("error while running job.", t); setError(t); } } } private static class ShutdownRunnable implements QueueRunnable { public boolean mustShutdown() { return true; } public int compareTo(Object o) { return o instanceof ShutdownRunnable ? 0 : 1; } public Map getInheritedState() { return null; } public void run() { // nothing to do } } private class ExecutorRunnable implements Runnable { @Override public void run() { boolean done = hasError(); while(!done) { QueueRunnable runnable = null; try { runnable = (QueueRunnable) queue.poll(100, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { //ignore } if (runnable != null) { if (runnable.mustShutdown()) { done = true; } else { ThreadLocalRegistry.getInstance().setLocalState(runnable.getInheritedState()); try { runnable.run(); } finally { ThreadLocalRegistry.getInstance().clearAllInstancesForThread(); } } } done |= hasError(); } } } }
Underwater Commercial Photography Water, water everywhere but not a drop on our cameras! – Underwater Commercial Photography with a difference! Last week we returned to the fabulous Aquatheatre in Bourne. www.aquatheatre.co.uk. The owners of the Aquatheatre recommended us as an Underwater Commercial Photographer to their client Obart Pumps. They had requested exceptional quality under water images of submersible pumps. Their plan was to drop them into the tank with us capturing them as they broke the water surface. The images would then be blown up to create an impressive 10 x 3 meter conference stand backdrop. And if you look at the mock up of that finished stand below, I think we can proudly say that it is going to help them stand out from their competitors! The Aquatheatre is the UK’s largest portable tank with all round visibility. It enables us to shoot underwater commercial photography, whilst keeping our cameras dry and safe on the outside. This in turn means that we can go all out and use our very best commercial photography equipment on jobs like these. We took our Phase One XF camera with IQ250 digital back, which delivers 50 mega pixel images that enable us to maintain quality even when printed at large sizes like these. The camera was also tethered to a 27” Eizo colour calibrated monitor, so our client could view all of the photographs in real time as they were taken. We could therefore be sure that we had the shot before moving on to the next. Every day has it’s challenges and at this occasion a purpose built rig had to be made in order to control the heavy pumps as they dropped into the water. There are so many different kinds of shoots we could create in the Aquatheatre. One of our clients is thinking about setting their drum kit, complete with drummer. However, the tank is also ideal for Fashion Photography and Editorial Photography. Infant, the possibilities are endless. So if you feel inspired and would like to find out more about underwater commercial photography then why not send us an email or give us a call. Let us know all your crazy ideas so that we can help you make them happen! Contact Uniquecapture Search Our Site DOWNLOAD OUR OFFICIAL 2016 PORTFOLIO Our new commercial portfolio for 2016 has arrived hot off the press and now you can download a copy in PDF COOKIES Pardon Our Crumbs This website uses cookies to ensure that your visit is as awesome as possible and to keep everything working the way it should. You signify your acceptance of our cookies policy by your continued use of the site. OFFERS Give us a “Like”, And We’ll Give You a Free Packshot hidden beneth the panel below is a very special voucher that will entitle you to sample our commercial photographic services for free. Simply share this site to unlock the hidden section and then click on the voucher revealed to download
Departments Mayor Pro-tem, Jimmy Linens Mayor Pro Tem Jimmy Linens was re-elected by the citizens of Graham to serve on the City Council in 2013. In addition, he was reappointed to serve as Mayor Pro Tem by the City Council in 2013. Mayor Pro Tem Linens has lived in Graham for over 40 years and graduated from Graham High School in 1961 and attended Alamance Community College. Mayor Pro Tem Linens worked at Burlington Industries for almost 10 years, then Kayser-Roth as a purchasing agent for 10 years and was a self-employed Nationwide Insurance Agent for 30 years until retiring on December 31, 2008. Mayor Pro Tem Linens has been married for 51 years to Millicent Basden Linens and has 3 daughters; Meagan Long, Deanna Wyatt and Sharon Wyatt; and has 7 grandchildren. Mayor Pro Tem Linens loves being with his family and working in the yard and garden. He is a lifetime member of First United Methodist Church of Graham and is a member of the Graham Optimist Club. QuickLinks Welcome to Graham, North Carolina Welcome to the official website of Graham, North Carolina, the county seat of Alamance County. Graham is located in the Carolina Corridor, where major interstates 85 (north and south) and 40 (east and west) intersect, linking two of the fastest growing metropolitan areas on the east coast. Graham offers a high quality of life while maintaining a small town atmosphere. We hope you enjoy using our website, and find it useful as you explore things to do, the town’s services, departments and our rich history. Please check back often, as our website is always growing to serve our residents and visitors. Thanks for stopping by!
/****************************************************************************** This source file is part of the Avogadro project. Copyright 2013 Kitware, Inc. Adapted from Avogadro 1.x with the following authors' permission: Copyright (C) 2007 by Shahzad Ali Copyright (C) 2007 by Ross Braithwaite Copyright (C) 2007 by James Bunt Copyright (C) 2007,2008 by Marcus D. Hanwell Copyright (C) 2006,2007 by Benoit Jacob This source code is released under the New BSD License, (the "License"). Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ******************************************************************************/ #include "bondcentrictool.h" #include <avogadro/qtopengl/glwidget.h> #include <avogadro/rendering/geometrynode.h> #include <avogadro/rendering/glrenderer.h> #include <avogadro/rendering/groupnode.h> #include <avogadro/rendering/linestripgeometry.h> #include <avogadro/rendering/meshgeometry.h> #include <avogadro/rendering/textlabel3d.h> #include <avogadro/rendering/textproperties.h> #include <avogadro/core/array.h> #include <avogadro/core/atom.h> #include <avogadro/core/elements.h> #include <avogadro/core/vector.h> #include <avogadro/qtgui/molecule.h> #include <avogadro/qtgui/rwmolecule.h> #include <QtGui/QIcon> #include <QtGui/QMouseEvent> #include <QtWidgets/QAction> #include <Eigen/Geometry> #include <cmath> #ifndef M_PI #define M_PI 3.14159265358979323846 #endif namespace Avogadro { namespace QtPlugins { using Core::Array; using Core::Elements; using QtGui::Molecule; using QtGui::RWAtom; using QtGui::RWBond; using QtGui::RWMolecule; using Rendering::GeometryNode; using Rendering::GroupNode; using Rendering::Identifier; using Rendering::LineStripGeometry; using Rendering::MeshGeometry; namespace { const std::string degreeString("°"); /// @todo Add wide character support to text renderer. const std::string angstromString("Å"); // Lookup for coloring bond angles: const Vector3ub& getColor(size_t i) { static std::vector<Vector3ub> colors; if (colors.empty()) { colors.push_back(Vector3ub(255, 64, 32)); colors.push_back(Vector3ub(64, 255, 32)); colors.push_back(Vector3ub(32, 64, 255)); colors.push_back(Vector3ub(255, 255, 32)); colors.push_back(Vector3ub(255, 32, 255)); colors.push_back(Vector3ub(32, 255, 255)); colors.push_back(Vector3ub(255, 128, 0)); colors.push_back(Vector3ub(128, 255, 0)); colors.push_back(Vector3ub(0, 255, 128)); colors.push_back(Vector3ub(0, 128, 255)); colors.push_back(Vector3ub(255, 0, 128)); colors.push_back(Vector3ub(128, 0, 255)); } return colors[i % colors.size()]; } // Returns unsigned, smallest angle between v1 and v2 inline float vectorAngleDegrees(const Vector3f& v1, const Vector3f& v2) { const float crossProductNorm(v1.cross(v2).norm()); const float dotProduct(v1.dot(v2)); return std::atan2(crossProductNorm, dotProduct) * RAD_TO_DEG_F; } // Returns signed, smallest angle between v1 and v2. Sign is determined from a // right hand rule around axis. inline float vectorAngleDegrees(const Vector3f& v1, const Vector3f& v2, const Vector3f& axis) { const Vector3f crossProduct(v1.cross(v2)); const float crossProductNorm(crossProduct.norm()); const float dotProduct(v1.dot(v2)); const float signDet(crossProduct.dot(axis)); const float angle(std::atan2(crossProductNorm, dotProduct) * RAD_TO_DEG_F); return signDet > 0.f ? angle : -angle; } // Convenience quad drawable: class Quad : public MeshGeometry { public: Quad() {} ~Quad() override {} /** * @brief setQuad Set the four corners of the quad. */ void setQuad(const Vector3f& topLeft, const Vector3f& topRight, const Vector3f& bottomLeft, const Vector3f& bottomRight); }; void Quad::setQuad(const Vector3f& topLeft, const Vector3f& topRight, const Vector3f& bottomLeft, const Vector3f& bottomRight) { const Vector3f bottom = bottomRight - bottomLeft; const Vector3f left = topLeft - bottomLeft; const Vector3f normal = bottom.cross(left).normalized(); Array<Vector3f> norms(4, normal); Array<Vector3f> verts(4); verts[0] = topLeft; verts[1] = topRight; verts[2] = bottomLeft; verts[3] = bottomRight; Array<unsigned int> indices(6); indices[0] = 0; indices[1] = 1; indices[2] = 2; indices[3] = 2; indices[4] = 1; indices[5] = 3; clear(); addVertices(verts, norms); addTriangles(indices); } // Convenience arc sector drawable: class ArcSector : public MeshGeometry { public: ArcSector() {} ~ArcSector() override {} /** * Define the sector. * @param origin Center of the circle from which the arc is cut. * @param startEdge A vector defining an leading edge of the sector. The * direction is used to fix the sector's rotation about the origin, and the * length defines the radius of the sector. * @param normal The normal direction to the plane of the sector. * @param degreesCCW The extent of the sector, measured counter-clockwise from * startEdge in degrees. * @param resolutionDeg The radial width of each triangle used in the sector * approximation in degrees. This will be adjusted to fit an integral number * of triangles in the sector. Smaller triangles (better approximations) are * chosen if adjustment is needed. */ void setArcSector(const Vector3f& origin, const Vector3f& startEdge, const Vector3f& normal, float degreesCCW, float resolutionDeg); }; void ArcSector::setArcSector(const Vector3f& origin, const Vector3f& startEdge, const Vector3f& normal, float degreesCCW, float resolutionDeg) { // Prepare rotation, calculate sizes const unsigned int numTriangles = static_cast<unsigned int>(std::fabs(std::ceil(degreesCCW / resolutionDeg))); const size_t numVerts = static_cast<size_t>(numTriangles + 2); const float stepAngleRads = (degreesCCW / static_cast<float>(numTriangles)) * DEG_TO_RAD_F; const Eigen::AngleAxisf rot(stepAngleRads, normal); // Generate normal array Array<Vector3f> norms(numVerts, normal); // Generate vertices Array<Vector3f> verts(numVerts); Array<Vector3f>::iterator vertsInserter(verts.begin()); Array<Vector3f>::iterator vertsEnd(verts.end()); Vector3f radial = startEdge; *(vertsInserter++) = origin; *(vertsInserter++) = origin + radial; while (vertsInserter != vertsEnd) *(vertsInserter++) = origin + (radial = rot * radial); // Generate indices Array<unsigned int> indices(numTriangles * 3); Array<unsigned int>::iterator indexInserter(indices.begin()); Array<unsigned int>::iterator indexEnd(indices.end()); for (unsigned int i = 1; indexInserter != indexEnd; ++i) { *(indexInserter++) = 0; *(indexInserter++) = i; *(indexInserter++) = i + 1; } clear(); addVertices(verts, norms); addTriangles(indices); } // Convenience quad outline drawable: class QuadOutline : public LineStripGeometry { public: QuadOutline() {} ~QuadOutline() override {} /** * @brief setQuad Set the four corners of the quad. */ void setQuad(const Vector3f& topLeft, const Vector3f& topRight, const Vector3f& bottomLeft, const Vector3f& bottomRight, float lineWidth); }; void QuadOutline::setQuad(const Vector3f& topLeft, const Vector3f& topRight, const Vector3f& bottomLeft, const Vector3f& bottomRight, float lineWidth) { Array<Vector3f> verts(5); verts[0] = topLeft; verts[1] = topRight; verts[2] = bottomRight; verts[3] = bottomLeft; verts[4] = topLeft; clear(); addLineStrip(verts, lineWidth); } // Convenience arc drawable: class ArcStrip : public LineStripGeometry { public: ArcStrip() {} ~ArcStrip() override {} /** * Define the arc. * @param origin Center of the circle from which the arc is cut. * @param start A vector pointing from the origin to the start of the arc. * @param normal The normal direction to the plane of the circle. * @param degreesCCW The extent of the arc, measured counter-clockwise from * start in degrees. * @param resolutionDeg The radial width of each segment used in the arc * approximation, in degrees. This will be adjusted to fit an integral number * of segments into the arc. Smaller segments (better approximations) are * chosen if adjustment is needed. * @param lineWidth The width of the line. */ void setArc(const Vector3f& origin, const Vector3f& start, const Vector3f& normal, float degreesCCW, float resolutionDeg, float lineWidth); }; void ArcStrip::setArc(const Vector3f& origin, const Vector3f& start, const Vector3f& normal, float degreesCCW, float resolutionDeg, float lineWidth) { // Prepare rotation, calculate sizes const unsigned int resolution = static_cast<unsigned int>(std::fabs(std::ceil(degreesCCW / resolutionDeg))); const size_t numVerts = static_cast<size_t>(resolution + 1); const float stepAngleRads = (degreesCCW / static_cast<float>(resolution)) * DEG_TO_RAD_F; const Eigen::AngleAxisf rot(stepAngleRads, normal); // Generate vertices Array<Vector3f> verts(numVerts); Array<Vector3f>::iterator vertsInserter(verts.begin()); Array<Vector3f>::iterator vertsEnd(verts.end()); Vector3f radial = start; *(vertsInserter++) = origin + radial; while (vertsInserter != vertsEnd) *(vertsInserter++) = origin + (radial = rot * radial); clear(); addLineStrip(verts, lineWidth); } } // end anon namespace BondCentricTool::BondCentricTool(QObject* parent_) : QtGui::ToolPlugin(parent_) , m_activateAction(new QAction(this)) , m_molecule(nullptr) , m_renderer(nullptr) , m_moveState(IgnoreMove) , m_planeSnapIncr(10.f) , m_snapPlaneToBonds(true) { m_activateAction->setText(tr("Bond-centric manipulation")); m_activateAction->setIcon(QIcon(":/icons/bondcentrictool.png")); } BondCentricTool::~BondCentricTool() {} QWidget* BondCentricTool::toolWidget() const { return nullptr; } void BondCentricTool::setMolecule(QtGui::Molecule* mol) { if (mol && mol->undoMolecule() != m_molecule) { m_molecule = mol->undoMolecule(); reset(); } } void BondCentricTool::setEditMolecule(QtGui::RWMolecule* mol) { if (m_molecule != mol) { m_molecule = mol; reset(); } } void BondCentricTool::setGLWidget(QtOpenGL::GLWidget*) {} void BondCentricTool::setGLRenderer(Rendering::GLRenderer* ren) { m_renderer = ren; } QUndoCommand* BondCentricTool::mousePressEvent(QMouseEvent* e) { // Don't start a new operation if we're already working: if (m_moveState != IgnoreMove) return nullptr; Rendering::Identifier ident = m_renderer->hit(e->pos().x(), e->pos().y()); // If no hits, return. Also ensure that the hit molecule is the one we expect. const Core::Molecule* mol = &m_molecule->molecule(); if (!ident.isValid() || ident.molecule != mol) return nullptr; // If the hit is a left click on a bond, make it the selected bond and map // mouse movements to the bond plane rotation. if (ident.type == Rendering::BondType && e->button() == Qt::LeftButton) return initRotatePlane(e, ident); // Return if selectedBond is not valid or the hit is not on a bond: if (!m_selectedBond.isValid() || ident.type != Rendering::AtomType) return nullptr; // Test if the atom is in the selected bond, or one bond removed. RWAtom clickedAtom = m_molecule->atom(ident.index); RWBond selectedBond = m_selectedBond.bond(); bool atomIsInBond = bondContainsAtom(selectedBond, clickedAtom); bool atomIsNearBond = false; RWAtom anchorAtom; if (!atomIsInBond) { Array<RWBond> bonds = m_molecule->bonds(clickedAtom); for (Array<RWBond>::const_iterator it = bonds.begin(), itEnd = bonds.end(); it != itEnd; ++it) { RWAtom atom = otherBondedAtom(*it, clickedAtom); if (bondContainsAtom(selectedBond, atom)) { anchorAtom = atom; atomIsNearBond = true; break; } } } if (!atomIsInBond && !atomIsNearBond) return nullptr; if (m_molecule) { m_molecule->setInteractive(true); } // If the hit is a left click on an atom in the selected bond, prepare to // rotate the clicked bond around the other atom in the bond. if (atomIsInBond && e->button() == Qt::LeftButton) return initRotateBondedAtom(e, clickedAtom); // If the hit is a right click on an atom in the selected bond, prepare to // change the bond length. if (atomIsInBond && e->button() == Qt::RightButton) return initAdjustBondLength(e, clickedAtom); // Is the hit a left click on an atom bonded to an atom in selectedBond? if (atomIsNearBond && (e->button() == Qt::LeftButton || e->button() == Qt::RightButton)) { return initRotateNeighborAtom(e, clickedAtom, anchorAtom); } return nullptr; } QUndoCommand* BondCentricTool::mouseDoubleClickEvent(QMouseEvent* e) { if (m_selectedBond.isValid() && e->button() == Qt::LeftButton) { reset(); emit drawablesChanged(); } return nullptr; } QUndoCommand* BondCentricTool::mouseMoveEvent(QMouseEvent* e) { if (m_moveState == IgnoreMove) return nullptr; QUndoCommand* result = nullptr; switch (m_moveState) { case RotatePlane: result = rotatePlane(e); break; case RotateBondedAtom: result = rotateBondedAtom(e); break; case AdjustBondLength: result = adjustBondLength(e); break; case RotateNeighborAtom: result = rotateNeighborAtom(e); break; default: break; } return result; } QUndoCommand* BondCentricTool::mouseReleaseEvent(QMouseEvent*) { if (m_moveState != IgnoreMove) { reset(KeepBond); emit drawablesChanged(); if (m_molecule) { m_molecule->setInteractive(false); // allow an undo now } } return nullptr; } void BondCentricTool::draw(Rendering::GroupNode& node) { RWBond selectedBond = m_selectedBond.bond(); if (!selectedBond.isValid()) return; GeometryNode* geo = new GeometryNode; node.addChild(geo); switch (m_moveState) { default: case IgnoreMove: case RotatePlane: drawBondQuad(*geo, selectedBond); drawAtomBondAngles(*geo, selectedBond.atom1(), selectedBond); drawAtomBondAngles(*geo, selectedBond.atom2(), selectedBond); break; case RotateBondedAtom: { drawBondQuad(*geo, selectedBond); RWAtom otherAtom = otherBondedAtom(selectedBond, m_clickedAtom.atom()); if (otherAtom.isValid()) { drawAtomBondAngles(*geo, otherAtom, selectedBond); } break; } case AdjustBondLength: drawBondQuad(*geo, selectedBond); drawBondLengthLabel(*geo, selectedBond); break; case RotateNeighborAtom: { RWAtom clickedAtom = m_clickedAtom.atom(); RWAtom anchorAtom = m_anchorAtom.atom(); RWBond otherBond = m_molecule->bond(clickedAtom, anchorAtom); if (otherBond.isValid()) drawBondAngle(*geo, selectedBond, otherBond); break; } } } void BondCentricTool::reset(BondCentricTool::ResetBondBehavior bond) { if (bond == ResetBond) m_selectedBond.reset(); m_clickedAtom.reset(); m_anchorAtom.reset(); m_moveState = IgnoreMove; m_clickedPoint = QPoint(); } void BondCentricTool::initializeBondVectors() { RWBond bond = m_selectedBond.bond(); if (bond.isValid()) { m_bondVector = (bond.atom2().position3d().cast<float>() - bond.atom1().position3d().cast<float>()) .normalized(); m_planeNormalMouse = m_bondVector.unitOrthogonal(); } } void BondCentricTool::updateBondVector() { RWBond bond = m_selectedBond.bond(); if (bond.isValid()) { m_bondVector = (bond.atom2().position3d().cast<float>() - bond.atom1().position3d().cast<float>()) .normalized(); } } QUndoCommand* BondCentricTool::initRotatePlane( QMouseEvent* e, const Rendering::Identifier& ident) { RWBond selectedBond = m_molecule->bond(ident.index); // Get unique id: Index bondUniqueId = m_molecule->bondUniqueId(selectedBond); if (bondUniqueId == MaxIndex) return nullptr; // Something went horribly wrong. // Reset the bond vector/plane normal if the bond changed if (bondUniqueId != m_selectedBond.uniqueIdentifier()) { m_selectedBond = QtGui::RWMolecule::PersistentBondType(m_molecule, bondUniqueId); initializeBondVectors(); } updatePlaneSnapAngles(); updateSnappedPlaneNormal(); if (!m_selectedBond.isValid()) return nullptr; e->accept(); m_moveState = RotatePlane; m_clickedPoint = e->pos(); m_lastDragPoint = e->pos(); emit drawablesChanged(); return nullptr; } QUndoCommand* BondCentricTool::initRotateBondedAtom( QMouseEvent* e, const QtGui::RWAtom& clickedAtom) { m_clickedAtom = RWMolecule::PersistentAtomType(clickedAtom); if (!m_clickedAtom.isValid()) return nullptr; e->accept(); m_moveState = RotateBondedAtom; m_clickedPoint = e->pos(); m_lastDragPoint = e->pos(); resetFragment(); emit drawablesChanged(); return nullptr; } QUndoCommand* BondCentricTool::initAdjustBondLength( QMouseEvent* e, const QtGui::RWAtom& clickedAtom) { m_clickedAtom = RWMolecule::PersistentAtomType(clickedAtom); if (!m_clickedAtom.isValid()) return nullptr; e->accept(); m_moveState = AdjustBondLength; m_clickedPoint = e->pos(); m_lastDragPoint = e->pos(); resetFragment(); emit drawablesChanged(); return nullptr; } QUndoCommand* BondCentricTool::initRotateNeighborAtom( QMouseEvent* e, const QtGui::RWAtom& clickedAtom, const QtGui::RWAtom& anchorAtom) { m_clickedAtom = RWMolecule::PersistentAtomType(clickedAtom); m_anchorAtom = RWMolecule::PersistentAtomType(anchorAtom); if (!m_clickedAtom.isValid() || !m_anchorAtom.isValid()) return nullptr; e->accept(); m_moveState = RotateNeighborAtom; m_clickedPoint = e->pos(); m_lastDragPoint = e->pos(); resetFragment(); emit drawablesChanged(); return nullptr; } QUndoCommand* BondCentricTool::rotatePlane(QMouseEvent* e) { // The bond should be valid. const RWBond selectedBond = m_selectedBond.bond(); if (!selectedBond.isValid()) return nullptr; const QPoint deltaDrag = e->pos() - m_lastDragPoint; const Rendering::Camera& camera(m_renderer->camera()); // Atomic position in world coordinates const Vector3 beginPos(selectedBond.atom1().position3d()); const Vector3 endPos(selectedBond.atom2().position3d()); // Various quantities in window coordinates. const Vector3f beginWin(camera.project(beginPos.cast<float>())); const Vector3f endWin(camera.project(endPos.cast<float>())); Vector3f bondVecWin(endWin - beginWin); bondVecWin.z() = 0.f; // Points into the viewing volume from camera: const Vector3f zAxisWin(0.f, 0.f, 1.f); // In plane of screen, orthogonal to bond: const Vector3f orthoWin(zAxisWin.cross(bondVecWin).normalized()); const Vector3f dragWin(static_cast<float>(deltaDrag.x()), static_cast<float>(deltaDrag.y()), 0.f); // Compute the rotation. Not quite sure what's going on here, this is just // ported from Avogadro 1. It doesn't seem right that rotation would be in // degrees (it's the result of a dot product) and I think the fact that the // DEG_TO_RAD conversion results in a useful angle is just a happy // coincidence. But it works quite well. const float rotation = dragWin.dot(orthoWin) / orthoWin.norm(); const Eigen::AngleAxisf rotator(rotation * DEG_TO_RAD_F, m_bondVector); // Rotate m_planeNormalMouse = rotator * m_planeNormalMouse; updateSnappedPlaneNormal(); emit drawablesChanged(); m_lastDragPoint = e->pos(); return nullptr; } QUndoCommand* BondCentricTool::rotateBondedAtom(QMouseEvent* e) { // Ensure that the mouse has moved a reasonable amount: if ((m_lastDragPoint - e->pos()).manhattanLength() < 2) return nullptr; RWBond bond = m_selectedBond.bond(); RWAtom clickedAtom = m_clickedAtom.atom(); RWAtom centerAtom = otherBondedAtom(bond, clickedAtom); // Sanity check: if (!bond.isValid() || !clickedAtom.isValid() || !centerAtom.isValid()) return nullptr; // Compute the transformation: // - Rotation axis is m_planeNormal // - Rotation angle is: // - magnitude is angle between initial click and current pos around // center atom (performed in 2D). // - sign is based on whether m_planeNormal is pointing into/out of the // screen. const Rendering::Camera& camera(m_renderer->camera()); // Get the window coordinates of the relevant points const Vector3f centerPos(centerAtom.position3d().cast<float>()); const Vector3f centerWin(camera.project(centerPos)); const Vector2f centerWin2(centerWin.head<2>()); const Vector2f lastDragWin( static_cast<float>(m_lastDragPoint.x()), static_cast<float>(camera.height() - m_lastDragPoint.y())); const Vector2f dragWin(static_cast<float>(e->pos().x()), static_cast<float>(camera.height() - e->pos().y())); // Compute the angle between last drag and current drag positions const Vector2f lastDragWinVec((lastDragWin - centerWin2).normalized()); const Vector2f dragWinVec((dragWin - centerWin2).normalized()); const float crossProductNorm(lastDragWinVec.x() * dragWinVec.y() - lastDragWinVec.y() * dragWinVec.x()); const float dotProduct(lastDragWinVec.dot(dragWinVec)); const float angle(std::atan2(crossProductNorm, dotProduct)); // Figure out if the sign needs to be reversed: const Vector3f centerPlusNormal(centerPos + m_planeNormal); const Vector3f centerPlusNormalWin(camera.project(centerPlusNormal)); bool reverseSign = (centerPlusNormalWin.z() - centerWin.z()) >= 0; // Build transform m_transform.setIdentity(); m_transform.translate(centerPos); m_transform.rotate( Eigen::AngleAxisf(reverseSign ? -angle : angle, m_planeNormal)); m_transform.translate(-centerPos); // Build the fragment if needed: if (m_fragment.empty()) buildFragment(bond, clickedAtom); // Perform transformation transformFragment(); updateBondVector(); m_molecule->emitChanged(Molecule::Modified | Molecule::Atoms); emit drawablesChanged(); m_lastDragPoint = e->pos(); return nullptr; } QUndoCommand* BondCentricTool::adjustBondLength(QMouseEvent* e) { // Ensure that the mouse has moved a reasonable amount: if ((m_lastDragPoint - e->pos()).manhattanLength() < 2) return nullptr; RWBond selectedBond = m_selectedBond.bond(); RWAtom clickedAtom = m_clickedAtom.atom(); // Sanity check: if (!selectedBond.isValid() || !clickedAtom.isValid()) return nullptr; const Rendering::Camera& camera(m_renderer->camera()); RWAtom otherAtom = otherBondedAtom(selectedBond, clickedAtom); const Vector2f curPosWin(static_cast<float>(e->pos().x()), static_cast<float>(e->pos().y())); const Vector2f lastPosWin(static_cast<float>(m_lastDragPoint.x()), static_cast<float>(m_lastDragPoint.y())); const Vector3f bond(clickedAtom.position3d().cast<float>() - otherAtom.position3d().cast<float>()); const Vector3f mouse(camera.unProject(curPosWin) - camera.unProject(lastPosWin)); const Vector3f displacement((mouse.dot(bond) / bond.squaredNorm()) * bond); // Build transform m_transform.setIdentity(); m_transform.translate(displacement); // Build the fragment if needed: if (m_fragment.empty()) buildFragment(selectedBond, clickedAtom); // Perform transformation transformFragment(); m_molecule->emitChanged(QtGui::Molecule::Modified | QtGui::Molecule::Atoms); emit drawablesChanged(); m_lastDragPoint = e->pos(); return nullptr; } QUndoCommand* BondCentricTool::rotateNeighborAtom(QMouseEvent* e) { // Ensure that the mouse has moved a reasonable amount: if ((m_lastDragPoint - e->pos()).manhattanLength() < 2) return nullptr; RWBond selectedBond = m_selectedBond.bond(); // Atom that was clicked RWAtom clickedAtom = m_clickedAtom.atom(); // Atom in selected bond also attached to clickedAtom RWAtom anchorAtom = m_anchorAtom.atom(); // The "other" atom in selected bond RWAtom otherAtom = otherBondedAtom(selectedBond, anchorAtom); // Sanity check: if (!selectedBond.isValid() || !anchorAtom.isValid() || !otherAtom.isValid() || !clickedAtom.isValid()) { return nullptr; } const Rendering::Camera& camera(m_renderer->camera()); // Compute the angle between last drag and current drag positions const Vector3f center(anchorAtom.position3d().cast<float>()); const Vector3f centerProj(camera.project(center)); const Vector2f centerWin(centerProj.head<2>()); const Vector2f curWin(static_cast<float>(e->pos().x()), static_cast<float>(camera.height() - e->pos().y())); const Vector2f lastWin( static_cast<float>(m_lastDragPoint.x()), static_cast<float>(camera.height() - m_lastDragPoint.y())); const Vector2f curVecWin((curWin - centerWin).normalized()); const Vector2f lastVecWin((lastWin - centerWin).normalized()); const float crossProductNorm(lastVecWin.x() * curVecWin.y() - lastVecWin.y() * curVecWin.x()); const float dotProduct(lastVecWin.dot(curVecWin)); const float angle(std::atan2(crossProductNorm, dotProduct)); // Figure out if the sign needs to be reversed: const Vector3f other(otherAtom.position3d().cast<float>()); const Vector3f otherProj(camera.project(other)); const bool reverseSign = otherProj.z() <= centerProj.z(); // Axis of rotation const Vector3f axis((center - other).normalized()); // Build transform m_transform.setIdentity(); m_transform.translate(center); m_transform.rotate(Eigen::AngleAxisf(reverseSign ? -angle : angle, axis)); m_transform.translate(-center); // Build the fragment if needed: if (m_fragment.empty()) buildFragment(selectedBond, anchorAtom); // Perform transformation transformFragment(); updateBondVector(); m_molecule->emitChanged(QtGui::Molecule::Modified | QtGui::Molecule::Atoms); emit drawablesChanged(); m_lastDragPoint = e->pos(); return nullptr; } void BondCentricTool::drawBondQuad(Rendering::GeometryNode& node, const RWBond& bond) const { const Vector3f atom1Pos(bond.atom1().position3d().cast<float>()); const Vector3f atom2Pos(bond.atom2().position3d().cast<float>()); Vector3f offset(m_bondVector.cross(m_planeNormal)); const Vector3f v1(atom1Pos + offset); const Vector3f v2(atom2Pos + offset); const Vector3f v3(atom1Pos - offset); const Vector3f v4(atom2Pos - offset); Quad* quad = new Quad; node.addDrawable(quad); quad->setColor(Vector3ub(63, 127, 255)); quad->setOpacity(127); quad->setRenderPass(Rendering::TranslucentPass); quad->setQuad(v1, v2, v3, v4); QuadOutline* quadOutline = new QuadOutline; node.addDrawable(quadOutline); quadOutline->setColor(Vector3ub(63, 127, 255)); quadOutline->setRenderPass(Rendering::OpaquePass); quadOutline->setQuad(v1, v2, v3, v4, 1.f); // If the plane is rotating, show a hint for the unsnapped plane. if (m_moveState == RotatePlane) { Vector3f moffset(m_bondVector.cross(m_planeNormalMouse)); const Vector3f mv1(atom1Pos + moffset); const Vector3f mv2(atom2Pos + moffset); const Vector3f mv3(atom1Pos - moffset); const Vector3f mv4(atom2Pos - moffset); QuadOutline* mouseQuadOutline = new QuadOutline; node.addDrawable(mouseQuadOutline); mouseQuadOutline->setColor(Vector3ub(255, 255, 255)); mouseQuadOutline->setOpacity(127); mouseQuadOutline->setRenderPass(Rendering::TranslucentPass); mouseQuadOutline->setQuad(mv1, mv2, mv3, mv4, 1.f); } } void BondCentricTool::drawBondAngle(Rendering::GeometryNode& node, const QtGui::RWBond& selectedBond, const QtGui::RWBond& movingBond) const { // Draw the selected bond quad as usual drawBondQuad(node, selectedBond); // Determine the atom shared between the bonds (atom1). RWAtom atom1; RWAtom atom2; if (selectedBond.atom1() == movingBond.atom1() || selectedBond.atom2() == movingBond.atom1()) { atom1 = movingBond.atom1(); atom2 = movingBond.atom2(); } else if (selectedBond.atom1() == movingBond.atom2() || selectedBond.atom2() == movingBond.atom2()) { atom1 = movingBond.atom2(); atom2 = movingBond.atom1(); } if (!atom1.isValid()) return; // Add another quad in the plane normal to // m_bondVector.cross(movingBondVector) const Vector3f a1(atom1.position3d().cast<float>()); const Vector3f a2(atom2.position3d().cast<float>()); const Vector3f movingBondVector(a2 - a1); const Vector3f movingBondUnitVector(movingBondVector.normalized()); // calculate a vector in the plane spanned by movingBondVector and // m_bondVector that is orthogonal to m_bondVector, then project // movingBondVector onto it. This is used to calculate the 'new' a2. const Vector3f movingBondNormal(m_bondVector.cross(movingBondUnitVector)); const Vector3f newA2Direction(movingBondNormal.cross(m_bondVector)); const Vector3f movingBondVectorProj(movingBondVector.dot(newA2Direction) * newA2Direction); const Vector3f newA2(a1 + movingBondVectorProj); const Vector3f& movingBondOffset(m_bondVector); const Vector3f v1(a1 + movingBondOffset); const Vector3f v2(newA2 + movingBondOffset); const Vector3f v3(a1 - movingBondOffset); const Vector3f v4(newA2 - movingBondOffset); Quad* quad = new Quad; node.addDrawable(quad); quad->setColor(Vector3ub(63, 127, 255)); quad->setOpacity(127); quad->setRenderPass(Rendering::TranslucentPass); quad->setQuad(v1, v2, v3, v4); QuadOutline* quadOutline = new QuadOutline; node.addDrawable(quadOutline); quadOutline->setColor(Vector3ub(63, 127, 255)); quadOutline->setRenderPass(Rendering::OpaquePass); quadOutline->setQuad(v1, v2, v3, v4, 1.f); // Add an arc and label to show a bit more info: const Vector3f selectedBondOffset(m_planeNormal.cross(m_bondVector)); const float radius(movingBondVector.norm() * 0.75f); Vector3f startEdge(newA2Direction * radius); Vector3f normal(m_bondVector); float angle = vectorAngleDegrees(startEdge, selectedBondOffset, normal); float displayAngle = std::fabs(angle); ArcSector* sect = new ArcSector; node.addDrawable(sect); sect->setColor(Vector3ub(255, 127, 63)); sect->setOpacity(127); sect->setRenderPass(Rendering::TranslucentPass); sect->setArcSector(a1, startEdge, normal, angle, 5.f); ArcStrip* arc = new ArcStrip; node.addDrawable(arc); arc->setColor(Vector3ub(255, 127, 63)); arc->setRenderPass(Rendering::OpaquePass); arc->setArc(a1, startEdge, normal, angle, 5.f, 1.f); const Vector3f& textPos(a1); Rendering::TextLabel3D* label = new Rendering::TextLabel3D; label->setText(QString::number(displayAngle, 'f', 1).toStdString() + degreeString); label->setRenderPass(Rendering::Overlay3DPass); label->setAnchor(textPos); node.addDrawable(label); Rendering::TextProperties tprop; tprop.setAlign(Rendering::TextProperties::HCenter, Rendering::TextProperties::VCenter); tprop.setFontFamily(Rendering::TextProperties::SansSerif); tprop.setColorRgb(255, 200, 64); label->setTextProperties(tprop); } void BondCentricTool::drawBondLengthLabel(Rendering::GeometryNode& node, const QtGui::RWBond& bond) { const Vector3f startPos(bond.atom1().position3d().cast<float>()); const Vector3f endPos(bond.atom2().position3d().cast<float>()); const Vector3f bondCenter((startPos + endPos) * 0.5f); const Vector3f bondVector(endPos - startPos); Rendering::TextLabel3D* label = new Rendering::TextLabel3D; label->setText(QString::number(bondVector.norm(), 'f', 2).toStdString() + angstromString); label->setRenderPass(Rendering::Overlay3DPass); label->setAnchor(bondCenter); node.addDrawable(label); Rendering::TextProperties tprop; tprop.setAlign(Rendering::TextProperties::HCenter, Rendering::TextProperties::VCenter); tprop.setFontFamily(Rendering::TextProperties::SansSerif); tprop.setColorRgb(255, 200, 64); label->setTextProperties(tprop); } void BondCentricTool::drawAtomBondAngles(Rendering::GeometryNode& node, const RWAtom& atom, const RWBond& anchorBond) { const Array<RWBond> bonds = m_molecule->bonds(atom); Array<RWBond>::const_iterator bondIter(bonds.begin()); Array<RWBond>::const_iterator bondEnd(bonds.end()); size_t count = 0; while (bondIter != bondEnd) { if (*bondIter != anchorBond) drawAtomBondAngle(node, atom, anchorBond, *bondIter, getColor(count++)); ++bondIter; } } void BondCentricTool::drawAtomBondAngle(Rendering::GeometryNode& node, const QtGui::RWAtom& atom, const QtGui::RWBond& anchorBond, const QtGui::RWBond& otherBond, const Vector3ub& color) { const RWAtom otherAtom = otherBondedAtom(otherBond, atom); const RWAtom otherAnchorAtom = otherBondedAtom(anchorBond, atom); const Vector3f atomPos(atom.position3d().cast<float>()); const Vector3f otherAtomPos(otherAtom.position3d().cast<float>()); const Vector3f otherAnchorAtomPos(otherAnchorAtom.position3d().cast<float>()); const Vector3f otherVector(otherAtomPos - atomPos); const Vector3f anchorVector(otherAnchorAtomPos - atomPos); const Vector3f anchorUnitVector(anchorVector.normalized()); const float radius(otherVector.norm() * 0.75f); const Vector3f& origin(atomPos); const Vector3f start(anchorUnitVector * radius); const Vector3f axis(anchorVector.cross(otherVector).normalized()); const float angle = vectorAngleDegrees(otherVector, anchorVector); const Vector3f& labelPos(otherAtomPos); ArcSector* sect = new ArcSector; node.addDrawable(sect); sect->setColor(color); sect->setOpacity(127); sect->setRenderPass(Rendering::TranslucentPass); sect->setArcSector(origin, start, axis, angle, 5.f); ArcStrip* arc = new ArcStrip; node.addDrawable(arc); arc->setColor(color); arc->setRenderPass(Rendering::OpaquePass); arc->setArc(origin, start, axis, angle, 5.f, 1.f); Rendering::TextLabel3D* label = new Rendering::TextLabel3D; label->setText(QString::number(angle, 'f', 1).toStdString() + degreeString); label->setRenderPass(Rendering::Overlay3DPass); label->setAnchor(labelPos); node.addDrawable(label); Rendering::TextProperties tprop; tprop.setAlign(Rendering::TextProperties::HCenter, Rendering::TextProperties::VCenter); tprop.setFontFamily(Rendering::TextProperties::SansSerif); tprop.setColorRgb(color); label->setTextProperties(tprop); } inline bool BondCentricTool::bondContainsAtom(const QtGui::RWBond& bond, const QtGui::RWAtom& atom) const { return atom == bond.atom1() || atom == bond.atom2(); } inline QtGui::RWAtom BondCentricTool::otherBondedAtom( const QtGui::RWBond& bond, const QtGui::RWAtom& atom) const { return bond.atom1() == atom ? bond.atom2() : bond.atom1(); } inline void BondCentricTool::transformFragment() const { // Convert the internal float matrix to use the same precision as the atomic // coordinates. Eigen::Transform<Real, 3, Eigen::Affine> transform(m_transform.cast<Real>()); for (std::vector<int>::const_iterator it = m_fragment.begin(), itEnd = m_fragment.end(); it != itEnd; ++it) { RWAtom atom = m_molecule->atomByUniqueId(*it); if (atom.isValid()) { Vector3 pos = atom.position3d(); pos = transform * pos; atom.setPosition3d(pos); } } } void BondCentricTool::updatePlaneSnapAngles() { m_planeSnapRef = m_bondVector.unitOrthogonal(); m_planeSnapAngles.clear(); // Add bond angles if requested: RWBond selectedBond = m_selectedBond.bond(); if (m_snapPlaneToBonds && selectedBond.isValid()) { const RWAtom atom1 = selectedBond.atom1(); const RWAtom atom2 = selectedBond.atom2(); for (int i = 0; i < 2; ++i) { const RWAtom& atom = i == 0 ? atom1 : atom2; const Vector3f atomPos(atom.position3d().cast<float>()); const Array<RWBond> bonds = m_molecule->bonds(atom); for (std::vector<RWBond>::const_iterator it = bonds.begin(), itEnd = bonds.end(); it != itEnd; ++it) { if (*it != selectedBond) { const RWAtom otherAtom(otherBondedAtom(*it, atom)); const Vector3f otherAtomPos(otherAtom.position3d().cast<float>()); const Vector3f otherBondVector(otherAtomPos - atomPos); // Project otherBondVector into the plane normal to m_bondVector // (e.g. the rejection of otherBondVector onto m_bondVector) const Vector3f rej( otherBondVector - (otherBondVector.dot(m_bondVector) * m_bondVector)); float angle(vectorAngleDegrees(m_planeSnapRef, rej, m_bondVector)); m_planeSnapAngles.insert(angle); angle += 180.f; if (angle > 180.f) angle -= 360.f; m_planeSnapAngles.insert(angle); } } } } // Add default increments only if they are more than 5 degrees away // from a bond angle. const float minDist(5.f); for (float angle = -180.f; angle < 180.f; angle += m_planeSnapIncr) { std::set<float>::const_iterator upper(m_planeSnapAngles.lower_bound(angle)); if (upper != m_planeSnapAngles.end()) { if (*upper - minDist < angle) continue; if (upper != m_planeSnapAngles.begin()) { std::set<float>::const_iterator lower(upper); std::advance(lower, -1); if (*lower + minDist > angle) continue; } m_planeSnapAngles.insert(angle); } } } // There may be some weirdness around +/-180 since we don't check for // wrapping, but it should be fine for this use case. void BondCentricTool::updateSnappedPlaneNormal() { const Vector3f mousePlaneVector(m_planeNormalMouse.cross(m_bondVector)); const float angle( vectorAngleDegrees(m_planeSnapRef, mousePlaneVector, m_bondVector)); float snappedAngle(angle); std::set<float>::const_iterator upper(m_planeSnapAngles.lower_bound(angle)); if (upper != m_planeSnapAngles.end()) { if (upper != m_planeSnapAngles.begin()) { std::set<float>::const_iterator lower(upper); std::advance(lower, -1); float upperDist = std::fabs(angle - *upper); float lowerDist = std::fabs(angle - *lower); snappedAngle = upperDist < lowerDist ? *upper : *lower; } else { snappedAngle = *upper; } } if (angle == snappedAngle) { // If the angle didn't change, keep on keepin' on: m_planeNormal = m_planeNormalMouse; } else { // Otherwise, update the vector. const Vector3f planeVector = Eigen::AngleAxisf(snappedAngle * DEG_TO_RAD_F, m_bondVector) * m_planeSnapRef; m_planeNormal = planeVector.cross(m_bondVector); } } inline bool BondCentricTool::fragmentHasAtom(int uid) const { return std::find(m_fragment.begin(), m_fragment.end(), uid) != m_fragment.end(); } void BondCentricTool::buildFragment(const QtGui::RWBond& bond, const QtGui::RWAtom& startAtom) { m_fragment.clear(); if (!buildFragmentRecurse(bond, startAtom, startAtom)) { // If this returns false, then a cycle has been found. Only move startAtom // in this case. m_fragment.clear(); } m_fragment.push_back(m_molecule->atomUniqueId(startAtom)); } bool BondCentricTool::buildFragmentRecurse(const QtGui::RWBond& bond, const QtGui::RWAtom& startAtom, const QtGui::RWAtom& currentAtom) { Array<RWBond> bonds = m_molecule->bonds(currentAtom); typedef std::vector<RWBond>::const_iterator BondIter; for (BondIter it = bonds.begin(), itEnd = bonds.end(); it != itEnd; ++it) { if (*it != bond) { // Skip the current bond RWAtom nextAtom = otherBondedAtom(*it, currentAtom); if (nextAtom != startAtom) { // Skip atoms that have already been added. This prevents infinite // recursion on cycles in the fragments int uid = m_molecule->atomUniqueId(nextAtom); if (!fragmentHasAtom(uid)) { m_fragment.push_back(uid); if (!buildFragmentRecurse(*it, startAtom, nextAtom)) return false; } } else { // If we've reached startAtom, then we've found a cycle that indicates // no moveable fragment exists. return false; } // nextAtom != startAtom else } // *it != bond } // foreach bond return true; } } // namespace QtPlugins } // namespace Avogadro
Much like the biopic, the road-movie genre is also a relatively new commodity in Bollywood. The Akhtar siblings, however, seem to have a predilection for it. In fact, it was Farhan Akhtar’s debut feature, Dil Chahta Hai, which arguably started the trend that has more recently spawned critically and commercially successful road-related films such as Anurag Basu’s Barfi!, Ayan Mukherjee’s Yeh Jawaani Hai Deewani, Imtiaz Ali’s Highway and Shoojit Sircar‘s Piku. In between, Akhtar’s Excel Entertainment produced two more thematically similar efforts: Reema Kagti’s debut called Honeymoon Travels Pvt. Ltd., a bus journey undertaken by six couple on their honeymoon, and the second feature by his sister Zoya, Zindagi Na Milegi Dobara, co-written by Kagti, a story of three childhood friends who set off to Spain for a bachelor trip. Zoya‘s new film, Dil Dhadakne Do (lit. trnsl. Let the Heart Beat), once again involving Excel and Kagti (in producing and writing capacities, respectively), technically isn’t set on the road but it belongs to the genre for all intents and purposes. In here, the sea replaces the road as a metaphor for life, for personal growth and change. And since it deals with the trials and tribulations of a family, the cruise ship it is set on takes on added meaning. In Zindagi Na Milegi Dobara, Zoya employed voice-over poetry written by her father, the famous screenwriter-lyricist Javed Akhtar, almost as musical stops for structural purposes. In this film, she has decided to tell the story of a dysfunctional family from the “perspective” of its pet bullmastiff, Pluto (voiced by Aamir Khan; in some ways recalling his socially inquisitive character from Rajkumar Hirani’s PK). Pluto’s narration serves as both framing device and a running commentary on the action. It’s a risky move, but the filmmakers manage to pull it off magnificently. Deeply enmeshed in the stranglehold of patriarchy and privilege, the Mehras seem quite normal on the surface. And what a surface it is—this is quite possibly the most elegantly designed film Indian cinema has produced in recent years. Although devoid of his customary geegaws, and gaudier than the rest of the proceedings, the gorgeous promotional video of the title track even faintly echoes Wes Anderson’s The Life Aquatic with Steve Zissou, another road movie set in the sea. Speaking of which, the family’s patriarch, Kamal Mehra (Kapoor), is nearly as much of a prick as Bill Murray’s Zissou. But just as Anderson did in his movie, Zoya explores his flaws rather than merely condemning them. She accomplishes something similar with his wife, Neelam (an excellent Shefali Shetty), and a number of other characters in the film. For all its virtues, Zindagi Na Milegi Dobara felt like a work in which Zoya was still trying to find her own voice. It came across more as an extension of her brother’s aforementioned debut, Dil Chahta Hai (besides serving as a producer, Farhan has also been involved as an actor in all three of Zoya’s features). Particularly disappointing were both of the female characters in the film. Dil Dhadakne Do is quite a departure in this regard. Along with the family’s long-suffering matriarch, who has been conditioned to instill the same confining values in her children, Zoya and Kagti have created quite a fascinating character in Ayesha (Chopra), the unhappily married daughter, who may seem relatively modern and independent (she’s a rising entrepreneur) but is made to bear the guilt of her success at the expense of a child at every turn. One of the keenest insights offered by the film is the fact that patriarchy isn’t limited to men restricting and regulating women, but also women doing the same to other women, often their “loved ones.” The film’s other piercing them is almost Freudian: the parents’ narcissistic investment in their children—perhaps a bigger issue in societies, like India, where children tend to stay longer with parents. Given the fact that an astounding 65% of the country’s population is below the age of 35 makes it even more pertinent. The Mehras’ investment in their lone son, Kabir (Singh), suddenly turns more literal once they discover the truth about their sagging business. The Mediterranean cruise they’ve organized to celebrate their three decades of marriage, one built more on compromise than anything else, now features a rival magnate, one whose daughter was recently dumped at the altar. But as Pluto rightly observes, when have children ever acquiesced quietly? Once on the ship, Kabir finds his attention drawn to a member of the dance troupe, Farah Ali (a terrific Anushka Sharma), who once ran away from her conservative Muslim family in Birmingham to pursue her dreams. The chemistry between Singh and Sharma is just as electrifying here as it was in Maneesh Sharma’s much-beloved Band Baaja Baaraat. Almost novelistic in its use of recurring motifs and acutely observed characterizations, Dil Dhadakne Do works not only as a drama but also as a comedy (of manners and mores), feminist tract, social satire and, yes, a road movie. In a way, it’s a new, modern kind of masala film [1], one that likely won’t be accepted in its entirety by those who still harbor strong feelings about the old, often regressive kind. More importantly, it’s a wonderful piece of cinema. 6 Responses About the criticism that Zoya only tells stories about the 1%, she addresses in the Film Companion chat saying… that we “are the ones that didn’t watch Bombay Talkies and Luck by Chance” Paraphrasing~~~ xD Both of which have better balanced character building of actors and actresses. Kagti also points out that you can switch the cruise with a train/bus ride, and it will be the same dynamic, the same story. She does have a point. I think a ship is the more appropriate metaphor in this case because, unlike a bus or a train, you can’t easily get off! Plus, it’s hard to imagine the characters here going on a long journey any other way. Outside the ship, however, would’ve made their final ship-escape less over-the-top, though. But yeah, I get what you mean. I’m still waiting for a BR copy to show up on Amazon xD Though I don’t suffer as much with Indian DVDs since a vast majority of them come as region free. The only bit I liked in ZNMD was the storyline with Farhan and Shah, so I put this quite a bit ahead of that one. lol
The Government would need to provide almost £9 bn in support for businesses to cope with the impact of failing to strike a post-Brexit trade deal with the European Union - but the cost could be covered by tariffs on imports from the remaining 27 members of the bloc, a think tank has said. The Civitas report suggests that billions could be spent on subsidies and aid within World Trade Organisation rules to help firms as they adapt to the imposition of tariffs on trade with the EU. The package could include £2.9 bn to support research and development and a £3.8 bn programme of regional aid along with a scheme to offer small, discretionary grants to any firm affected by Brexit. The paper also recommended abolishing the carbon price floor mechanism, which is a UK Government policy implemented to support the EU-wide Emissions Trading System, which places a price on greenhouse gas emissions. The report said the package would benefit industries affected by tariffs to the value of £6.3 bn a year, more than compensating for the newly-imposed costs to those industries which the think tank has previously estimated as £5.2 bn. The total cost to the Treasury, including "leakage" to non-affected industries and households, would be £8.8 bn - which the report claimed would be easily covered by the £12.9 bn collected in tariffs on EU imports into the UK. Report author William Norton said the paper showed that the UK had "little to fear" if the remaining 27 EU nations refused to strike a deal for tariff-free trade. "Hitherto, the political debate about the UK's departure from the EU has focused upon the risks of a 'hard' Brexit and the need to soften this by avoiding costs for business such as tariffs being levied upon exports to the EU27. "But these tariff costs can be managed. In an ideal world, British exporters would not have to suffer them, but it is possible to mitigate their impact through other measures which are justifiable in their own right. 'It makes sense to remove a self-inflicted wound like the carbon price floor, which is damaging British competitiveness and low-income households. Brexit Concerns Show all 26 1 /26 Brexit Concerns Brexit Concerns Brexit will put British patients at 'back of the queue' for new drugs Brexit will put British patients at the “back of the queue” for vital new drugs, the Government has been warned – forcing them to wait up to two years longer A medicines regulator has raised the alarm over a likely decision to pull out of the European Medicines Agency (EMA), as well as the EU itself. ealth Secretary Jeremy Hunt dropped the bombshell , when he said he expected the UK would quit the EMA – because it is subject to rulings by the European Court of Justice. Getty Images Brexit Concerns London to lose status as 'gateway to Europe' for banks One of Germany’s top banking regulators has warned that London could lose its status as “gateway to Europe” for the banking sector after Britain quits the European trading bloc. Andreas Dombret, who is an executive board member for the Bundesbank—Germany’s central bank—told a private meeting of German businesses and banks earlier this week in Frankfurt that even if banking rules were “equivalent” between the UK and the rest of the EU, that was still “miles away from [Britain having] access to the single market”, the BBC reports. Jason Hawkes Brexit Concerns Exodus The number of financial sector professionals in Britain and continental Europe looking for jobs in Ireland rocketed in the months after the UK voted to leave the European Union Shutterstock Brexit Concerns Brexit is making FTSE 100 executives richer Pay packages of many FTSE 100 chief executive officers are partly tied to how well share prices are doing rather than the CEO’s performance -- and some stocks are soaring. ritish equities got a boost since the June vote because the likes of Rio Tinto, Smiths Group and WPP generate most sales abroad and earn a fortune when they convert these revenues back into the weakened pound. Sterling’s fall also made UK stocks more affordable for overseas investors. Rex Brexit Concerns Theresa May: UK to leave single market Theresa May has said the UK "cannot possibly" remain within the European single market, as staying in it would mean "not leaving the EU at all". Getty Brexit Concerns Lead campaigner Gina Miller and her team outside the High Court Getty Brexit Concerns Raymond McCord holds up his newly issued Irish passport alongside his British passport outside the High Court in Belfast following a judges dismissal of the UK's first legal challenges to Brexit PA wire Brexit Concerns SDLP leader Colum Eastwood leaving the High Court in Belfast following a judges dismissal of the UK's first legal challenges to Brexit PA wire Brexit Concerns Migrants with luggage walk past a graffiti on a wall as they leave the 'Jungle' migrant camp, as part of a major three-day operation planned to clear the camp in Calais Getty Brexit Concerns Migrants leave messages on their tents in the Jungle migrant camp Getty Brexit Concerns The Adventist Development and Relief Agency (Adra) which distributes approximately 700 meals daily in the northern Paris camp states that it is noticing a spike in new migrant arrivals this week, potentially linked the the Calais 'jungle' camp closure - with around 1000 meals distributed today EPA Brexit Concerns Migrant workers pick apples at Stocks Farm in Suckley, Britain Reuters Brexit Concerns Many farmers across the country are voicing concerns that Brexit could be a dangerous step into the unknown for the farming industry Getty Brexit Concerns Bank of England governor Mark Carney who said the long-term outlook for the UK economy is positive, but growth was slowing in the wake of the Brexit vote PA Brexit Concerns The Dow Jones industrial average closed down over 600 points on the news with markets around the globe pluninging Getty Brexit Concerns Immigration officers deal with each member of the public seeking entry into the United Kingdom but on average, 10 a day are refused entry at this London airport and between 2008 and 2009, 33,100 people were detained at the airport for mainly passport irregularities Getty Brexit Concerns A number of global investment giants have threatened to move their European operations out of London if Brexit proves to have a negative impact on their businesses Getty Brexit Concerns Following the possibility of a Brexit the UK would be released from its renewable energy targets under the EU Renewable Energy Directive and from EU state aid restrictions, potentially giving the government more freedom both in the design and phasing out of renewable energy support regimes Getty Brexit Concerns A woman looking at a chart showing the drop in the pound (Sterling) against the US Dollar in London after Britain voted to leave the EU Getty Brexit Concerns Young protesters outside the Houses of Parliament in Westminster, to protest against the United Kingdom's decision to leave the EU following the referendum Getty Brexit Concerns Applications from Northern Ireland citizens for Irish Passports has soared to a record high after the UK Voted in favour of Leaving the EU Getty Brexit Concerns NFU Vice President Minette Batters with Secretary of State, Andrea Leadsome at the National Farmers Union (NFU) took machinery, produce, farmers and staff to Westminster to encourage Members of Parliament to back British farming, post Brexit Getty Brexit Concerns The latest reports released by the UK Cabinet Office warn that expats would lose a range of specific rights to live, to work and to access pensions, healthcare and public services. The same reports added that UK citizens abroad would not be able to assume that these rights will be guaranteed in the future Getty Brexit Concerns A British resident living in Spain asks questions during an informative Brexit talk by the "Brexpats in Spain" group, about Spanish legal issues to become Spanish citizens, at the town hall in Benalmadena, Spain Reuters Brexit Concerns The collapse of Great Britain appears to have been greatly exaggerated given the late summer crowds visiting city museums, hotels, and other important tourist attractions Getty Brexit Concerns The U.K. should maintain European Union regulations covering everything from working hours to chemicals until after the government sets out its plans for Brexit, said British manufacturers anxious to avoid a policy vacuum and safeguard access to their biggest export market Getty "It makes sense to provide greater tax incentives for research and development. A case can be made for regional aid given the imbalances in economic performance and employment across the UK as a whole. 'Hence, the real question is not 'how soft a Brexit can we achieve' but rather 'how hard a negotiation do we wish to drive with the EU'. "The balance of negotiating strengths is far more favourable to the UK. If the EU27 wish to impose a self-inflicted wound by levying tariffs on British exports, Britain has little to fear."
Q: Zend Framework - long routes(Router) I'm already thinking about to start using simple GET string. Or I'm not so good at configuring routes? :) And configuring routes via regex in .htaccess foreach($links as $a) { $Router->addRoute($a['link'], new Zend_Controller_Router_Route( $a['link'] . '/:page/:ad_id/:photo/:price_from/:price_to/:regions/:rajoni/:towns/:pagasti/:gadi_from/:gadi_to/:augums_from/:augums_to', array ("page" => 1, "ad_id" => 0, "photo" => 0, "price_from" => 0, "price_to" => 0, "regions" => 'def', "rajoni" => 'def', "towns" => 'def', "pagasti" => 'def', "gadi_from" => 'def', "gadi_to" => 'def', "augums_from" => 'def', "augums_to" => 'def', "department" => $a['department'], "category" => '', "link" => $a['link'], "controller" => "ads", "action" => "view", ))); } Please help me to find a right way to use Zend Framework Routes After edit: By the way, is it ok to loop through categories to bind route to them? So urls could be human readable? Or better to stick to .htaccess file configuration? But I still didn't figured out, how to make human readable urls without adding number for categories to regex. RewriteRule ^.*-d([0-9]+)/.*-c([0-9]+)/page-([0-9]+)/?$ index.php?DepartmentId=$1&CategoryId=$2&Page=$3 [L] RewriteRule ^.*-d([0-9]+)/.*-c([0-9]+)/?$ index.php?DepartmentId=$1&CategoryId=$2 [L] The only way I have figured out, is to pass actual name of category as value and on server side compare it with array of category names. Or there is a better way? A: Are you using this route to show results of a search? If that's the case, I would strongly recommend avoiding routes of this length - they're harder to maintain (try adding another parameter) - use a GET query string as normal. Structure something like /ads/view/:page/?ad_id=xxx&...
%% -*- erlang-mode -*- [ {gproc, [ {gproc_dist, all} ]} ].
table_create Memos TABLE_NO_KEY [[0,0.0,0.0],true] column_create Memos title COLUMN_SCALAR ShortText [[0,0.0,0.0],true] column_create Memos content COLUMN_SCALAR ShortText [[0,0.0,0.0],true] table_create Lexicon TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram [[0,0.0,0.0],true] column_create Lexicon memo_index COLUMN_INDEX|WITH_POSITION|WITH_SECTION Memos title,content [[0,0.0,0.0],true] load --table Memos [ ["title", "content"], ["groonga", "Start groonga!"], ["mroonga", "Start mroonga!"], ["rroonga", "Start rroonga!"], ["Ruby", "Start Ruby!"], ["learn", "Learning Ruby and groonga..."] ] [[0,0.0,0.0],5] select Memos --match_columns "Lexicon.memo_index.title" --query Ruby --output_columns "title, content, _score" [ [ 0, 0.0, 0.0 ], [ [ [ 1 ], [ [ "title", "ShortText" ], [ "content", "ShortText" ], [ "_score", "Int32" ] ], [ "Ruby", "Start Ruby!", 1 ] ] ] ]
DROP TABLE IF EXISTS t1; # test without partitioning for reference CREATE TABLE t1 ( c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1)) ENGINE='Archive'; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1'; AUTO_INCREMENT 1 INSERT INTO t1 VALUES (2); INSERT INTO t1 VALUES (4); INSERT INTO t1 VALUES (NULL); SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1'; AUTO_INCREMENT 6 SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1'; AUTO_INCREMENT 6 INSERT INTO t1 VALUES (0); INSERT INTO t1 VALUES (5), (16); INSERT INTO t1 VALUES (17); INSERT INTO t1 VALUES (19), (NULL); INSERT INTO t1 VALUES (NULL), (10), (NULL); # ERROR (only OK if Archive) mysql_errno: 1022 INSERT INTO t1 VALUES (NULL); SET INSERT_ID = 30; INSERT INTO t1 VALUES (NULL); SET INSERT_ID = 29; INSERT INTO t1 VALUES (NULL), (NULL), (NULL); INSERT INTO t1 VALUES (NULL); SELECT * FROM t1 ORDER BY c1; c1 2 4 5 6 17 19 20 21 22 30 31 DROP TABLE t1; CREATE TABLE t1 ( c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1)) ENGINE='Archive'; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 FLUSH TABLE; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES (4); FLUSH TABLE; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=ARCHIVE AUTO_INCREMENT=5 DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES (NULL); FLUSH TABLE; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=ARCHIVE AUTO_INCREMENT=6 DEFAULT CHARSET=latin1 INSERT INTO t1 VALUES (NULL); INSERT INTO t1 VALUES (-1); # ERROR (only OK if Archive) mysql_errno: 1022 INSERT INTO t1 VALUES (NULL); INSERT INTO t1 VALUES (NULL); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=ARCHIVE AUTO_INCREMENT=9 DEFAULT CHARSET=latin1 SELECT * FROM t1 ORDER BY c1; c1 4 5 6 7 8 INSERT INTO t1 VALUES (NULL); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=ARCHIVE AUTO_INCREMENT=10 DEFAULT CHARSET=latin1 SELECT * FROM t1 ORDER BY c1; c1 4 5 6 7 8 9 INSERT INTO t1 VALUES (100); INSERT INTO t1 VALUES (NULL); OPTIMIZE TABLE t1; Table Op Msg_type Msg_text test.t1 optimize status OK SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 DROP TABLE t1; # Simple test with NULL CREATE TABLE t1 ( c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1)) ENGINE='Archive' PARTITION BY HASH(c1) PARTITIONS 2; INSERT INTO t1 VALUES (NULL); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=ARCHIVE AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (c1) PARTITIONS 2 */ SELECT * FROM t1; c1 1 DROP TABLE t1; # Test with sql_mode and first insert as 0 CREATE TABLE t1 ( c1 INT, c2 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c2)) ENGINE='Archive' PARTITION BY HASH(c2) PARTITIONS 2; INSERT INTO t1 VALUES (1, NULL); INSERT INTO t1 VALUES (1, 1), (99, 99); INSERT INTO t1 VALUES (1, NULL); SET @@session.sql_mode = 'NO_AUTO_VALUE_ON_ZERO'; INSERT INTO t1 VALUES (1, 0); # ERROR (only OK if Archive) mysql_errno: 1022 SELECT * FROM t1 ORDER BY c1, c2; c1 c2 1 1 1 2 DROP TABLE t1; CREATE TABLE t1 ( c1 INT, c2 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c2)) ENGINE='Archive' PARTITION BY HASH(c2) PARTITIONS 2; INSERT INTO t1 VALUES (1, 0); # ERROR (only OK if Archive) mysql_errno: 1022 INSERT INTO t1 VALUES (1, 1), (1, NULL); INSERT INTO t1 VALUES (2, NULL), (4, 7); INSERT INTO t1 VALUES (1, NULL); SELECT * FROM t1 ORDER BY c1, c2; c1 c2 1 1 1 2 1 8 2 3 4 7 SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION'; DROP TABLE t1; # Simple test with NULL, 0 and explicit values both incr. and desc. CREATE TABLE t1 ( c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1)) ENGINE='Archive' PARTITION BY HASH(c1) PARTITIONS 2; INSERT INTO t1 VALUES (2), (4), (NULL); INSERT INTO t1 VALUES (0); INSERT INTO t1 VALUES (5), (16); INSERT INTO t1 VALUES (17), (19), (NULL); INSERT INTO t1 VALUES (NULL), (10), (NULL); # ERROR (only OK if Archive) mysql_errno: 1022 INSERT INTO t1 VALUES (NULL), (9); # ERROR (only OK if Archive) mysql_errno: 1022 INSERT INTO t1 VALUES (59), (55); # ERROR (only OK if Archive) mysql_errno: 1022 INSERT INTO t1 VALUES (NULL), (90); INSERT INTO t1 VALUES (NULL); SELECT * FROM t1 ORDER BY c1; c1 2 4 5 6 17 19 20 21 22 59 60 90 91 DROP TABLE t1; # Test with auto_increment_increment and auto_increment_offset. CREATE TABLE t1 ( c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1)) ENGINE='Archive' PARTITION BY HASH(c1) PARTITIONS 2; SET @@session.auto_increment_increment = 10; SET @@session.auto_increment_offset = 5; INSERT INTO t1 VALUES (1); INSERT INTO t1 VALUES (NULL), (NULL), (NULL); SET @@session.auto_increment_increment = 5; SET @@session.auto_increment_offset = 3; INSERT INTO t1 VALUES (NULL); INSERT INTO t1 VALUES (33 + 1); INSERT INTO t1 VALUES (NULL); INSERT INTO t1 VALUES (38 + 2); INSERT INTO t1 VALUES (NULL); INSERT INTO t1 VALUES (43 + 3); INSERT INTO t1 VALUES (NULL); INSERT INTO t1 VALUES (48 + 4); INSERT INTO t1 VALUES (NULL); INSERT INTO t1 VALUES (53 + 5); INSERT INTO t1 VALUES (NULL); INSERT INTO t1 VALUES (63 + 6); INSERT INTO t1 VALUES (NULL); SET @@session.auto_increment_increment = 1; SET @@session.auto_increment_offset = 1; SELECT * FROM t1 ORDER BY c1; c1 1 5 15 25 33 34 38 40 43 46 48 52 53 58 63 69 73 DROP TABLE t1; # Test reported auto_increment value CREATE TABLE t1 ( c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1)) ENGINE='Archive' PARTITION BY HASH (c1) PARTITIONS 2; SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1'; AUTO_INCREMENT 1 INSERT INTO t1 VALUES (2); SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1'; AUTO_INCREMENT 3 INSERT INTO t1 VALUES (4); INSERT INTO t1 VALUES (NULL); SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1'; AUTO_INCREMENT 6 INSERT INTO t1 VALUES (NULL); INSERT INTO t1 VALUES (17); INSERT INTO t1 VALUES (19); INSERT INTO t1 VALUES (NULL); INSERT INTO t1 VALUES (NULL); SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1'; AUTO_INCREMENT 22 SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1'; AUTO_INCREMENT 22 INSERT INTO t1 VALUES (10); # ERROR (only OK if Archive) mysql_errno: 1022 SELECT * FROM t1 ORDER BY c1; c1 2 4 5 6 17 19 20 21 INSERT INTO t1 VALUES (NULL); SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1'; AUTO_INCREMENT 23 INSERT INTO t1 VALUES (NULL); INSERT INTO t1 VALUES (15); # ERROR (only OK if Archive) mysql_errno: 1022 INSERT INTO t1 VALUES (NULL); SELECT * FROM t1 ORDER BY c1; c1 2 4 5 6 17 19 20 21 22 23 24 INSERT INTO t1 VALUES (NULL); INSERT INTO t1 VALUES (NULL); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=ARCHIVE AUTO_INCREMENT=27 DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (c1) PARTITIONS 2 */ SELECT * FROM t1 ORDER BY c1; c1 2 4 5 6 17 19 20 21 22 23 24 25 26 INSERT INTO t1 VALUES (NULL); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=ARCHIVE AUTO_INCREMENT=28 DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (c1) PARTITIONS 2 */ SELECT * FROM t1 ORDER BY c1; c1 2 4 5 6 17 19 20 21 22 23 24 25 26 27 INSERT INTO t1 VALUES (100); INSERT INTO t1 VALUES (NULL); OPTIMIZE TABLE t1; Table Op Msg_type Msg_text test.t1 optimize status OK SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (c1) PARTITIONS 2 */ DROP TABLE t1; # Test with two threads # con default CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1)) ENGINE = 'Archive' PARTITION BY HASH(c1) PARTITIONS 2; INSERT INTO t1 (c1) VALUES (2); INSERT INTO t1 (c1) VALUES (4); # con1 INSERT INTO t1 (c1) VALUES (NULL); INSERT INTO t1 (c1) VALUES (10); # con default INSERT INTO t1 (c1) VALUES (NULL); INSERT INTO t1 (c1) VALUES (NULL); INSERT INTO t1 (c1) VALUES (19); INSERT INTO t1 (c1) VALUES (21); # con1 INSERT INTO t1 (c1) VALUES (NULL); # con default INSERT INTO t1 (c1) VALUES (16); # ERROR (only OK if Archive) mysql_errno: 1022 # con1 INSERT INTO t1 (c1) VALUES (NULL); # con default INSERT INTO t1 (c1) VALUES (NULL); SELECT * FROM t1 ORDER BY c1; c1 2 4 5 10 11 12 19 21 22 23 24 DROP TABLE t1; # Test with two threads + start transaction NO PARTITIONING # con default CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1)) ENGINE = 'Archive'; START TRANSACTION; INSERT INTO t1 (c1) VALUES (2); INSERT INTO t1 (c1) VALUES (4); # con1 START TRANSACTION; INSERT INTO t1 (c1) VALUES (NULL); INSERT INTO t1 (c1) VALUES (10); # con default INSERT INTO t1 (c1) VALUES (NULL); INSERT INTO t1 (c1) VALUES (NULL); INSERT INTO t1 (c1) VALUES (19); INSERT INTO t1 (c1) VALUES (21); # con1 INSERT INTO t1 (c1) VALUES (NULL); # con default INSERT INTO t1 (c1) VALUES (16); # ERROR (only OK if Archive) mysql_errno: 1022 # con1 INSERT INTO t1 (c1) VALUES (NULL); SELECT * FROM t1 ORDER BY c1; c1 2 4 5 10 11 12 19 21 22 23 COMMIT; SELECT * FROM t1 ORDER BY c1; c1 2 4 5 10 11 12 19 21 22 23 # con default INSERT INTO t1 (c1) VALUES (NULL); SELECT * FROM t1 ORDER BY c1; c1 2 4 5 10 11 12 19 21 22 23 24 COMMIT; SELECT * FROM t1 ORDER BY c1; c1 2 4 5 10 11 12 19 21 22 23 24 DROP TABLE t1; # Test with two threads + start transaction # con default CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1)) ENGINE = 'Archive' PARTITION BY HASH(c1) PARTITIONS 2; START TRANSACTION; INSERT INTO t1 (c1) VALUES (2); INSERT INTO t1 (c1) VALUES (4); # con1 START TRANSACTION; INSERT INTO t1 (c1) VALUES (NULL), (10); # con default INSERT INTO t1 (c1) VALUES (NULL), (NULL), (19); INSERT INTO t1 (c1) VALUES (21); # con1 INSERT INTO t1 (c1) VALUES (NULL); # con default INSERT INTO t1 (c1) VALUES (16); # ERROR (only OK if Archive) mysql_errno: 1022 # con1 INSERT INTO t1 (c1) VALUES (NULL); SELECT * FROM t1 ORDER BY c1; c1 2 4 5 10 11 12 19 21 22 23 COMMIT; SELECT * FROM t1 ORDER BY c1; c1 2 4 5 10 11 12 19 21 22 23 # con default INSERT INTO t1 (c1) VALUES (NULL); SELECT * FROM t1 ORDER BY c1; c1 2 4 5 10 11 12 19 21 22 23 24 COMMIT; SELECT * FROM t1 ORDER BY c1; c1 2 4 5 10 11 12 19 21 22 23 24 DROP TABLE t1; # Test with another column before CREATE TABLE t1 ( c1 INT, c2 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c2)) ENGINE = 'Archive' PARTITION BY HASH(c2) PARTITIONS 2; INSERT INTO t1 VALUES (1, 0); INSERT INTO t1 VALUES (1, 1); INSERT INTO t1 VALUES (1, NULL); INSERT INTO t1 VALUES (2, NULL), (3, 11), (3, NULL), (2, 0); INSERT INTO t1 VALUES (2, NULL); INSERT INTO t1 VALUES (2, 2); INSERT INTO t1 VALUES (2, 22); INSERT INTO t1 VALUES (2, NULL); SELECT * FROM t1 ORDER BY c1,c2; c1 c2 1 1 1 2 2 3 2 13 2 14 2 22 2 23 3 11 3 12 DROP TABLE t1; # Test with auto_increment on secondary column in multi-column-index CREATE TABLE t1 ( c1 INT, c2 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1,c2)) ENGINE = 'Archive' PARTITION BY HASH(c2) PARTITIONS 2; ERROR 42000: Incorrect table definition; there can be only one auto column and it must be defined as a key # Test AUTO_INCREMENT in CREATE CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1)) ENGINE = 'Archive' AUTO_INCREMENT = 15 PARTITION BY HASH(c1) PARTITIONS 2; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=ARCHIVE AUTO_INCREMENT=15 DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (c1) PARTITIONS 2 */ INSERT INTO t1 (c1) VALUES (4); # ERROR (only OK if Archive) mysql_errno: 1022 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=ARCHIVE AUTO_INCREMENT=15 DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (c1) PARTITIONS 2 */ INSERT INTO t1 (c1) VALUES (0); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=ARCHIVE AUTO_INCREMENT=16 DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (c1) PARTITIONS 2 */ INSERT INTO t1 (c1) VALUES (NULL); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=ARCHIVE AUTO_INCREMENT=17 DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (c1) PARTITIONS 2 */ SELECT * FROM t1 ORDER BY c1; c1 15 16 # Test sql_mode 'NO_AUTO_VALUE_ON_ZERO' SET @@session.sql_mode = 'NO_AUTO_VALUE_ON_ZERO'; INSERT INTO t1 (c1) VALUES (300); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=ARCHIVE AUTO_INCREMENT=301 DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (c1) PARTITIONS 2 */ INSERT INTO t1 (c1) VALUES (0); # ERROR (only OK if Archive) mysql_errno: 1022 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=ARCHIVE AUTO_INCREMENT=301 DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (c1) PARTITIONS 2 */ INSERT INTO t1 (c1) VALUES (NULL); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=ARCHIVE AUTO_INCREMENT=302 DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (c1) PARTITIONS 2 */ SELECT * FROM t1 ORDER BY c1; c1 15 16 300 301 SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION'; DROP TABLE t1; # Test SET INSERT_ID CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1)) ENGINE = 'Archive' PARTITION BY HASH(c1) PARTITIONS 2; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (c1) PARTITIONS 2 */ INSERT INTO t1 (c1) VALUES (NULL); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=ARCHIVE AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (c1) PARTITIONS 2 */ SELECT * FROM t1; c1 1 SET INSERT_ID = 23; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=ARCHIVE AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (c1) PARTITIONS 2 */ INSERT INTO t1 (c1) VALUES (NULL); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=ARCHIVE AUTO_INCREMENT=24 DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (c1) PARTITIONS 2 */ SET INSERT_ID = 22; INSERT INTO t1 VALUES (NULL), (NULL), (NULL); INSERT INTO t1 VALUES (NULL); SELECT * FROM t1 ORDER BY c1; c1 1 22 23 24 DROP TABLE t1; # Testing with FLUSH TABLE CREATE TABLE t1 ( c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1)) ENGINE='Archive' PARTITION BY HASH(c1) PARTITIONS 2; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (c1) PARTITIONS 2 */ FLUSH TABLE; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (c1) PARTITIONS 2 */ INSERT INTO t1 VALUES (4); FLUSH TABLE; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=ARCHIVE AUTO_INCREMENT=5 DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (c1) PARTITIONS 2 */ INSERT INTO t1 VALUES (NULL); FLUSH TABLE; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`c1`) ) ENGINE=ARCHIVE AUTO_INCREMENT=6 DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (c1) PARTITIONS 2 */ SELECT * FROM t1 ORDER BY c1; c1 4 5 DROP TABLE t1; ############################################################################# # Bug #45823 - Assertion failure in file row/row0mysql.c line 1386 # Bug #43988 - AUTO_INCREMENT errors with partitioned InnoDB tables in 5.1.31 ############################################################################## # Inserting negative autoincrement values into a partition table (partitions >= 4) CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1), c2 INT) ENGINE='Archive' PARTITION BY HASH(c1) PARTITIONS 4; INSERT INTO t(c2) VALUES (10); INSERT INTO t(c2) VALUES (20); INSERT INTO t VALUES (-1,-10); # ERROR (only OK if Archive), mysql_errno: 1022 INSERT INTO t(c2) VALUES (30); INSERT INTO t(c2) VALUES (40); SELECT * FROM t ORDER BY c1 ASC; c1 c2 1 10 2 20 3 30 4 40 DROP TABLE t; # Reading from a partition table (partitions >= 2 ) after inserting a negative # value into the auto increment column CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1), c2 INT) ENGINE='Archive' PARTITION BY HASH(c1) PARTITIONS 2; INSERT INTO t VALUES (-2,-20); # ERROR (only OK if Archive), mysql_errno: 1022 INSERT INTO t(c2) VALUES (30); SELECT * FROM t ORDER BY c1 ASC; c1 c2 1 30 DROP TABLE t; # Inserting negative auto increment value into a partition table (partitions >= 2) # auto increment value > 2. CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1), c2 INT) ENGINE='Archive' PARTITION BY HASH(c1) PARTITIONS 2; INSERT INTO t VALUES (-4,-20); # ERROR (only OK if Archive), mysql_errno: 1022 INSERT INTO t(c2) VALUES (30); INSERT INTO t(c2) VALUES (40); SELECT * FROM t ORDER BY c1 ASC; c1 c2 1 30 2 40 DROP TABLE t; # Inserting -1 into autoincrement column of a partition table (partition >= 4) CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1), c2 INT) ENGINE='Archive' PARTITION BY HASH(c1) PARTITIONS 4; INSERT INTO t(c2) VALUES (10); INSERT INTO t(c2) VALUES (20); INSERT INTO t VALUES (-1,-10); # ERROR (only OK if Archive), mysql_errno: 1022 SELECT * FROM t ORDER BY c1 ASC; c1 c2 1 10 2 20 INSERT INTO t(c2) VALUES (30); SELECT * FROM t ORDER BY c1 ASC; c1 c2 1 10 2 20 3 30 DROP TABLE t; # Deleting from an auto increment table after inserting negative values CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1), c2 INT) ENGINE='Archive' PARTITION BY HASH(c1) PARTITIONS 4; INSERT INTO t(c2) VALUES (10); INSERT INTO t(c2) VALUES (20); INSERT INTO t VALUES (-1,-10); # ERROR (only OK if Archive), mysql_errno: 1022 INSERT INTO t(c2) VALUES (30); INSERT INTO t VALUES (-3,-20); # ERROR (only OK if Archive), mysql_errno: 1022 INSERT INTO t(c2) VALUES (40); SELECT * FROM t ORDER BY c1 ASC; c1 c2 1 10 2 20 3 30 4 40 SELECT * FROM t ORDER BY c1 ASC; c1 c2 1 10 2 20 3 30 4 40 DROP TABLE t; # Inserting a positive value that exceeds maximum allowed value for an # Auto Increment column (positive maximum) CREATE TABLE t (c1 TINYINT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1), c2 INT) ENGINE='Archive' PARTITION BY HASH(c1) PARTITIONS 4; INSERT INTO t(c2) VALUES (10); INSERT INTO t(c2) VALUES (20); INSERT INTO t VALUES (126,30); INSERT INTO t VALUES (127,40); INSERT INTO t VALUES (128,50); INSERT INTO t VALUES (129,60); SELECT * FROM t ORDER BY c1 ASC; c1 c2 1 10 2 20 126 30 127 40 DROP TABLE t; # Inserting a negative value that goes below minimum allowed value for an # Auto Increment column (negative minimum) CREATE TABLE t (c1 TINYINT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1), c2 INT) ENGINE='Archive' PARTITION BY HASH(c1) PARTITIONS 4; INSERT INTO t(c2) VALUES (10); INSERT INTO t(c2) VALUES (20); INSERT INTO t VALUES (-127,30); # ERROR (only OK if Archive), mysql_errno: 1022 INSERT INTO t VALUES (-128,40); # ERROR (only OK if Archive), mysql_errno: 1022 INSERT INTO t VALUES (-129,50); INSERT INTO t VALUES (-130,60); SELECT * FROM t ORDER BY c1 ASC; c1 c2 1 10 2 20 DROP TABLE t; # Updating the partition table with a negative Auto Increment value CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1), c2 INT) ENGINE='Archive' PARTITION BY HASH(c1) PARTITIONS 4; INSERT INTO t(c2) VALUES (10); INSERT INTO t(c2) VALUES (20); INSERT INTO t VALUES (-1,-10); # ERROR (only OK if Archive), mysql_errno: 1022 INSERT INTO t(c2) VALUES (30); SELECT * FROM t ORDER BY c1 ASC; c1 c2 1 10 2 20 3 30 SELECT * FROM t ORDER BY c1 ASC; c1 c2 1 10 2 20 3 30 INSERT INTO t(c2) VALUES (40); INSERT INTO t(c2) VALUES (50); SELECT * FROM t ORDER BY c1 ASC; c1 c2 1 10 2 20 3 30 4 40 5 50 DROP TABLE t; # Updating the partition table with a value that crosses the upper limits # on both the positive and the negative side. CREATE TABLE t (c1 TINYINT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1), c2 INT) ENGINE='Archive' PARTITION BY HASH(c1) PARTITIONS 4; INSERT INTO t(c2) VALUES (10); INSERT INTO t(c2) VALUES (20); INSERT INTO t VALUES (126,30); INSERT INTO t VALUES (127,40); SELECT * FROM t ORDER BY c1 ASC; c1 c2 1 10 2 20 126 30 127 40 SELECT * FROM t ORDER BY c1 ASC; c1 c2 1 10 2 20 126 30 127 40 SELECT * FROM t ORDER BY c1 ASC; c1 c2 1 10 2 20 126 30 127 40 DROP TABLE t; ##############################################################################
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. using System.Collections.Generic; using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Web.Http.Controllers; using System.Web.Http.Metadata; using System.Web.Http.Metadata.Providers; using System.Web.Http.Validation; using System.Web.Http.ValueProviders; using Microsoft.TestCommon; using Moq; namespace System.Web.Http.ModelBinding.Binders { public class MutableObjectModelBinderTest { [Fact] public void BindModel() { // Arrange Mock<IValueProvider> mockValueProvider = new Mock<IValueProvider>(); mockValueProvider.Setup(o => o.ContainsPrefix(It.IsAny<string>())).Returns(true); Mock<IModelBinder> mockDtoBinder = new Mock<IModelBinder>(); ModelBindingContext bindingContext = new ModelBindingContext { ModelMetadata = GetMetadataForObject(new Person()), ModelName = "someName", ValueProvider = mockValueProvider.Object }; HttpActionContext context = ContextUtil.CreateActionContext(); context.ControllerContext.Configuration.Services.Replace(typeof(ModelBinderProvider), new SimpleModelBinderProvider(typeof(ComplexModelDto), mockDtoBinder.Object) { SuppressPrefixCheck = true }); mockDtoBinder .Setup(o => o.BindModel(context, It.IsAny<ModelBindingContext>())) .Returns((HttpActionContext cc, ModelBindingContext mbc2) => { return true; // just return the DTO unchanged }); Mock<TestableMutableObjectModelBinder> mockTestableBinder = new Mock<TestableMutableObjectModelBinder> { CallBase = true }; mockTestableBinder.Setup(o => o.EnsureModelPublic(context, bindingContext)).Verifiable(); mockTestableBinder.Setup(o => o.GetMetadataForPropertiesPublic(context, bindingContext)).Returns(new ModelMetadata[0]).Verifiable(); TestableMutableObjectModelBinder testableBinder = mockTestableBinder.Object; testableBinder.MetadataProvider = new DataAnnotationsModelMetadataProvider(); // Act bool retValue = testableBinder.BindModel(context, bindingContext); // Assert Assert.True(retValue); Assert.IsType<Person>(bindingContext.Model); Assert.True(bindingContext.ValidationNode.ValidateAllProperties); mockTestableBinder.Verify(); } [Fact] public void CanUpdateProperty_HasPublicSetter_ReturnsTrue() { // Arrange ModelMetadata propertyMetadata = GetMetadataForCanUpdateProperty("ReadWriteString"); // Act bool canUpdate = MutableObjectModelBinder.CanUpdatePropertyInternal(propertyMetadata); // Assert Assert.True(canUpdate); } [Fact] public void CanUpdateProperty_ReadOnlyArray_ReturnsFalse() { // Arrange ModelMetadata propertyMetadata = GetMetadataForCanUpdateProperty("ReadOnlyArray"); // Act bool canUpdate = MutableObjectModelBinder.CanUpdatePropertyInternal(propertyMetadata); // Assert Assert.False(canUpdate); } [Fact] public void CanUpdateProperty_ReadOnlyReferenceTypeNotBlacklisted_ReturnsTrue() { // Arrange ModelMetadata propertyMetadata = GetMetadataForCanUpdateProperty("ReadOnlyObject"); // Act bool canUpdate = MutableObjectModelBinder.CanUpdatePropertyInternal(propertyMetadata); // Assert Assert.True(canUpdate); } [Fact] public void CanUpdateProperty_ReadOnlyString_ReturnsFalse() { // Arrange ModelMetadata propertyMetadata = GetMetadataForCanUpdateProperty("ReadOnlyString"); // Act bool canUpdate = MutableObjectModelBinder.CanUpdatePropertyInternal(propertyMetadata); // Assert Assert.False(canUpdate); } [Fact] public void CanUpdateProperty_ReadOnlyValueType_ReturnsFalse() { // Arrange ModelMetadata propertyMetadata = GetMetadataForCanUpdateProperty("ReadOnlyInt"); // Act bool canUpdate = MutableObjectModelBinder.CanUpdatePropertyInternal(propertyMetadata); // Assert Assert.False(canUpdate); } [Fact] public void CreateModel() { // Arrange ModelBindingContext bindingContext = new ModelBindingContext { ModelMetadata = GetMetadataForType(typeof(Person)) }; TestableMutableObjectModelBinder testableBinder = new TestableMutableObjectModelBinder(); // Act object retModel = testableBinder.CreateModelPublic(null, bindingContext); // Assert Assert.IsType<Person>(retModel); } [Fact] public void EnsureModel_ModelIsNotNull_DoesNothing() { // Arrange HttpActionContext actionContext = ContextUtil.CreateActionContext(); ModelBindingContext bindingContext = new ModelBindingContext { ModelMetadata = GetMetadataForObject(new Person()) }; Mock<TestableMutableObjectModelBinder> mockTestableBinder = new Mock<TestableMutableObjectModelBinder> { CallBase = true }; TestableMutableObjectModelBinder testableBinder = mockTestableBinder.Object; // Act object originalModel = bindingContext.Model; testableBinder.EnsureModelPublic(null, bindingContext); object newModel = bindingContext.Model; // Assert Assert.Same(originalModel, newModel); mockTestableBinder.Verify(o => o.CreateModelPublic(actionContext, bindingContext), Times.Never()); } [Fact] public void EnsureModel_ModelIsNull_CallsCreateModel() { // Arrange ModelBindingContext bindingContext = new ModelBindingContext { ModelMetadata = GetMetadataForType(typeof(Person)) }; Mock<TestableMutableObjectModelBinder> mockTestableBinder = new Mock<TestableMutableObjectModelBinder> { CallBase = true }; mockTestableBinder.Setup(o => o.CreateModelPublic(null, bindingContext)).Returns(new Person()).Verifiable(); TestableMutableObjectModelBinder testableBinder = mockTestableBinder.Object; // Act object originalModel = bindingContext.Model; testableBinder.EnsureModelPublic(null, bindingContext); object newModel = bindingContext.Model; // Assert Assert.Null(originalModel); Assert.IsType<Person>(newModel); mockTestableBinder.Verify(); } [Fact] public void GetMetadataForProperties_WithBindAttribute() { // Arrange string[] expectedPropertyNames = new[] { "FirstName", "LastName" }; HttpActionContext actionContext = ContextUtil.CreateActionContext(); ModelBindingContext bindingContext = new ModelBindingContext { ModelMetadata = GetMetadataForType(typeof(PersonWithBindExclusion)) }; TestableMutableObjectModelBinder testableBinder = new TestableMutableObjectModelBinder(); // Act IEnumerable<ModelMetadata> propertyMetadatas = testableBinder.GetMetadataForPropertiesPublic(actionContext, bindingContext); string[] returnedPropertyNames = propertyMetadatas.Select(o => o.PropertyName).ToArray(); // Assert Assert.Equal(expectedPropertyNames, returnedPropertyNames); } [Fact] public void GetMetadataForProperties_WithoutBindAttribute() { // Arrange string[] expectedPropertyNames = new[] { "DateOfBirth", "DateOfDeath", "ValueTypeRequired", "FirstName", "LastName", "PropertyWithDefaultValue" }; HttpActionContext actionContext = ContextUtil.CreateActionContext(); ModelBindingContext bindingContext = new ModelBindingContext { ModelMetadata = GetMetadataForType(typeof(Person)) }; TestableMutableObjectModelBinder testableBinder = new TestableMutableObjectModelBinder(); // Act IEnumerable<ModelMetadata> propertyMetadatas = testableBinder.GetMetadataForPropertiesPublic(actionContext, bindingContext); string[] returnedPropertyNames = propertyMetadatas.Select(o => o.PropertyName).ToArray(); // Assert Assert.Equal(expectedPropertyNames, returnedPropertyNames); } [Fact] public void GetRequiredPropertiesCollection_MixedAttributes() { // Arrange HttpActionContext actionContext = ContextUtil.CreateActionContext(); ModelBindingContext bindingContext = new ModelBindingContext { ModelMetadata = GetMetadataForObject(new ModelWithMixedBindingBehaviors()) }; // Act HashSet<string> requiredProperties; Dictionary<string, ModelValidator> requiredValidators; HashSet<string> skipProperties; MutableObjectModelBinder.GetRequiredPropertiesCollection(actionContext, bindingContext, out requiredProperties, out requiredValidators, out skipProperties); // Assert Assert.Equal(new[] { "Required" }, requiredProperties.ToArray()); Assert.Equal(new[] { "Never" }, skipProperties.ToArray()); } [Fact] public void NullCheckFailedHandler_ModelStateAlreadyInvalid_DoesNothing() { // Arrange HttpActionContext context = ContextUtil.CreateActionContext(); context.ModelState.AddModelError("foo.bar", "Some existing error."); ModelMetadata modelMetadata = GetMetadataForType(typeof(Person)); ModelValidationNode validationNode = new ModelValidationNode(modelMetadata, "foo"); ModelValidatedEventArgs e = new ModelValidatedEventArgs(context, null /* parentNode */); // Act EventHandler<ModelValidatedEventArgs> handler = MutableObjectModelBinder.CreateNullCheckFailedHandler(modelMetadata, null /* incomingValue */); handler(validationNode, e); // Assert Assert.False(context.ModelState.ContainsKey("foo")); } [Fact] public void NullCheckFailedHandler_ModelStateValid_AddsErrorString() { // Arrange HttpActionContext context = ContextUtil.CreateActionContext(); ModelMetadata modelMetadata = GetMetadataForType(typeof(Person)); ModelValidationNode validationNode = new ModelValidationNode(modelMetadata, "foo"); ModelValidatedEventArgs e = new ModelValidatedEventArgs(context, null /* parentNode */); // Act EventHandler<ModelValidatedEventArgs> handler = MutableObjectModelBinder.CreateNullCheckFailedHandler(modelMetadata, null /* incomingValue */); handler(validationNode, e); // Assert Assert.True(context.ModelState.ContainsKey("foo")); Assert.Equal("A value is required.", context.ModelState["foo"].Errors[0].ErrorMessage); } [Fact] public void NullCheckFailedHandler_ModelStateValid_CallbackReturnsNull_DoesNothing() { // Arrange HttpActionContext context = ContextUtil.CreateActionContext(); ModelMetadata modelMetadata = GetMetadataForType(typeof(Person)); ModelValidationNode validationNode = new ModelValidationNode(modelMetadata, "foo"); ModelValidatedEventArgs e = new ModelValidatedEventArgs(context, null /* parentNode */); // Act ModelBinderErrorMessageProvider originalProvider = ModelBinderConfig.ValueRequiredErrorMessageProvider; try { ModelBinderConfig.ValueRequiredErrorMessageProvider = (ec, mm, value) => null; EventHandler<ModelValidatedEventArgs> handler = MutableObjectModelBinder.CreateNullCheckFailedHandler(modelMetadata, null /* incomingValue */); handler(validationNode, e); } finally { ModelBinderConfig.ValueRequiredErrorMessageProvider = originalProvider; } // Assert Assert.True(context.ModelState.IsValid); } [Fact] public void ProcessDto_BindRequiredFieldMissing_RaisesModelError() { // Arrange ModelWithBindRequired model = new ModelWithBindRequired { Name = "original value", Age = -20 }; ModelMetadata containerMetadata = GetMetadataForObject(model); HttpActionContext context = ContextUtil.CreateActionContext(); ModelBindingContext bindingContext = new ModelBindingContext { ModelMetadata = containerMetadata, ModelName = "theModel" }; ComplexModelDto dto = new ComplexModelDto(containerMetadata, containerMetadata.Properties); ModelMetadata nameProperty = dto.PropertyMetadata.Single(o => o.PropertyName == "Name"); dto.Results[nameProperty] = new ComplexModelDtoResult("John Doe", new ModelValidationNode(nameProperty, "")); TestableMutableObjectModelBinder testableBinder = new TestableMutableObjectModelBinder(); // Act & assert testableBinder.ProcessDto(context, bindingContext, dto); Assert.False(bindingContext.ModelState.IsValid); } [Fact] public void ProcessDto_Success() { // Arrange DateTime dob = new DateTime(2001, 1, 1); PersonWithBindExclusion model = new PersonWithBindExclusion { DateOfBirth = dob }; ModelMetadata containerMetadata = GetMetadataForObject(model); HttpActionContext context = ContextUtil.CreateActionContext(); ModelBindingContext bindingContext = new ModelBindingContext { ModelMetadata = containerMetadata }; ComplexModelDto dto = new ComplexModelDto(containerMetadata, containerMetadata.Properties); ModelMetadata firstNameProperty = dto.PropertyMetadata.Single(o => o.PropertyName == "FirstName"); dto.Results[firstNameProperty] = new ComplexModelDtoResult("John", new ModelValidationNode(firstNameProperty, "")); ModelMetadata lastNameProperty = dto.PropertyMetadata.Single(o => o.PropertyName == "LastName"); dto.Results[lastNameProperty] = new ComplexModelDtoResult("Doe", new ModelValidationNode(lastNameProperty, "")); ModelMetadata dobProperty = dto.PropertyMetadata.Single(o => o.PropertyName == "DateOfBirth"); dto.Results[dobProperty] = null; TestableMutableObjectModelBinder testableBinder = new TestableMutableObjectModelBinder(); // Act testableBinder.ProcessDto(context, bindingContext, dto); // Assert Assert.Equal("John", model.FirstName); Assert.Equal("Doe", model.LastName); Assert.Equal(dob, model.DateOfBirth); Assert.True(bindingContext.ModelState.IsValid); } [Fact] public void SetProperty_PropertyHasDefaultValue_SetsDefaultValue() { // Arrange HttpActionContext context = ContextUtil.CreateActionContext(); ModelBindingContext bindingContext = new ModelBindingContext { ModelMetadata = GetMetadataForObject(new Person()) }; ModelMetadata propertyMetadata = bindingContext.ModelMetadata.Properties.Single(o => o.PropertyName == "PropertyWithDefaultValue"); ModelValidationNode validationNode = new ModelValidationNode(propertyMetadata, "foo"); ComplexModelDtoResult dtoResult = new ComplexModelDtoResult(null /* model */, validationNode); ModelValidator requiredValidator = context.GetValidators(propertyMetadata).Where(v => v.IsRequired).FirstOrDefault(); TestableMutableObjectModelBinder testableBinder = new TestableMutableObjectModelBinder(); // Act testableBinder.SetPropertyPublic(context, bindingContext, propertyMetadata, dtoResult, requiredValidator); // Assert var person = Assert.IsType<Person>(bindingContext.Model); Assert.Equal(123.456m, person.PropertyWithDefaultValue); Assert.True(context.ModelState.IsValid); } [Fact] public void SetProperty_PropertyIsReadOnly_DoesNothing() { // Arrange ModelBindingContext bindingContext = new ModelBindingContext { ModelMetadata = GetMetadataForType(typeof(Person)) }; ModelMetadata propertyMetadata = bindingContext.ModelMetadata.Properties.Single(o => o.PropertyName == "NonUpdateableProperty"); ModelValidationNode validationNode = new ModelValidationNode(propertyMetadata, "foo"); ComplexModelDtoResult dtoResult = new ComplexModelDtoResult(null /* model */, validationNode); TestableMutableObjectModelBinder testableBinder = new TestableMutableObjectModelBinder(); // Act testableBinder.SetPropertyPublic(null, bindingContext, propertyMetadata, dtoResult, requiredValidator: null); // Assert // If didn't throw, success! } [Fact] public void SetProperty_PropertyIsSettable_CallsSetter() { // Arrange Person model = new Person(); HttpActionContext context = ContextUtil.CreateActionContext(); ModelBindingContext bindingContext = new ModelBindingContext { ModelMetadata = GetMetadataForObject(model) }; ModelMetadata propertyMetadata = bindingContext.ModelMetadata.Properties.Single(o => o.PropertyName == "DateOfBirth"); ModelValidationNode validationNode = new ModelValidationNode(propertyMetadata, "foo"); ComplexModelDtoResult dtoResult = new ComplexModelDtoResult(new DateTime(2001, 1, 1), validationNode); ModelValidator requiredValidator = context.GetValidators(propertyMetadata).Where(v => v.IsRequired).FirstOrDefault(); TestableMutableObjectModelBinder testableBinder = new TestableMutableObjectModelBinder(); // Act testableBinder.SetPropertyPublic(context, bindingContext, propertyMetadata, dtoResult, requiredValidator); // Assert validationNode.Validate(context); Assert.True(context.ModelState.IsValid); Assert.Equal(new DateTime(2001, 1, 1), model.DateOfBirth); } [Fact] public void SetProperty_PropertyIsSettable_SetterThrows_RecordsError() { // Arrange Person model = new Person { DateOfBirth = new DateTime(1900, 1, 1) }; ModelBindingContext bindingContext = new ModelBindingContext { ModelMetadata = GetMetadataForObject(model) }; ModelMetadata propertyMetadata = bindingContext.ModelMetadata.Properties.Single(o => o.PropertyName == "DateOfDeath"); ModelValidationNode validationNode = new ModelValidationNode(propertyMetadata, "foo"); ComplexModelDtoResult dtoResult = new ComplexModelDtoResult(new DateTime(1800, 1, 1), validationNode); TestableMutableObjectModelBinder testableBinder = new TestableMutableObjectModelBinder(); // Act testableBinder.SetPropertyPublic(null, bindingContext, propertyMetadata, dtoResult, requiredValidator: null); // Assert Assert.Equal("Date of death can't be before date of birth." + Environment.NewLine + "Parameter name: value", bindingContext.ModelState["foo"].Errors[0].Exception.Message); } [Fact] public void SetProperty_SettingNonNullableValueTypeToNull_RequiredValidatorNotPresent_RegistersValidationCallback() { // Arrange HttpActionContext context = ContextUtil.CreateActionContext(); ModelBindingContext bindingContext = new ModelBindingContext { ModelMetadata = GetMetadataForObject(new Person()), }; ModelMetadata propertyMetadata = bindingContext.ModelMetadata.Properties.Single(o => o.PropertyName == "DateOfBirth"); ModelValidationNode validationNode = new ModelValidationNode(propertyMetadata, "foo"); ComplexModelDtoResult dtoResult = new ComplexModelDtoResult(null /* model */, validationNode); ModelValidator requiredValidator = context.GetValidators(propertyMetadata).Where(v => v.IsRequired).FirstOrDefault(); TestableMutableObjectModelBinder testableBinder = new TestableMutableObjectModelBinder(); // Act testableBinder.SetPropertyPublic(context, bindingContext, propertyMetadata, dtoResult, requiredValidator); // Assert Assert.True(context.ModelState.IsValid); validationNode.Validate(context, bindingContext.ValidationNode); Assert.False(context.ModelState.IsValid); } [Fact] public void SetProperty_SettingNonNullableValueTypeToNull_RequiredValidatorPresent_AddsModelError() { // Arrange HttpActionContext context = ContextUtil.CreateActionContext(); ModelBindingContext bindingContext = new ModelBindingContext { ModelMetadata = GetMetadataForObject(new Person()), ModelName = "foo" }; ModelMetadata propertyMetadata = bindingContext.ModelMetadata.Properties.Single(o => o.PropertyName == "ValueTypeRequired"); ModelValidationNode validationNode = new ModelValidationNode(propertyMetadata, "foo.ValueTypeRequired"); ComplexModelDtoResult dtoResult = new ComplexModelDtoResult(null /* model */, validationNode); ModelValidator requiredValidator = context.GetValidators(propertyMetadata).Where(v => v.IsRequired).FirstOrDefault(); TestableMutableObjectModelBinder testableBinder = new TestableMutableObjectModelBinder(); // Act testableBinder.SetPropertyPublic(context, bindingContext, propertyMetadata, dtoResult, requiredValidator); // Assert Assert.False(bindingContext.ModelState.IsValid); Assert.Equal("Sample message", bindingContext.ModelState["foo.ValueTypeRequired"].Errors[0].ErrorMessage); } [Fact] public void SetProperty_SettingNullableTypeToNull_RequiredValidatorNotPresent_PropertySetterThrows_AddsRequiredMessageString() { // Arrange HttpActionContext context = ContextUtil.CreateActionContext(); ModelBindingContext bindingContext = new ModelBindingContext { ModelMetadata = GetMetadataForObject(new ModelWhosePropertySetterThrows()), ModelName = "foo" }; ModelMetadata propertyMetadata = bindingContext.ModelMetadata.Properties.Single(o => o.PropertyName == "NameNoAttribute"); ModelValidationNode validationNode = new ModelValidationNode(propertyMetadata, "foo.NameNoAttribute"); ComplexModelDtoResult dtoResult = new ComplexModelDtoResult(null /* model */, validationNode); ModelValidator requiredValidator = context.GetValidators(propertyMetadata).Where(v => v.IsRequired).FirstOrDefault(); TestableMutableObjectModelBinder testableBinder = new TestableMutableObjectModelBinder(); // Act testableBinder.SetPropertyPublic(context, bindingContext, propertyMetadata, dtoResult, requiredValidator); // Assert Assert.False(bindingContext.ModelState.IsValid); Assert.Equal(1, bindingContext.ModelState["foo.NameNoAttribute"].Errors.Count); Assert.Equal("This is a different exception." + Environment.NewLine + "Parameter name: value", bindingContext.ModelState["foo.NameNoAttribute"].Errors[0].Exception.Message); } [Fact] public void SetProperty_SettingNullableTypeToNull_RequiredValidatorPresent_PropertySetterThrows_AddsRequiredMessageString() { // Arrange HttpActionContext context = ContextUtil.CreateActionContext(); ModelBindingContext bindingContext = new ModelBindingContext { ModelMetadata = GetMetadataForObject(new ModelWhosePropertySetterThrows()), ModelName = "foo" }; ModelMetadata propertyMetadata = bindingContext.ModelMetadata.Properties.Single(o => o.PropertyName == "Name"); ModelValidationNode validationNode = new ModelValidationNode(propertyMetadata, "foo.Name"); ComplexModelDtoResult dtoResult = new ComplexModelDtoResult(null /* model */, validationNode); ModelValidator requiredValidator = context.GetValidators(propertyMetadata).Where(v => v.IsRequired).FirstOrDefault(); TestableMutableObjectModelBinder testableBinder = new TestableMutableObjectModelBinder(); // Act testableBinder.SetPropertyPublic(context, bindingContext, propertyMetadata, dtoResult, requiredValidator); // Assert Assert.False(bindingContext.ModelState.IsValid); Assert.Equal(1, bindingContext.ModelState["foo.Name"].Errors.Count); Assert.Equal("This message comes from the [Required] attribute.", bindingContext.ModelState["foo.Name"].Errors[0].ErrorMessage); } private static ModelMetadata GetMetadataForCanUpdateProperty(string propertyName) { DataAnnotationsModelMetadataProvider metadataProvider = new DataAnnotationsModelMetadataProvider(); return metadataProvider.GetMetadataForProperty(null, typeof(MyModelTestingCanUpdateProperty), propertyName); } private static ModelMetadata GetMetadataForObject(object o) { DataAnnotationsModelMetadataProvider metadataProvider = new DataAnnotationsModelMetadataProvider(); return metadataProvider.GetMetadataForType(() => o, o.GetType()); } private static ModelMetadata GetMetadataForType(Type t) { DataAnnotationsModelMetadataProvider metadataProvider = new DataAnnotationsModelMetadataProvider(); return metadataProvider.GetMetadataForType(null, t); } private class Person { private DateTime? _dateOfDeath; public DateTime DateOfBirth { get; set; } public DateTime? DateOfDeath { get { return _dateOfDeath; } set { if (value < DateOfBirth) { throw new ArgumentOutOfRangeException("value", "Date of death can't be before date of birth."); } _dateOfDeath = value; } } [Required(ErrorMessage = "Sample message")] public int ValueTypeRequired { get; set; } public string FirstName { get; set; } public string LastName { get; set; } public string NonUpdateableProperty { get; private set; } [DefaultValue(typeof(decimal), "123.456")] public decimal PropertyWithDefaultValue { get; set; } } private class PersonWithBindExclusion { [HttpBindNever] public DateTime DateOfBirth { get; set; } [HttpBindNever] public DateTime? DateOfDeath { get; set; } public string FirstName { get; set; } public string LastName { get; set; } public string NonUpdateableProperty { get; private set; } } private class ModelWithBindRequired { public string Name { get; set; } [HttpBindRequired] public int Age { get; set; } } [HttpBindRequired] private class ModelWithMixedBindingBehaviors { public string Required { get; set; } [HttpBindNever] public string Never { get; set; } [HttpBindingBehavior(HttpBindingBehavior.Optional)] public string Optional { get; set; } } private sealed class MyModelTestingCanUpdateProperty { public int ReadOnlyInt { get; private set; } public string ReadOnlyString { get; private set; } public string[] ReadOnlyArray { get; private set; } public object ReadOnlyObject { get; private set; } public string ReadWriteString { get; set; } } private sealed class ModelWhosePropertySetterThrows { [Required(ErrorMessage = "This message comes from the [Required] attribute.")] public string Name { get { return null; } set { throw new ArgumentException("This is an exception.", "value"); } } public string NameNoAttribute { get { return null; } set { throw new ArgumentException("This is a different exception.", "value"); } } } public class TestableMutableObjectModelBinder : MutableObjectModelBinder { public virtual bool CanUpdatePropertyPublic(ModelMetadata propertyMetadata) { return base.CanUpdateProperty(propertyMetadata); } protected override bool CanUpdateProperty(ModelMetadata propertyMetadata) { return CanUpdatePropertyPublic(propertyMetadata); } public virtual object CreateModelPublic(HttpActionContext context, ModelBindingContext bindingContext) { return base.CreateModel(context, bindingContext); } protected override object CreateModel(HttpActionContext context, ModelBindingContext bindingContext) { return CreateModelPublic(context, bindingContext); } public virtual void EnsureModelPublic(HttpActionContext context, ModelBindingContext bindingContext) { base.EnsureModel(context, bindingContext); } protected override void EnsureModel(HttpActionContext context, ModelBindingContext bindingContext) { EnsureModelPublic(context, bindingContext); } public virtual IEnumerable<ModelMetadata> GetMetadataForPropertiesPublic(HttpActionContext context, ModelBindingContext bindingContext) { return base.GetMetadataForProperties(context, bindingContext); } protected override IEnumerable<ModelMetadata> GetMetadataForProperties(HttpActionContext context, ModelBindingContext bindingContext) { return GetMetadataForPropertiesPublic(context, bindingContext); } public virtual void SetPropertyPublic(HttpActionContext context, ModelBindingContext bindingContext, ModelMetadata propertyMetadata, ComplexModelDtoResult dtoResult, ModelValidator requiredValidator) { base.SetProperty(context, bindingContext, propertyMetadata, dtoResult, requiredValidator); } protected override void SetProperty(HttpActionContext actionContext, ModelBindingContext bindingContext, ModelMetadata propertyMetadata, ComplexModelDtoResult dtoResult, ModelValidator requiredValidator) { SetPropertyPublic(actionContext, bindingContext, propertyMetadata, dtoResult, requiredValidator); } } } }
Private Correspondence~Xtra~Going Off Half-cocked GET OFF ME! If one more person tries to fight with me… If my brother doesn’t STOP calling me to say how, if something happened down here and Chicago needed to be evacuated, I wouldn’t be able to get out (because of the bridge), and why I need to move to his house for a while… Don’t ever think you can reject my work as inappropriate. Or… I am more afraid of my own government and this militaristic security bullshit than I am of the Taliban. One pal told me that Reagan (the ketchup is a vegetable on school lunches president) had the Taliban to the White House and commended them for fighting the Russians. If you don’t stop… No I do not fly around the country to fuck my friends. I am not interested in doing a threesome with you and your live-in gf. So give up on that idea. Yes I have men friends and yes I like to dance naked but I am not a stripperchick. Look elsewhere. Bug me again and … I can’t sleep. I wake up out of night terrors. I had two of the dreams fully clear but I have forgotten them now. The one this morning was about being unable to wake up from a bad dream. Good God. Terror within fucking terror. Get out of my fucking brain or … If you don’t like the content on my websites. Don’t look, it’s that simple. Turn the channel or… I should stick my shrubs right up your ass. Shut up or… No I will not ever ever move to the land of goldsmith. Won’t happen and if it did… No more calls from anyone, or… I will claw YOUR EYES OUT. I have watched those fucking rabbit-sized birds called crows and I see how they do it… SO GET OFF ME!!!!!
The present invention relates to a process for purifying amino acid-containing solutions by electrodialysis, an amino acid-containing solution being employed which is obtained from a fermentation. Amino acids can be produced from a carbon source such as, for example, molasses and raw sugar by means of fermentation. The solutions generally accumulating in the fermentation contain in addition to about 10% by weight of amino acid large amounts of contaminants such as, for example, also biomass. According to the processes used up until now in accordance with the prior art numerous process steps are necessary for purifying this solution obtained from a fermentation in order to produce the amino acid in the commonly marketed form, for example as lysine hydrochloride. Usually, large amounts of salts such as, for example, ammonium sulfate accumulate, approximately 1 kg of ammonium sulfate per kg of amino acid being generated as a product of value. Additionally, large amounts of wastewater accumulate and have to be worked up and disposed of. A preferably commercially used process for working up discharges from amino acid fermentation is essentially based on ion exchange treatment. The discharges from the fermentation are mixed with acid and then loaded onto a cation exchange column or an anion exchange column. The amino acid in its ionic form displaces the corresponding ions of the cation or anion exchange column and thus is retained by the column. The biomass can be filtered off before or after the ion exchange treatment. The mother liquor obtained after passage still contains approximately 0.1% by weight of amino acid and a load of about 1 metric ton of salt, for example ammonium sulfate, per metric ton of amino acid. This solution can be disposed of by dumping at sea which is objectionable, in particular ecologically, owing to the high salt load of the solution to be dumped at sea. As an alternative to this, the mother liquor which contains essentially ammonium sulfate and biomass may be worked up in numerous evaporation and filtration stages, it being possible for ammonium sulfate to be retrieved. However, the accumulating mother liquor has still to be disposed of. Moreover, this procedure is very labor-intensive and has a high energy consumption. The amino acid retained on the ion exchange resin is eluted, for example, with aqueous ammonia. Ammonia is stripped off the accumulating eluate, large amounts of aqueous ammonia having to be evaporated. The eluted amino acid is then mixed with acid, for example hydrochloric acid, crystallized and dried. The amino acid obtained in this way is greater than 98.5% pure and is called xe2x80x9cfeed-gradexe2x80x9d amino acid. In order to obtain even less contaminated, so-called xe2x80x9cfood-gradexe2x80x9d or xe2x80x9cpharma-gradexe2x80x9d amino acid, feed-grade product has to be subjected to a further purification procedure, for example active carbon treatment and/or repeated crystallization. Further details with respect to the purification processes in accordance with the prior art described above can be found in the PERP report 5357. The specifications food-grade and pharma-grade used here refer to the relevant purity requirements according to the US FDA, where the appropriate standard for lysine HCl is to be understood correspondingly or analogously. According to this, the term xe2x80x9cwith high purityxe2x80x9d used here also refers to the food-grade or pharma-grade standard for lysine according to the US FDA and is in this context also used either correspondingly or analogously. Electrodialysis is a very elegant purification or separation process which can fractionate, inter alia, mixtures of amino acids. A process of this type is described, for example, by Sandeaux et al. in J. Chem. Technol. Biotechnol. 71 (1998), pp. 267 ff. According to this scientific publication, protein hydrolysates obtained by acidic hydrolysis of animal residues or human residues such as, for example, feathers or hairs are initially neutralized and decolorized by activated carbon and then subjected to a multistage electrodialysis, various fractions of the individual amino acids being obtained. WO 91/02584 describes a process for removing amphoteric compounds from aqueous solutions by means of 3-cycle electrodialysis with bipolar membranes. U.S. Pat. No. 5,002,881 describes a fermentation process for producing lactic acid by a combination of microfiltration, reverse osmosis and electrodialysis. U.S. Pat. No. 4,882,277 discloses a further process for removing organic acids from fermentation broths by means of anion exchange membranes and producing the free acid by bipolar membranes. The above summary of the prior art reveals that the purification of amino acids from discharges from fermentations has up until now merely been carried out by means of ecologically disadvantageous and/or costly processes. It was an object of the present invention to provide an improved process for purifying amino acid from discharges from fermentations. This object was achieved by applying electrodialysis to this problem. Accordingly, the present invention relates to a process for purifying amino acid-containing solutions by electrodialysis (d), an amino acid-containing solution being employed which is obtained from a fermentation for producing at least one amino acid. Using this process it is possible to avoid numerous process steps which are indispensable according to the processes of the prior art. Large amounts of ammonium sulfate or other extraneous salts are not generated inevitably in this case. Electrodialysis carried out in a suitable way makes it further possible to produce amino acid as free base or free acid. It is further possible to obtain high amino acid yields of preferably greater than 90%, further preferably greater than 95%, based on the employed amount of amino acid at high current densities and therefore correspondingly high capacities of the electrodialysis. Accordingly, the present invention also relates to the use of electrodialysis for purifying amino acid-containing solutions obtained from the fermentation up to an amino acid content of greater than 98.5% (% by weight). As stated above, the process according to the invention relates to the purification of amino acid-containing solutions which are obtained from the fermentation. It is possible to employ here generally all amino acid-containing solutions obtainable by the various fermentation processes. Further stages such as, for example, ion exchange treatment and/or crystallization may be carried out between the actual fermentation process and the electrodialysis, merely the resulting mother liquor then being treated by means of electrodialysis. Therefore the present invention also relates to a process comprising the following additional stages (a) to (c): (a) treatment by means of an ion exchanger of an amino acid-containing solution obtained from the fermentation for producing at least one amino acid, (b) crystallization of an amino acid-containing solution obtained in (a), where an amino acid-containing mother liquor is obtained, and (c) introduction of the amino acid-containing mother liquor obtained in (b) into an electrodialysis apparatus. Besides the mentioned process stages, further stages such as, for example, filtration before stage (a) may be carried out.
Embedded nanoparticle dynamics and their influence on switching behaviour of resistive memory devices. Resistively switching Conductive Bridge Random Access Memories (CBRAMs) rely on the controlled formation and dissolution of metallic filaments within a solid insulator, and are emerging building blocks for beyond von Neumann computing architectures and neuromorphic computing. A lack of understanding of the underlying switching mechanisms currently prevents further device utilisation and optimisation. We present a study of lateral and vertical CBRAM model devices that allow us to systematically relate important switching properties and their statistics to a direct characterisation of their critical switching region by scanning and transmission electron microscopy, i.e. to the physical nature of metal filaments and inclusions on all relevant length scales. We find that filaments are composed of metallic clusters and show how filament dynamics link to migration effects of embedded nanoparticles under voltage bias stress. The formation of metal clusters is promoted by a dynamic interplay of cation mobility and redox rate during switching. These clusters are not completely removed from the switching material matrix upon RESET and appear to grow by consumption of smaller clusters. We discuss in detail the interfacial stress of the nanoparticles in the context of their interaction with the switching material and ambient atmosphere. This allows us to consistently interpret previous literature and to suggest future device improvements.
A nursing home rotation in a family practice residency. A nursing home rotation can be a complementary component of geriatrics education in a family practice residency curriculum. Using nursing homes in teaching geriatrics has been done for some time but has of late received more emphasis. This increasing emphasis has been brought about by the growing health care needs of an aging population and a concomitant focus on education in geriatrics. If implementation of a nursing home rotation is contemplated, both the positive and negative aspects of such action as it relates to the residents, the nursing home, and the nursing home patients should be explored. The rotation as incorporated into the geriatrics curriculum of the Family Practice Residency, Knoxville Unit, University of Tennessee College of Medicine, involves all second-year and third-year residents in the medical care for patients of a 222-bed long-term care facility. From an educational standpoint, overall evaluation of the rotation reflects satisfaction. The experience exemplifies personal and comprehensive continuity of patient care. Other educational benefits include desensitization to the nursing home environment, understanding the kinds of medical care that can be delivered in this setting, and appreciation for the cost not only to the patient and the family but also to the medical care system as well.
Q: Creating a custom plot I need to create a custom plot (see image) where each circle is a variable and it's color represents the value of it. I need too some correlation between the value of the variable and it's color, so if i change the value of the variable it also changes the color of it's circle in the plot. I don't have no idea where can I learn this. https://i.stack.imgur.com/9PnZq.png A: Here is an example of coloring circles depending on some value. The code creates lists of 20 x and y positions, and a list of 20 random values between -1 and 1. Depending on their value, the circles are colored red to yellowish to green. from matplotlib import pyplot as plt import random x = [i // 4 for i in range(20)] y = [i % 4 for i in range(20)] z = [random.uniform(-1, 1) for i in range(20)] # create a scatter plot for the given x,y positions, make them quite large, color them # using z and the Red-Yellow-Green color map, give them a black border plt.scatter(x, y, s=400, c=z, cmap='RdYlGn', ls='-', edgecolors='black') plt.colorbar() # add a colorbar to show how the values correspond to colors plt.xlim(-0.9, 4.9) # because of very large scatter dots, the default limits are too narrow plt.ylim(-0.9, 3.9) plt.show() # display the plot on the screen Here is a possible approach to draw a 12x4 grid with 3 values: from matplotlib import pyplot as plt import random num_columns = 12 num_rows = 4 num_values = 3 x = [[j for j in range(num_columns)] for i in range(num_rows)] y = [[i for j in range(num_columns)] for i in range(num_rows)] z = [[random.randint(1, num_values) for j in range(num_columns)] for i in range(num_rows)] plt.scatter(x, y, s=400, c=z, cmap='RdYlGn', ls='-', edgecolors='black') cbar = plt.colorbar(ticks=range(1, num_values + 1)) cbar.ax.set_yticklabels([f'Value {v}' for v in range(1, num_values + 1)]) plt.xlim(-0.5, num_columns - 0.5) plt.ylim(-0.5, num_rows - 0.5) plt.xticks(range(num_columns)) plt.yticks(range(num_rows)) plt.show()
Podcast on the Brink is back for a new episode with host Jerod Morris of The Assembly Call. The show is available each Wednesday during the offseason. You can access a full archive of episodes here. In this week’s edition of the show, Morris and Inside the Hall editor Alex Bozich are joined by former IU guard Tom Coverdale and the trio discusses a variety of topics, including: · His Indiana career and whether it turned out how he expected when he originally signed with the Hoosiers · The differences between Bob Knight and Mike Davis · Indiana’s run through the 2002 NCAA tournament · The recent Indiana basketball reunion that took place in Bloomington · Why the once-promising 2002-2003 season ended in disappointment · A memorable Knight story that he’s never shared before And plenty more. As always, feel free to drop the show a note at [email protected]. Listen in the audio player below, download the episode, subscribe via iTunes or subscribe to the RSS feed. (Photo credit: @IndianaMBB on Twitter) Filed to: Tom Coverdale
#include "cgal.h"
Masuk High School Masuk High School is a public high school in Monroe, Connecticut, United States, and includes grades 9 through 12. It is located on Connecticut Route 111 (Monroe Turnpike) in Monroe, between Old Coach Road and Pond View Road. Monroe Alternative High School is the only other Public High School in Monroe. The school has an indoor swimming pool. History Since its founding in 1958 from 32 acres of land donated by Semyon Masuk, Masuk High School has cooperated with many other towns in the area. Students from Bridgeport, Connecticut and Oxford, Connecticut have attended Masuk in the past, although Oxford's last class of Masuk students graduated in June 2009. The school mascot is a black panther. In 1973, officials at the school allowed students to refuse to pledge allegiance to the American flag. The Connecticut Veterans of Foreign Wars objected to this decision. Notable alumni Mike Gminski, Class of '76, Played Basketball for Duke University, was selected in the first round of the 1980 NBA draft by the New Jersey Nets, played in the NBA for 14 years with the Nets, 76ers, Hornets and Bucks. References External links Masuk High School Category:Monroe, Connecticut Category:Schools in Fairfield County, Connecticut Category:Public high schools in Connecticut
Q: Are freshwater fish considered seafood? Can freshwater fish, crayfish, etc. still be referred to as seafood or is there a special term? A: In common usage seafood is any "edible aquatic life" - http://en.wikipedia.org/wiki/Seafood Also a lot of seafood is grown in "farms" so we may have to invent a new term for sea/river/tank foods! A: Yes. This article on Britannica online explains. ARTICLE from the Encyclopædia Britannica seafood edible aquatic animals, excluding mammals, but including both freshwater and ocean creatures. Seafood comprises all bony fishes and the more primitive sharks, skates, rays, sawfish, sturgeons, and lampreys; crustaceans such as lobsters, crabs, shrimps, prawns, and crayfish ; mollusks, including clams, oysters, cockles, mussels, periwinkles, whelks, snails, abalones, scallops, and limpets; the cephalopod mollusks—squids, octopuses, and cuttlefish; edible jellyfish; sea turtles; frogs; and two echinoderms—sea urchins and sea cucumbers. [Emphasis mine.]
Q: Beta Distribution Sufficient Statistic So I have this homework problem that I am struggling a little bit with coming to a solid answer on. The problem goes like this: Suppose X~Beta($\theta,\theta), (\theta>0)$, and let $\{X_1, X_2 , \ldots , X_n \}$ be a sample. Show that T=$\Pi_i(X_i*(1-X_i)$ is a sufficient statistic for $\theta$. I started out with my Beta distribution as: $f(x_i,\theta)=\frac{\Gamma(\alpha + \beta)}{\Gamma(\alpha)\Gamma(\beta)}x^{(\alpha-1)}(1-x)^{(\beta-1)}$ $=\frac{\Gamma(\theta + \theta)}{\Gamma(\theta)\Gamma(\theta)}x_1^{(\theta-1)}(1-x_1)^{(\theta-1)} ***\frac{\Gamma(\theta + \theta)}{\Gamma(\theta)\Gamma(\theta)}x_n^{(\theta-1)}(1-x_n)^{(\theta-1)} $ $=\frac{\Gamma(2\theta)}{\Gamma(\theta)^2}x_1^{(\theta-1)}(1-x_1)^{(\theta-1)} ***\frac{\Gamma(2\theta)}{\Gamma(\theta)^2}x_n^{(\theta-1)}(1-x_n)^{(\theta-1)}$ $={(\frac{\Gamma(2\theta)}{\Gamma(\theta)^2})}^n \Pi_i (x_i)(1-x_i)^{(\theta-1)}$ I know that in order for my statistic to be sufficient by factorization, I need to have a $g(T,\theta)$ and a $h(x_1,x_2,...,x_n)$. What I have above is my $g(T,\theta)$, but I am not so sure about my $h(x_1,x_2,...,x_n)$. I have seen other places where the suggestion is to use 1 for my $h(x_1,x_2,...,x_n)$. Could I do this here with this problem? It just seems a little too easy to do that, but I will be happy if it is that easy. If anyone could let me know, that would be greatly appreciated. A: If $ X\sim Beta(\alpha,\beta)$, then $f(x;\alpha,\beta) = {\Gamma(\alpha+\beta) \over \Gamma(\alpha)\Gamma(\beta)}x^{\alpha-1}(1-x)^{\beta-1} $ and $ f(\underline x;\alpha,\beta) = ({\Gamma(\alpha+\beta) \over \Gamma(\alpha)\Gamma(\beta)})^{n}(\prod x_{i})^{\alpha-1}(\prod (1-x_{i}))^{\beta-1}$ Thus, the sufficient statisitcs is $(\prod x_{i},\prod (1-x_{i}))$ by Fisher–Neyman factorization theorem. Here $ h(\underline x) = 1$. If $ \alpha = \beta $, then sufficient statistics is $(\prod x_i(1-x_i))$. Again $h(\underline x) = 1$
1. Field of the Invention The present invention relates to a valve system for an engine. In particular, the present invention relates to an improved valve system for an engine, wherein a rocker arm is interlocked with an engine valve and is supported by a rocker shaft fixedly supported by a cylinder head such that it is rockable with the rotation of a camshaft of the engine. 2. Description of Background Art A valve system of this type has been known, for example, from Japanese Patent Laid-open No. Hei 2000-110516. The above-described background art valve system is of an overhead cam type, wherein a camshaft is disposed over a cylinder head. In this valve system, to transmit rotational power of the crankshaft to the camshaft at a reduction ratio of 1/2, it is required to ensure a space on one end of the crankshaft for disposing power transmission means, such as a cam chain. This results in the width of the engine increasing in the direction along the axial line of the crankshaft. Accordingly, the weight of the engine is increased. In view of the foregoing, the present invention has been made, and an object of the present invention is to provide a valve system of an engine, which is capable of reducing the size and weight of the engine. To achieve the above object, according to a first aspect of the present invention, a valve system for an engine includes a crankshaft rotatably supported by a crankcase such that it is connected to a piston slidably fitted in a cylinder bore. A camshaft has an axial line parallel to an axial line of the crankshaft and is interlocked with the crankshaft at a reduction ratio of 1/2. A rocker arm is interlocked with engine valves and is supported by a rocker shaft fixedly supported by a cylinder head such that it is rockable with the rotation of the camshaft. The camshaft disposed on one side of the crankshaft is rotatably supported by the crankcase. The posture of the rocker shaft is set to have an axial line crossing the axial line of the crankshaft on the projection plane perpendicular to an axial line of the cylinder bore. An input arm extending on the projection plane from the rocker arm to the camshaft side is provided on the side of the rocker arm which is rockably supported by the rocker shaft. A pull rod reciprocating in the axial direction with the rotation of the camshaft is connected to the input arm in order to rock the rocker arm in the valve opening direction when the pull rod is moved to the camshaft side. With this configuration, since the posture of the rocker shaft is set to have an axial line crossing the axial line of the crankshaft on the projection plane perpendicular to an axial line of the cylinder bore, a space required for disposing the rocker shaft, the rocker arm, and the like constituting part of the valve system can be made smaller in the direction along the axial line of the crankshaft. Also, since the input arm extends from the rocker arm to the camshaft disposed on one side of the crankshaft, and the pull rod reciprocating in the axial direction with the rotation of the camshaft is connected to the input arm, it is not required to enlarge the width of the cylinder head in the direction along the axial line of the crankshaft for disposing the pull rod. This results in the possibility of reducing the size and weight of the engine in the direction along the axial line of the crankshaft. To achieve the above object, according to the second aspect of the present invention, a valve system for an engine includes a crankshaft which is rotatably supported by a crankcase such that it is connected to a piston slidably fitted in a cylinder bore. A camshaft has an axial line parallel to an axial line of the crankshaft and is interlocked with the crankshaft at a reduction ratio of 1/2. A first rocker arm is interlocked with first engine valves and a second rocker arm is interlocked with second engine valves different in kind from the first engine valves. The first and second rocker arms are respectively supported by a first rocker shaft and a second rocker shaft, which are fixedly supported by a cylinder head, such that they are rockable with the rotation of the camshaft. The camshaft is disposed on one side of the crankshaft and is rotatably supported by the crankcase. The first rocker arm corresponding to a pair of the first engine valves and the second rocker arm corresponding to a pair of the second engine valves are disposed in the cylinder head such that they face the combustion chamber. The first and second rocker arms are rockably supported by the first rocker shaft and the second rocker shaft, respectively. The first and second rocker shafts have axial lines crossing the axial line of the crankshaft on the projection plane perpendicular to an axial line of the cylinder bore and are disposed in parallel to each other. A first input arm and a second input arm extend on the projection plane from the first rocker arm and the second rocker arm to the camshaft side and are provided on the first rocker arm and the second rocker arm, respectively. A push rod reciprocating in the axial direction with the rotation of the camshaft is connected to the first input arm in order to rock the first rocker arm in the valve opening direction when the push rod is moved on the side opposite to the camshaft. A pull rod reciprocating in the axial direction according to the rotation of the camshaft is connected to the second input arm in order to rock the second rocker arm in the valve opening direction when the pull rod is moved on the camshaft side. With this configuration, since the pair of first engine valves and the pair of second engine valves are disposed in the cylinder head such that they face the combustion chamber, it is possible to improve the suction efficiency and increase the output torque in a low speed rotational range. Since the postures of the first and second rocker shafts are set to have axial lines thereof crossing the axial line of the crankshaft on the projection plane perpendicular to the axial line of the cylinder bore, a space required in the cylinder head for disposing the first and second rocker shafts, the first and second rocker arms, and the like constituting part of the valve system can be made smaller in the direction along the axial line of the crankshaft. Furthermore, since the input arms extend from the first and second rocker arms to the camshaft disposed on one side of the crankshaft and the pull rod and the push rod reciprocating in the axial direction according to the rotation of the camshaft are connected to the input arms of both the rocker arms, it is not required to enlarge the width of the cylinder head in the direction along the axial line of the crankshaft for disposing the pull rod and the push rod. Accordingly, a drive system between the camshaft and the rocker arms can be disposed in good balance. This results in the possibility of reducing the size and weight of the engine in the direction along the axial line of the crankshaft. Further scope of applicability of the present invention will become apparent from the detailed description given hereinafter. However, it should be understood that the detailed description and specific examples, while indicating preferred embodiments of the invention, are given by way of illustration only, since various changes and modifications within the spirit and scope of the invention will become apparent to those skilled in the art from this detailed description.
Toronto is in a better rebuilding spot due to the fact that we have better youngsters. Cleveland's only 2 promising young players are boobie gibson and JJ hickson (who arent even that good to begin with), other than that, they have nothing else. Boobie Gibson? LOOOOLLLL I swear that kid has no potential and is already in his prime. JJ hickson wouldn't even be starting on a good team(even though he did a little bit in Cleveland last year, but that's because they had no one else.) Cavaliers are in a HORRIBLE spot in terms of young talent and contracts. They basically have no one to look forward to in the future and they still have to pay Williams', Jamison's and Varejoe's contracts off for the next few years. Toronto. I would love to have the 1st pick that it looks like Cleveland will get because you want to select the most electrifying player available when your franchise is that low. But Toronto gained an advantage early by being open to the idea Bosh would walk and putting in place some contingencies. Cleveland waited 'til their public spanking to react. Also, Bosh was Toronto's best player while LeBron was everything in Cleveland. Would they trade their entire team for this one? Absolutely. Toronto. I would love to have the 1st pick that it looks like Cleveland will get because you want to select the most electrifying player available when your franchise is that low. But Toronto gained an advantage early by being open to the idea Bosh would walk and putting in place some contingencies. Cleveland waited 'til their public spanking to react. Also, Bosh was Toronto's best player while LeBron was everything in Cleveland. Would they trade their entire team for this one? Absolutely. If they didn't it's far from guaranteeing them the #1 pick. Just saying. How far can you fall if you have the #1 draft seeding anyway? Is it that you can only drop one spot if someone with lower odds jumps up and wins? Either way, Miami needs to do some losing so that late pick might be combined with something/someone to move up with the 2nd 1st rounder. Now they are saddled with Kleiza's busted knee . He was someone who could have been moved to a team that needs a role player. Stupid question. Toronto all the way. Who said Boobie is a youngster? The guy already showed everything he can. JJ? You know, CAVS fans loves JJ almost like you guys love Bargnani. JJ Hickson can't rebound, defend or catch the ball, he is frustrating. Eyenga and Harris are the best young players there, what else to say? Mo is terrible play maker, a lot o fans can't stand him. Don't forget Jamison. No one wants his contract, he is obstacle to rebuilding team.
A two-decade-old crackdown on smog and soot under the Clean Air Act will yield about $2 trillion in annual benefits by 2020, according to a study (pdf) that was released by U.S. EPA this morning and was touted as proof that the embattled agency's rules are an economic boon for the American people. Those rules prevented an estimated 160,000 deaths last year, according to the analysis, and within a decade, that number is projected to rise to about 230,000. That year, the new pollution controls will prevent an estimated 200,000 cases of heart disease, 2.4 million asthma flare-ups and 22.4 million missed school and work days. The study was ordered by the 1990 amendments to the Clean Air Act, which were signed into law by President George H.W. Bush. Most of the stricter limits on smog and soot also date back to those amendments, which passed with support from both parties. In a statement today, EPA Administrator Lisa Jackson said the benefits of those rules are a testament to "the power of bipartisan approaches to protecting the health of the American people." "The benefits of avoiding early death, preventing heart attacks and asthma attacks, and reducing the number of sick days for employees far exceed costs of implementing clean air protections," she said. "These benefits lead to a more productive workforce, and enable consumers and businesses to spend less on health care -- all of which help strengthen the economy." The new study was touted by public health groups and environmentalists as proof that critics in Congress should let the agency continue with further curbs on smog, as well as greenhouse gases and toxic pollution. With the agency's top air pollution official headed to Capitol Hill this afternoon to testify on the new climate rules, the study will likely be used to shield against criticism from House Republicans. With the two houses of Congress working to strike a deal on a continuing resolution to keep the government funded for the next seven months, House leadership included a measure in their stopgap bill that would block EPA from regulating greenhouse gases. The House also voted to add an amendment with similar language, as well as several other riders that would block new air pollution rules. Those measures would be a hard sell in the Democratic-controlled Senate, and they were stripped from a two-week extension that was sent to the House floor and was closed to amendments. Regardless of whether they get into a spending bill, the measures are getting a push in both houses. Lawmakers such as Sen. John Barrasso (R-Wyo.), who has introduced a bill to block EPA and the rest of the federal government from limiting greenhouse gases, say the agency's rules are subverting the role of Congress. "They are doing this in defiance of the American people, who have made it so clear that they don't want cap-and-trade that even a Democrat-controlled Senate wouldn't pass it," he wrote in an op-ed that was published today in Human Events. "Yet the EPA plans to keep right on going, whether Americans like it or not." But environmental groups and many Democrats are trying to stave off those efforts, and they said the new study shows why. The benefits of these particular Clean Air Act rules outstrip the costs by a margin of 30-to-1, the studies show. "In this cynical era of government-bashing, it is stunning to see just how well a government program can work," said Frank O'Donnell, president of the advocacy group Clean Air Watch. "This is not only a ringing endorsement of the Clean Air Act, but can be read as a stinging rebuke to those on Capitol Hill who would tamper with it." Click here (pdf) to read the report. Copyright 2011 E&E Publishing. All Rights Reserved.
Boycotts businesses that are laying off workers in turn making them lay off more workers 138 shares
Radicular pain caused by synovial cyst: an underdiagnosed entity in the elderly? Synovial cyst is a recognized but infrequent cause of nerve root or spinal canal compression. The authors undertook a review of 839 decompressive spinal procedures performed over a 5-year period. They found seven cases in which the symptoms were caused by synovial cysts. Six of these cases were in a subgroup of 80 patients who were older than 60 years of age, which represents 7.5% of the total for this age group. More than 200 cases of this abnormality have been reported in the world literature, but the incidence, prevalence, and natural history remain unknown. The authors propose that the incidence of synovial cysts may be more common than recognized in the elderly and suggest that preoperative diagnosis may help limit the extent of the surgical approach.