'use strict';

var mixin = require('./util/mixin');

var defaults = module.exports = {

    name: 'PPMiniCart',

    parent: (typeof document !== 'undefined') ? document.body : null,

    action: 'https://www.paypal.com/cgi-bin/webscr',

    target: '',

    duration: 30,

    template: '$TEMPLATE$',

    styles: '$STYLES$',

    strings: {
        button: 'Check Out with <img src="//cdnjs.cloudflare.com/ajax/libs/minicart/3.0.1/paypal_65x18.png" width="65" height="18" alt="PayPal" />',
        subtotal: 'Subtotal:',
        discount: 'Discount:',
        empty: 'Your shopping cart is empty'
    }

};

/**
 * Mixes in the user config with the default config.
 *
 * @param {object} userConfig Configuration overrides
 * @return {object}
 */
module.exports.load = function load(userConfig) {
    return mixin(defaults, userConfig);
};


Assessment of health-related quality of life of patients with inflammatory bowel diseases in Eastern Province, Saudi Arabia.
Inflammatory bowel disease patients have impaired quality of life with physical, social and emotional dysfunction. This project aimed to assess the effects of socio-demographic and clinical variables on quality of life and to identify its predictors. In a cross-sectional paper-based study, 50 consecutive non-selected patients attending the teaching hospital completed a disease-specific McMaster quality of life tool. Socio-demographic and clinical data were collected from patients' records. The t-test and Mann-Whitney test were used to determine the probability of significant differences between quality of life domains and independent variables. Multiple linear regression was used to determine quality of life predictors. Younger and highly educated patients had higher social scores. Those with shorter disease durations had higher systemic scores. Patients in remission had higher systemic, social, bowel and overall scores. Relapse was a significant predictor of decreased systemic, social, bowel and overall scores. Long disease duration was a significant predictor of decreased systemic and overall scores. Younger age at disease onset was a significant predictor of decreased emotional score. However, high education was a significant predictor of improved social score. Relapse, long disease duration, low education and young age at disease onset were associated with low quality of life. Prospective studies should investigate how interventions addressing these predictors may lead to improved quality of life.


Open this photo in gallery In an undated handout image, the primate researcher Dorothy Cheney sits with baboons at the Moremi Game Reserve in Botswana. HANDOUT/Handout via The New York Times

Dorothy Cheney, whose careful research into how primates live and communicate revealed the surprising complexity of their thought processes and social structures, died on Nov. 9 at her home in Devon, Pa. She was 68.

Her husband and research partner, Robert Seyfarth, said the cause was breast cancer.

Story continues below advertisement

“Cheney was a spectacular scientist,” Robert Sapolsky, a professor of biology and neurology at Stanford University and the author of books such as A Primate’s Memoir, said by e-mail. “Along with Robert Seyfarth, she did wonderfully clever, elegant field experiments that revealed how other primates think about the world – showing that they think in far more sophisticated and interesting ways than people anticipated.”

Rather than doing their research in laboratories, Dr. Cheney and Dr. Seyfarth spent long stretches in the wilds of Africa and elsewhere, studying gorillas, baboons, vervet monkeys and other animals.

One of their best-known experiments, conducted in Kenya in 1977, showed that vervets made distress sounds to convey a specific message about a given threat. They hid loudspeakers in bushes, played recorded sounds of vervets and watched the reaction. A particular bark sent the animals scurrying up trees because it was a warning about leopards; a low-pitched staccato noise had them looking skyward for predatory eagles.

They summarized their research in their first book, How Monkeys See the World: Inside the Mind of Another Species (1990).

Later research in Botswana included insights into the hierarchical nature of baboon societies and its possible evolutionary effects.

“Because Western scientists learned about primates by examining corpses or observing single animals brought home as pets,” they wrote in their 2007 book, Baboon Metaphysics: The Evolution of a Social Mind, “few if any ever learned what can be discovered only through long, patient observation: that the most human features of monkeys and apes lie not in their physical appearance, but in their social relationships.”

Dorothy Leavitt Cheney was born Aug. 24, 1950, in Boston. Her father, Edward, was a Foreign Service officer, and her mother, Sally (Leavitt) Cheney, was a translator.

Story continues below advertisement

Dr. Cheney spent parts of her childhood in Malaysia, Holland, India and Nicaragua. She graduated from Abbot Academy in Massachusetts in 1968 and earned a bachelor’s degree in political science at Wellesley College in 1972.

She had planned to go to law school. But her husband had applied to work with the noted zoologist Robert Hinde at Cambridge University, and when he had an opportunity to go to South Africa to study baboons, he suggested she come along.

“I thought, ‘What the hell, this could be fun for a year or two,’ so I decided to put off law school and join him,” she said in an interview for Proceedings of the National Academy of Sciences. “It was a transformative experience.”

After 18 months, she applied to study with Prof. Hinde as well. She received a PhD in zoology at Cambridge in 1977.

She and her husband were assistant professors at Rockefeller University in New York, then in 1981 joined the faculty at the University of California, Los Angeles. In 1985, they moved to the University of Pennsylvania, where, at her death, Dr. Cheney was a professor of biology.

Dr .Seyfarth, in an e-mail interview, said theirs was not one of those partnerships in which each person had a defined role.

“Our scientific contributions are hard to separate because the genesis of our ideas and experiments quickly became lost in the mists of conversation,” he said. “One of us had an idea, the other critiqued it, and back and forth it went until it finally took shape and neither of us remembered or cared who took credit for what.”

In addition to her husband, Dr. Cheney leaves her daughters, Caroline Cheney Roberts and Lucia Hall Seyfarth; three siblings; three step-siblings; and a granddaughter.


The video clip test.h264 is (c) copyright 2008, Blender Foundation / www.bigbuckbunny.org


---
abstract: 'The behavior of geodesic curves on even seemingly simple surfaces can be surprisingly complex. In this paper we use the Hamiltonian formulation of the geodesic equations to analyze their integrability properties. In particular, we examine the behavior of geodesics on surfaces defined by the spherical harmonics. Using the Morales-Ramis theorem and Kovacic algorithm we are able to prove that the geodesic equations on all surfaces defined by the sectoral harmonics are not integrable, and we use Poincaré sections to demonstrate the breakdown of regular motion.'
address: |
    Department of Mathematics, University of Portsmouth,\
    Portsmouth PO1 3HF, United Kingdom
author:
- 'Thomas J. Waters'
bibliography:
- 'geobib.bib'
title: Regular and irregular geodesics on spherical harmonic surfaces
---

geodesic ,integrability ,differential Galois theory ,spherical harmonics ,Kovacic algorithm ,Morales-Ramis

Introduction
============

The study of the qualitative behavior of geodesics goes back to the beginnings of differential geometry; in fact Clairault’s relation dates from the 1740’s. One of the many interesting features of the geodesic equations is their complexity: how can we solve such difficult nonlinear differential equations, and indeed what does it mean to ‘solve’ a differential equation at all? In the general development of Lagrangian/Hamiltonian dynamics the issue of integrability came to the fore, and the use of first integrals to solve a dynamical system via quadratures was developed. By integrability here we mean intebrability in the sense of Louiville: a Hamiltonian system with $n$ degrees of freedom is Louiville integrable if there exist $n$ independent first integrals of the motion in involution (vanishing pairwise Poisson brackets). This formalism in turn lead to the consequences of non-integrability, the onset of chaos and the celebrated KAM theory. For a particularly interesting introduction to this topic see Berry [@berry], McCauley [@mccauley] or José and Saletan [@jose].

The integrability of the geodesic equations on some surfaces, and therefore the regularity of the geodesic trajectories, has been well understood for many years. Clairault’s relation [@docarmo] provides a second integral for surfaces of revolution, and Jacobi [@kling] integrated the triaxial ellipsoid. These results have been extended to $n$-dimensional ellipsoids and to quadrics in general (see Audin [@audin]), where interestingly degenerate cases can prove more difficult to analyse (see Davison et al [@davison]). Recently, the integrability of the geodesic equations has been demonstrated for more abstract manifolds, defined in terms of Lie groups (see for example Thimm [@thimm]). Aside from being interesting in their own right, the geodesics of a manifold also have some useful applications. For example, Maupertius’s principle [@bols] relates the dynamics on an isoenergetic level of any mechanical system to the geodesics of a manifold, and the relativistic formulation of gravity dictates that massive particles move along the timelike geodesics of spacetime [@wald].

There are many powerful results regarding the non-integrability of the geodesic flow[^1] on manifolds of a certain class, for example a theorem of Kolokol’tsov [@kolok] says that two-dimensional compact surfaces of genus $g>1$ do not admit geodesic flows that are integrable with a second integral polynomial with respect to the momenta (see Bolsinov [@bols2] for a review and references). What’s more the integrable geodesic flows on surfaces with $g=0,1$ with second integrals either linear or quadratic in the momenta are completely described. Nonetheless, new examples of integrable geodesic flows with second integrals cubic in the momenta have recently been found (see for example Dullin and Matveev [@dullin]) and the possibility of non-polynomial, and in particular meromorphic second integrals, is open.

A very significant recent development with regards integrability has been the theorem of Morales Ruiz and Ramis [@mrthm1; @mrthm2]. This theorem provides a link between the question of whether a nonlinear Hamiltonian system is [*integrable*]{} (with meromorphic first integrals) with whether the variational equations of a non-trivial solution to the Hamiltonian system are [*solvable*]{}. This is a great advance as the variational equations are linear with variable coefficients, and the solvability of equations of this type may be addressed using differential Galois theory. This approach has proved very successful (we give here only some examples): in Morales Ruiz and Ramis [@mrthm2] the authors use this formalism to prove the non-integrability of certain problems from mechanics and celestial mechanics; in Morales Ruiz et al [@simon] the non integrability of Hill’s problem is shown; in Pujol et al [@sam] the non-integrability of the swinging Atwood’s machine is demonstrated; in Acosta-Humánez et al [@humanez] some problems in celestial mechanics are studied and in Bardin et al [@bardin] the generalized Jacobi problem is studied. In the majority of these papers, the solvability of the variational equations is determined using Kovacic’s algorithm, and this is the approach we will follow in this work, with a description of the algorithm and relevant references given in Section 4.

To the best of our knowledge this powerful Morales-Ramis formalism has not been applied to the study of geodesics on manifolds and their integrability properties, and the approach taken in this work is novel in this respect. In the following we will examine the properties of geodesics on surfaces defined in terms of the spherical harmonics, and we shall rigorously prove using the Morales-Ramis theorem the non-integrability of the geodesic equations on surfaces defined in terms of sectoral spherical harmonics. Thus we present a two-parameter family of surfaces which appear very simple and symmetrical and yet have complex and indeed chaotic geodesic curves on them; this is a novel addition as the surfaces for which non-integrability of the geodesic flow has been rigorously proved is small. Finally, we will also use Poincaré sections to display the breakdown of regular motion as well as to understand the various families of closed geodesics on the surfaces; again this approach is novel in the case of geodesic flows.

The layout of the paper shall be as follows: In Section 2 we review the formulation of the geodesic equations and describe the classes of surfaces which will be examined. In Section 3 we use Poincaré sections to exhibit the breakdown in regular motion suggesting non-integrability, as well as describe the main families of closed geodesics on the surface. Finally in Section 4 we will review some necessary theory and prove the main result: the non-integrability of the geodesic equations on sectoral harmonic surfaces with $n>1$.

Conclusions
===========

The application of Morales-Ramis theory and Poincaré sections, two techniques most often seen in the realm of celestial mechanics and mechanical systems, to study the integrability of geodesic flow presents many interesting possibilities. By choosing a specific class of surfaces to analyze we can rigorously prove the non-integrability of the geodesic equations. It would be of interest to extend the results of this work to examine further surfaces; for example the tesseral harmonics mentioned in Section 2 again have (meridianal) planes of symmetry, and the NVE will have coefficients that contain Legendre polynomials, and in general, it would be very informative if we could examine arbitrary surfaces with a plane of symmetry and try and arrive at some obstructions to integrability. We note that the presence of a plane of symmetry makes the decoupling of the NVE straightforward, however Morales Ruiz [@morruiz] outlines a procedure in the absence of an invariant plane. The completeness of the spherical harmonics means that surfaces of a very broad class can be decomposed into a set of spherical harmonics, and perhaps by analyzing these individually we can make some conclusions about their sum. Care must be taken however: the triaxial ellipsoid can be decomposed into a set of (infinite) spherical harmonics, each of which would likely have non-integrable geodesic flow, and yet their recombination gives a surface which [*is*]{} integrable. A further issue to consider is how the surface in question is described; the parametric description of the harmonic surfaces led easily to the calculation of the geodesic equations and in particular the separation of the normal variational equation. If the surface were defined in algebraic form, as is more suited to the double torus for example, this separation may be more problematic. Finally, this subject provides an interesting and fruitful combination of techniques from dynamical systems theory, differential geometry and differential Galois theory.

Acknowledgements
================

The author wishes to thank the School of Mathematics, National University of Ireland, Galway, where some of this work was carried out; Dr. Sergi Simon for useful conversations; and finally the referees for their important and constructive comments.

Meridianal sections
===================

The analysis above would carry through were we to use one of the meridianal planes instead of the equatorial plane, with two points to note:

1.  When drawing the Poincaré sections, the fact that $\phi=$constant is only a half plane complicates matters. Better to rotate the coordinate system (or surface) to make the meridian an equator. For this we need to rotate the surface about the $x$-axis, and for this we define a new set of coordinates $\vartheta,\varphi$ by $$\sin\theta=\sqrt{1-\sin^2\vartheta
    \sin^2\varphi},\quad \sin\phi=\frac{\cos\vartheta}{\sin\theta},
    \quad \cos\phi=\frac{\sin\vartheta \cos\varphi}{\sin\theta}.$$ Now to write the $n$th sectoral harmonic we expand $\cos(n\phi)$ and then make the replacement; for example, the 3rd sectoral harmonic changes as $$\begin{aligned}
     \hspace{-0.5cm} \sin^3\theta \cos(3\phi)=\sin^3\theta
    (\cos^3\phi-3\cos\phi\sin^2\phi)=\sin^3\vartheta\cos^3\varphi-3\sin\vartheta\cos\varphi\cos^2\vartheta.\end{aligned}$$ An example of a Poincaré section for this rotated surface is shown below; the same families of closed geodesics can be identified.

    ![Sample Poincaré section for the rotated $n=3$ sectoral harmonic surface with $\vep=0.1$. The elliptic nature of the equatorial geodesic (the fixed point at the centre of the plot) can be clearly seen.](merideps){width="80.00000%"}

2.  In deriving the variational equations we may linearize around a meridianal planar geodesic, to derive a normal variational equation of the form given in . In the case of an equatorial planar geodesic the denominators of the coefficients are at most quadratic in $z$, however in the case of a meridianal planar geodesic the denominators are polynomials of degree $2n+2$. While the singular points are still regular, the number, location and behaviour of the set of singular points will vary with $n$, complicating matters.

Coefficients of equation
=========================

$$\begin{aligned}
  \delta_1&=\frac{2}{n(\vep^2-1)}, \\
  \delta_{2/3}&=\pm\frac{8+n^2\pm 2\vep(8+4n+3n^2)+e^2(8+8n+5n^2+8n^3+4n^4)}{16\vep(1\pm\vep)^2 n^2}, \\
  \delta_{4/5}&=-\frac{1}{2n(1-\vep^2)^2}\left( \vep^2(1-2n^2)-1\pm\big[n(1+\vep^2)\sqrt{1+\vep^2(n^2-1)}\,\big]
  \right) \\ &\qquad -\frac{1}{8}\left(\frac{4}{a_{4/5}-a_1}+\frac{1}{a_{4/5}-a_2}+\frac{1}{a_{4/5}-a_3}-\frac{1}{a_{4/5}-a_{5/4}}
  \right),\end{aligned}$$

where the $a_j$ are as defined in ,.

Bibliography
============

[^1]: Technically, the geodesic flow is defined on the cotangent bundle whose projection onto the manifold gives the geodesic curves, however we will use these two tems interchangeably.


FAQ - No Category

Home Improvement: Repair and more

Buying a home is always associated with realising your American dream. But buying is just the beginning of this dream. In your home there is always something that could be better and closer to the ideal. If you spend a little time and money, you can bring your property to this ideal. Do you need this? Start by identifying the needs and requirements.

The following are typical reasons that encourage homeowners to change something in their home. You need to replace everything obsolete. If cooking equipment is used for decades, is it not time to update it? The need to replace pipes and equipment. When replacing a sink, toilet or bath, many people take this opportunity at the same time to rebuild the entire bathroom.

Ten tips to those who is selling a house fist time

At first the task seems daunting. You've never sold a house, the housing market is very complex, finally, what worked 10-20 years, now may not be working.

What do you do? I suggest 10 tips. 1. Believe that you can do it.

2. Decide on your goals. What interests you more - a higher sale price or the maximum amount on the check after selling a home? These two amounts will not always be the same. If you decide to spend money on home improvements, then the value of the home may increase. My advice is - to successfully sell a home, you should consider both the price and terms of the transaction. To do this you need a strong and experienced mediator. 3. Times have changed. The housing market has changed dramatically over the past 10 years. Buyers now use the Internet, have a right to inspect homes, and often hire a broker to purchase a home. As a result, buyers today are much better prepared than ever before. 4. Goods must sparkle and shine. Perhaps you find it hard to imagine the mountains of dusty fruit or rows of dusty cans at the grocery store. It will never happen, because the store knows how to market a product. Sellers of houses should do the same. Get rid of unnecessary items. Get your pantry in order. Make spring cleaning in the house. 5. Everything should be repaired. Buyers expect everything in the house to work. Inspections of houses are very common. Fix and paint everything that needs it, that way you will avoid many problems. 6. Think on-Broadway. Arrange a show for the buyer. If he gets into an environment where everything is arranged in its place, painted and looks good, his only question will be "When can I move in?" 7. What do you know about the market? Each city and region has its own characteristics of the real estate market. Your broker can explain current trends of real estate in your area - what sells what does not, and why. It is very important information for those wishing to get the most money on the best terms. 8. Do you have competitors? Your real estate will be competing with other houses attracting the attention of potential buyers. Ask your broker to tell you how to be competitive. 9. Is it not the right time? Real estate markets differ not only in place, but also in time. When interest rates are low, and companies and businesses are hiring new people, houses sell very well. It is important to be realistic and set realistic goals so that the house can get as much as possible on the market. 10. Make a plan. Marketing real estate involves a lot more than the sign outside the house and an ad in the newspaper. Successful brokers use a lot more techniques to attract potential buyers.

Rebuild or sell the house?

If you want to put the house up for sale, you should be very careful. Potential buyers may not like the changes you made. Do not forget that not all buyers share your tastes, and not everyone can like something on which you spent a lot of time and money. Below is a list of what they will enjoy: Additional bathroom or renovations of old Improved kitchen Adding a room Landscaping Adding a bedroom Adding a garage If you plan to stay in the house for a long time, you still should not overdo it with modifications. Maybe someday you'll still be selling the house, and even if your home is the best for the whole quarter, you will be hard to justify the higher price compared with the neighboring houses. Value of your home should not be above average by more than 20 percent. This means that investing $ 10,000 in kitchen renovations would be more justified than the hot tub.


Q:

When does UIViewAutoresizing flexible Height+Top or Height+Bottom ever make sense? What does it do?

What is the auto resizing behavior of a UIView that has UIViewAutoresizing Height+Top or Height+Bottom? Does this ever make sense? Does one of the margins or the view itself get precedence? I just discovered I had accidentally set a view's UIViewAutoresizing to UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleTopMargin, and that caused the view to resize to a 0 height when its parent resized.

A:

This is how autoresizing works:
Say the parent view has 400 height, and your view is set on y = 100, height = 200
That means, there's 100 pixels above your view, 200 pixels for your view, and 100 pixels below your view.
With flexibleHeight and flexibleTop, it means that when the parent view frame changes, it will maintain the bottom 100 pixels fixed, and split the remainder proportionally between the top margin and height
So, if you go from 400 height to 300 height on the parent, it means it will use 100 for the bottom margin and split the remainder 200 proportionally, leaving your y = 66.666 and height = 133.333
If you go from 400 height to 100 height, it will still use those 100 for the bottom margin, leaving 0 space for top margin and height, leaving your y = 0, height = 0


1. Field of the Invention
The present invention relates to page information collection programs, page information collection methods, and page information collection apparatuses for collecting page information from a web site, and particularly to page information collection programs, page information collection methods, and page information collection apparatuses for collecting page information controlled by a web application.
2. Description of the Related Art
If a web site is built, each page in the web site must be verified to see whether it has been created as planned. It would be hard to manually verify a massive web site or a web site having a complicated structure because of heavy use of web applications or the like. Therefore, systems have been designed to automatically verify a web site by performing automatic input to input fields in the web site and the like.
An automatic web-site verification system automatically collects information of each page in a target web site. Page collection is important if a web site is tested while the entire configuration of data and programs or web applications of the web site is not known.
One page may be recognized as a concrete target of an entry test only after page collection, for instance. Pages are often organized in such a manner that page B can be acquired just by using random data obtained on page A. A page that can be acquired only after log-in is an example. Each time page B is tested, page A must be acquired, so that a technology for automatically acquiring both page A and page B is desired.
A system has been provided to collect pages that can be referenced by following links from a given page in a web site. The user first enters information of a hyper text transfer protocol (HTTP) request for acquiring a base page. The system issues the HTTP request, analyzes an HTTP response, and creates an HTTP request group just from a group of new link information found in link information groups included in the HTTP response. The processing of issuing a request, analyzing a response, and creating a request group is repeated until all the HTTP request groups are issued. The response analysis and the subsequent processing can be cancelled for a page which can be reached by following a given number of links from the base page (refer to U.S. Pat. No. 6,584,569).
In page collection from a web site including web applications, these trade-offs must be considered: If a great number of links are followed, an enormous number of pages must be collected, providing an excessively heavy processing load; if a reduced number of links are followed, a great number of pages are missed, lowering the reliability of web-site verification.
Redundant page collection is avoided by following just a link appearing for the first time in the link information included in the collected page information. Whether a certain link is found for the first time is determined by comparing a combination of a uniform resource locator (URL) and a parameter including a query parameter, for instance. If the URL and the common-gateway-interface (CGI) query parameter of the target link information match those of the link information of a page acquired before, it is determined that the link information has ever been followed. A page indicated by the old link information will not be collected.
If the conformity of link information is judged just by an exact match of the combination of a URL and a parameter including a query parameter, a great number of similar pages would be collected. Suppose that a scheduler web site uses link information such as /foo.cgi?date=1 and /foo.cgi?date=2 to display user's timetable of a given day. The date is specified as the value of the query parameter in the link information. Because the pages for displaying the timetable of a day have the same structure, the pages of all dates need not be acquired. However, if exact matching for a combination of a URL and a parameter including a query parameter is performed to judge the conformity of link information, the pages of all dates would be acquired. As a result, a great amount of unnecessary page verification would decrease the processing efficiency of the system.
If the query parameter value is not compared, the pages of all dates will not be acquired with link information such as /foo.cgi?date=1 and /foo.cgi?date=2. This, however, can prevent a page having a different structure depending on the query parameter value from being collected even though such page should be checked.
Suppose that the link information to a page for viewing a specified timetable is /bar.cgi?action=view and that the link information to a page for editing a timetable is /bar.cgi?action=edit. The view page and the edit page have different page structures and must be collected as different pages to be verified.
If the link information is compared not in terms of the query parameter value but in terms of the combination of the URL and the query name, /bar.cgi?action=view and /bar.cgi?action=edit are assumed to be the same link information. Just either the view page or the edit page is acquired, and the other page that should be verified is missed.
Accordingly, a system which can collect all pages that should be checked and can minimize redundant collection of pages having identical data structures has been awaited.
Reacquisition of an identical page may be required in automatic web-site verification. A system for reacquiring a page stores the HTTP request issued for page collection, for instance. When the user specifies a page by entering an item such as a URL, the system issues the request that was used to acquire the page. Then, the system receives a response to the issued request and outputs the response.
If a significant HTTP request is output just by sending a plurality of HTTP requests in a given procedure (transaction processing, for instance), the system for reacquiring a page cannot reacquire a correct page. The system cannot automatically recognize the failure of page reacquisition and cannot automatically locate the request causing the failure. Consequently, manual verification must be conducted, putting an excessive load on the user.


ETHICS/MORALS/MORALE

Strictly speaking, ethics are beliefs: if you have poor ethics, you have lax standards; but your morals are your behavior: if you have poor morals, you behave badly. You can have high standards but still fail to follow them: strong ethics and weak morals. “Morale” formerly had both these meanings and you will find them attached to the word in some dictionaries, but you would be wise to avoid it in either of these senses in modern writing. By far the most common current use of “morale” is to label your state of mind, particularly how contented you are with life. A person with low morals is bad; but a person with low morale may be merely depressed.


/* Reset */

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
	margin: 0;
	padding: 0;
	border: 0;
	font-size: 100%;
	font: inherit;
	vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
	display: block;
}
body {
	line-height: 1;
}
ol, ul {
	list-style: none;
}
blockquote, q {
	quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
	content: '';
	content: none;
}
table {
	border-collapse: collapse;
	border-spacing: 0;
}

li  {list-style:none}
body                                        {overflow:hidden;}
#header                                     {height:40px;}
#top-logo                           		{position:absolute;top:5px;left:20px; opacity:.8}
#header-nav                         		{position:absolute;top:0;right:0;text-align:right;padding:10px 10px 0 0;}
#header .mobile-toggle						{background-image:url(images/toggle1.svg);background-color:transparent;background-size:100% 100%; width:32px;height:32px;position:absolute;top:10px;left:50%;margin-left:-25px;opacity: .35}
#header .mobile-toggle:hover				{opacity: 1}
#footer                                     {height:12px;padding:5px 0;}
#footer-logo                                {position:absolute;bottom:3px; right:0;opacity: .4}
#footer-logo:hover							{opacity: 1}

#header,#footer,#content                    {font-family:Helvetica, Arial;}
#content                                    {margin:10px 15px;box-shadow:0px 2px 30px;font-size: 18px;}

#header-nav input                           {background-color:transparent;background-size:100% 100%;width:30px;height:30px;cursor:pointer;margin:0 5px;border:solid 0 #fff;opacity: .5}
#header-nav input:hover						{opacity: 1}
#header-nav #docs-fullscreen                {background-image:url(images/fullscreen.svg);}
#header-nav #docs-fullscreen.is-fullscreen  {background-image:url(images/fullscreen.svg);}
#header-nav #docs-config                    {background-image:url(images/config.svg);}
#header-nav #docs-add-document              {background-image:url(images/add-document.svg);}
#header-nav #docs-morphology                {background-image:url(images/morphology.svg);}

.document-content                           {background:#fff;}
.document-container                         {-x-border:solid 1px #bbb;float:left;position:relative;margin:0;}
.document-header                            {border:solid 1px #aaa;background-color:#DDDCDA;height:25px;border-color:transparent #ccc #aaa transparent;border-width:1px 1px 1px 0;padding:5px 20px;}
.document-header-left                       {font-size:16px;text-align:left;position:absolute;top:6px;left:5px;z-index:2;}
.document-header-right                      {font-size:16px;-x-float:right;-x-width:100px;text-align:right;position:absolute;top:6px;right:5px;z-index:1;}
.document-header .document-header-input     {display:inline-block;vertical-align:top;}
.document-header .document-input            {width:135px;height:20px;font-size:12px;color:#bbb;border:solid 1px #999;margin:0;padding:0 4px;}

.document-header .document-header-selector  {position:absolute; width:35px; top:0; left:150px;}
.document-header .document-header-selector:after {content:'';position:absolute; right:-20px; z-index:-5; top:7px; border-left:4px solid transparent; border-right:4px solid transparent; border-top:6px solid #444;}

.document-header-selector span              {font-size:12px;width:47px;height:12px;color:#444;position:absolute;pointer-events:none;border:solid 1px #999;padding:4px;}
.document-header-selector .document-selector{width:55px;position:absolute;opacity:0;}
.document-header-button                     {background-color:transparent;background-repeat: no-repeat;text-indent:-9999px;width:25px;height:25px;margin:0 2px;border:solid 0 #fff;opacity: .4;}
.document-header-button:hover               {cursor:pointer;opacity: 1}

.document-search-button                     {background-image:url(images/search.svg);}
.document-info-button                       {background-image:url(images/info.svg);position: absolute;right:-95px;top:2px;width:19px;height:19px;border: 1px #999 solid; border-radius: 100%;opacity: .3}
.document-options-button                    {background-image:url(images/config.svg);}
.document-close-button                      {background-image:url(images/closepage.svg);}
.document-lock-button                       {background-image:url(images/lock.svg);}
.state-unlocked                             {background-image:url(images/unlock.svg);}
.document-audio-button                      {background-image:url(images/audio.svg);}

.document-content                           {position:relative;overflow:auto; -webkit-overflow-scrolling: touch;}
.document-wrapper                           {position:absolute;line-height:1.6;font-family:Helvetica, Arial;padding:10px 20px;}
.document-about                             {position:absolute;background:rgba(0,0,0,0.9);display:none;padding:15px;overflow-y:scroll;color:white;}
.document-about h1                          {line-height:1;margin:0 0 15px;}
.document-about p                           {line-height:1.5;margin:15px 0;}
.document-footer                            {color:#333;height:30px;overflow:hidden;text-overflow:ellipsis;font-size:12px;line-height:1.2;border:solid 1px #ccc;padding:4px 15px;}
.document-footer-resize                     {position:absolute;bottom:49px;height:5px;cursor:row-resize;font-size:1%;width:400px;margin:0;padding:0;}
.document-focused                           {-x-border:solid 1px #333;}

.chapter                                    {margin:5px 0;}
.verse-highlight                            {background:Gainsboro;-webkit-transition:all 1s ease-in-out;}
.word-highlight                             {background:Gold;}

.search-text                                {width:200px; font-size: 16px;}
.search-version 							{width: 55px;}
.search-result                              {overflow:hidden;font-size:13px;line-height:1.3;margin:0 0 6px;padding:4px 0;}
.search-result:hover                        {background:#FFF6C9;cursor:pointer;}
.search-result .verse                       {display:block;float:left;width:420px;}
.search-result .search-verse                {display:block;font-weight:bold;float:left;width:120px;}
.search-result .highlight                   {background:#FFC237;}

.document-navigation-window                 {position:absolute;border:2px solid #333;background:#222;border-radius:5px;width:300px;height:300px;top:0;left:0;display:none;font-size:12px;padding:5px;}
.document-navigation-window h3              {color:#fff;font-size:14px;height:20px;margin:0;padding:0;}
.document-navigation-list .nav-scroller     {height:280px;overflow-x:hidden;overflow-y:scroll;-x-border:solid 1px #222;background:#eee;color:#333; -webkit-overflow-scrolling: touch;}
.document-navigation-list .nav-scroller li  {cursor:pointer;}
.document-navigation-list .nav-scroller li:hover{background:#aaaaff;}

.book-list li                               {display:block;border:solid 1px #aaa;border-color:#ccc #333 #333 #ccc;padding:4px 0 4px 5px;}
.book-list li.selected                      {background:#ccccff;}

.chapter-list li                            {font-size:11px;line-height:1;float:left;width:24px;height:16px;border:solid 1px #aaa;text-align:center;padding:5px 0 2px;}

.config-options                             {clear: both;margin:0 0 20px;overflow: hidden; padding: 0 0 1px 0;}
.config-options h3							{margin:0 0 .5em;width:100%;border-bottom:thin solid gray;}
.config-options .config-option              {float:left;width:85px;min-height:20px;line-height:1;margin:0 5px 0 0;}
.config-options .config-option input{position:absolute;opacity:0;cursor:pointer;}
.config-options .config-option input:checked ~ label {color:darkred;}
.config-options .config-option span         {vertical-align:middle;}
.config-toggle                              {display: block;
width: 30px;
float: left;
margin: 0 10px 10px 0;}
#font-size									{font-weight: normal;}
#font-slider								{margin:10px 5px 5px 5px;border: solid 1px black;}
.config-toggle input                        {position:absolute;opacity:0;cursor:pointer;}

.config-toggle label 						{display:inline-block;background-size:100% 100%;text-indent:-9999px;width:30px;height:30px;margin:0 2px;cursor:pointer; border-radius: 3px;opacity: .5;box-shadow: 1px 1px 1px 1px rgba(0,0,0,.3);}
.config-toggle input:checked ~ label		{opacity: 1;}

label[for="config-verses"] 					{background-image:url(images/verses.svg);}
label[for="config-wordsofchrist"] 			{background-image:url(images/christwords.svg);}
label[for="config-chapters"] 				{background-image:url(images/chapter.svg);}
label[for="config-images"] 					{background-image:url(images/images.svg);}
label[for="config-video"] 					{background-image:url(images/video.svg);}
label[for="config-notes"] 					{background-image:url(images/notes.svg);}
label[for="config-maps"] 					{background-image:url(images/maps.svg);}
label[for="config-titles"] 					{background-image:url(images/titles.svg);}

.theme-demo                                 {display:inline-block;width:20px;height:30px;cursor:pointer;}
.config-fontfamily-default                        {font-family:Verdana, sans-serif;font-size:16px;}

.config-fontfamily-georgia .chapter               {font-family:Georgia, serif;}
.config-fontfamily-georgia                        {font-family:Georgia, serif;font-size:16px;}

.config-fontfamily-geneva .chapter                {font-family:Geneva, sans-serif;}
.config-fontfamily-geneva                         {font-family:Geneva, sans-serif;font-size:16px;}

.config-fontfamily-baskerville .chapter           {font-family:baskerville, serif;}
.config-fontfamily-baskerville                    {font-family:baskerville, serif;font-size:16px;}

/*

Verdana, Geneva, sans-serif;

*/

/* theme backgrounds */
label[class^="config-theme-"] 				{width:30px;height:30px;}

.config-theme-default,
.config-theme-default-demo1,
.config-theme-default .popup-window,
.config-theme-default #header                 {background-image:none; background:#333;}
.config-theme-default-demo2					{background:#ddd;}
.config-theme-default .document-header,
.config-theme-default .document-footer        { background-image:none; background:#ddd;
	background:rgb(238,238,238);
	background:-moz-linear-gradient(top,  rgba(238,238,238,1) 0%, rgba(204,204,204,1) 100%);
	background:-webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(238,238,238,1)), color-stop(100%,rgba(204,204,204,1)));
	background:-webkit-linear-gradient(top,  rgba(238,238,238,1) 0%,rgba(204,204,204,1) 100%);
	background:-o-linear-gradient(top,  rgba(238,238,238,1) 0%,rgba(204,204,204,1) 100%);
	background:-ms-linear-gradient(top,  rgba(238,238,238,1) 0%,rgba(204,204,204,1) 100%);
	background:linear-gradient(to bottom,  rgba(238,238,238,1) 0%,rgba(204,204,204,1) 100%);
	filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#cccccc',GradientType=0 );
	border-bottom:solid 1px #aaa;
	box-shadow:0 0 10px rgba(0,0,0,0.2);
}

.config-theme-steel,
.config-theme-steel-demo1,
.config-theme-steel .popup-window,
.config-theme-steel #header               {background:url(images/bg-dark.jpg);}
.config-theme-steel-demo2,
.config-theme-steel .document-header,
.config-theme-steel .document-footer      {background:url(images/bg-white.jpg);}
.config-theme-steel #content-wrap:before  { opacity:0}

.config-theme-brown,
.config-theme-brown-demo1,
.config-theme-brown .popup-window,
.config-theme-brown #header                 {background:url(images/bg-brown.jpg);}
.config-theme-brown-demo2,
.config-theme-brown .document-header,
.config-theme-brown .document-footer        {background:url(images/bg-graph.jpg);}

.config-theme-white,
.config-theme-white-demo1,
.config-theme-white .popup-window,
.config-theme-white #header                 {background:url(images/bg-grey.jpg);}

.config-theme-white-demo2,
.config-theme-white .document-header,
.config-theme-white .document-footer        {background:url(images/bg-white.jpg);}

.inline-icon                                {display:inline-block;width:20px;height:20px;cursor:pointer;border-radius:4px;margin-right:5px;opacity: .5}
.inline-icon:hover                          {opacity: 1;background-color:#ccc;}
.image-icon                                 {background-image:url(images/images.svg);}
.map-icon									{background-image:url(images/maps.svg);}
.video-icon                                 {background-image:url(images/video.svg);}

.image-library-thumbs,
.map-library-thumbs,                      {list-style-type:none;border:0;padding:0;}
.image-library-thumbs li,
.map-library-thumbs li                    {display:block;width:60px;height:60px;float:left;text-align:center;margin:0 10px 10px 0;}
.image-library-thumbs li img,
.map-library-thumbs li img                {display:inline;cursor:pointer;max-width:60px;max-height:60px;}

.site-header,.lemma-selected                {background:#333;color:#fff;}

/* Hide content set to off */
.document-header .document-button,
.document-header .document-header-options,
.search-result .verse-num,.search-result .cf,
.search-result .note,
.config-images-off .image-icon,
.config-video-off .video-icon               {display:none;}

.config-video-off .video-icon,
.config-maps-off .map-icon               {display:none;}

.document-focused .document-input,
.config-theme-default .chapter,
.config-wordsofchrist-off .woc              {color:#000;}
.document-focused .document-header,
.document-focused .document-footer          {-x-background:#999;}
.book-list,.chapter-list                    {float:left;width:150px;}
.config-size-small .chapter,
.config-size-small                          {font-size:10px;}
.config-size-large .chapter,
.config-size-large                          {font-size:18px;}
.config-size-jumbo .chapter,
.config-size-jumbo                          {font-size:22px;}
.config-size-huge .chapter,
.config-size-huge                           {font-size:26px;}

/* special small screen instructions */
@media only screen and (max-width: 480px) {
	#content {
		margin: 10px 0 0 0;
	}
	#footer {
		display: none;
	}
}


Updated, Saturday, 3:54 p.m. | Sheldon Adelson, a leading donor to conservative politicians who share his staunch support for Israel, said on Tuesday night that the United States should begin negotiations with Iran over its nuclear program by launching a nuclear strike on the Iranian desert.

The billionaire casino magnate, who donated nearly $100 million to Republicans last year, prefaced his remarks during a forum at Yeshiva University in New York with the observation, “If you really want peace, it’s very simple to send a message to your opposition.”

Video of the event posted online by Philip Weiss, a blogger who comments on Israel “from a progressive Jewish perspective,” showed that Mr. Adelson was asked about President Obama’s recent diplomatic outreach to Iran. A shorter YouTube clip recorded from a better angle by the BBC Persian journalist Bahman Kalbasi captured his response:

What are we going to negotiate about? What I would say is, “Listen, you see that desert out there, I want to show you something.” You pick up your cellphone … and you call somewhere in Nebraska and you say, ‘O.K., let it go.’ So there’s an atomic weapon goes over, ballistic missiles, in the middle of the desert, that doesn’t hurt a soul. Maybe a couple of rattlesnakes, and scorpions, or whatever. Then you say: “See! The next one is in the middle of Tehran. So, we mean business. You want to be wiped out? Go ahead and take a tough position and continue with your nuclear development. You want to be peaceful? You want to be peaceful? Just reverse it all and we will guarantee you that you can have a nuclear power plant for electricity purposes, for energy purposes.” So.

Such a show of force, Mr. Adelson added, is “the only thing they understand.”

Mr. Kalbasi, who reported the comments in a BBC Persian broadcast, also noted that the conservative columnist Bret Stephens said moments later that he agreed with “98 percent” of what Mr. Adelson said.

Bret Stephens says he agrees with 98% of Sheldon Adelson’s statement on #Iran. — Bahman Kalbasi (@BahmanKalbasi) 23 Oct 13

As my colleague Jodi Rudoren reported in May, Mr. Adelson, 80, is also an influential figure in Israel. Married to an Israeli, he owns a Tel Aviv newspaper that frequently amplifies warnings from Prime Minister Benjamin Netanyahu that a nuclear-armed Iran would pose an existential threat to the Jewish state.

After a meeting with Secretary of State John Kerry on Wednesday, Mr. Netanyahu said that any deal that allowed Iran to retain a path to a nuclear weapon was unacceptable to Israel.

Supporters of talks with Iran, including the Iranian-American journalists Arash Karami and Hooman Majd, joked about Mr. Adelson’s conception of a vast stretch of desert in Iran populated only by rattlesnakes, like those found in the American Southwest.

@hmajd didn’t realize there was rattlesnakes in Tehran. Adelson has really done his homework on this theory. — Arash Karami (@thekarami) 23 Oct 13

@thekarami He was thinking Nevada. But the Iranians would never retaliate by nuking Vegas–too many Iranian expats there every weekend. — Hooman Majd (@hmajd) 23 Oct 13

That Mr. Adelson’s comments were made at a forum on “Iran, Assimilation and the Threat to Israel and Jewish Survival” reminded the graphic artist Eli Valley of a political cartoon he published last year in the Jewish-American daily The Forward, which poked mordant fun at the extremism sometimes found at such events.


"Beloved family member and
'experience enhancer,' Thurber was a remarkably beautiful, noble dog, with the most exquisite head. He made us relish everything a bit more, just by his presence. He loved car rides and would stand right next to the driver, pointing the way ahead, except when he was distracted by squirrels, dogs, or motorcycles. Thurber really hated motorcycles and felt obligated to express his outrage at having to share the road with them by barking as loudly as possible at them until either we pulled away, or they roared off into the distance.

On our Cape Cod beach, he was involved with every single gull and little sandpiper and where they were flying. He loved running after gulls on the Cape Cod beach. He was incredibly fast, and very thorough and used to leap after the wheeling gulls, trying to fly after them. He would race up and down the miles of sandbars until there was not a single gull left, then clear off the sandpipers and come tearing back to us, looking for praise. After a not-too promising start, Thurber stopped churning up the water and turned into a superb swimmer. He loved pulling the kids in the inner tube in the water on the Cape. He was a phenomenal swimmer, and would accompany Ernie on long-distance swims, trailing along behind him for miles, never giving up. He loved to go blueberry picking on the Cape, and would chomp the branches of the blueberry bushes, pulling off the ripe berries, patiently waiting for us to fill our own pails while he filled his tummy.

He was so noble and lion-hearted. He once killed a rat in the backyard to protect the kids, and was very proud of himself, as he should have been--DC rats are BIG. He was a stalwart running partner, trotting along beside us at a regular pace. Once, Anne, running alone, tripped and hit her head, hard, on the pavement. Thurber stood over Anne and would not let anyone near until someone phoned Ernie, who came to the rescue.

Thurber loved the snow. He always bounded out in the back yard after a fresh snowfall, sniffing and leaping around. He loved pulling the kids and their friends in harness on a sled.
He was completely gentle and 100% reliable and patient with little children. He was also a bit of a klutz. He would press against us, trying to get ever closer to be patted and
'thumped,' and in the process, would inevitably step on our feet. He was the best family dog imaginable. His preferred place was right between Rachel and Adam, wherever they were. He never played favorites and made everyone in the family feel equally loved and included. He was wonderful to little Tovi, welcoming our cocker as his own when she sauntered into our house and began to boss him around, and was equally wonderful to Aspen, his great, great, great niece, teaching her all kinds of things about how to be a GSP.

Thurber loved his back yard. He managed to make his own running track around the perimeter fence, and even in his prime, he liked to wander around, sniffing at grass and flowers like Ferdinand the Bull, when he wasn't racing around. He loved playing Daddy Monster with Ernie and the kids when they were little. In this game, Ernie roared, raised his arms up and chased the kids around the house. Once, on the Cape, Thurber thought that Ernie was a little too realistic as a monster. As Ernie closed in on Adam and Adam shrieked, Thurber very gently closed his jaws on Ernie's wrist, stopping Ernie in his tracks, whereupon Thurber immediately let go. When we first brought Thurber home, Adam and Rachel each had a hand on him as he sat in
mom's lap. Adam was patting his side of Thurber, and said, 'I never knew that love could happen so
fast.' We all instantly fell in love with our big wonderful dog. We miss our Thurber so much, and are very grateful to have had him for so very long."


package question0974_subarray_sums_divisible_by_k;

/**
 * 哈希表。
 *
 * 时间复杂度是 O(n)，其中 n 为数组 A 的长度。空间复杂度是 O(K)。
 *
 * 执行用时：4ms，击败91.32%。消耗内存：42.6MB，击败100.00%。
 */
public class Solution {
    public int subarraysDivByK(int[] A, int K) {
        int result = 0, sum = 0;
        int[] map = new int[K];
        map[0]++;
        for (int right = 0; right < A.length; right++) {
            sum += A[right];
            int left = (sum % K + K) % K;   // 将负余数转换为正余数
            result += map[left];
            map[left]++;
        }
        return result;
    }
}


Learning To Drink Vol. 14: Take A Sidecar

Good drinks tell a story, and this is the story of those drinks. Each week, we serve up a remedial cocktail lesson for bartending beginners to help you get the most out of your glass, with recipes, interviews, and histories coming right up.

Hop in a sidecar and be whisked away on the fuel of your chosen brandy, perhaps to putter around some metaphorical countryside. Yes, the image of dashing around affixed to a motorcycle is appropriate because the drink's name, as you might have expected, is a clue as to its origin.

The sidecar was named "after the sidecar that used to carry the inventor of the drink to his favourite bar and, more important, home again." That telling comes to us from full-time sot and sometimes writer Kingsley Amis. Picture this next bit with him in mind: "A sidecar is the ideal vehicle for a soak when he's been soaking — he can forget about the driver and snore away in peace." Sir Amis is right that one sidecar begets another, as they're an eminently quaffable — and simple — combination of cognac, triple sec, and lemon juice.

You'll note that Amis has carefully avoided taking sides on the sidecar's country of origin. Where was that motorbike, after all? Was it at Harry's New York Bar in 1920′s Paris, a famous Hemingway hangout? There, some say an American army captain fond of his bike and sidecar combination concocted the drink, itself not far from a Brandy Daisy.

However, for its part, the Ritz Hotel Paris also claims the drink. InThe Artistry Of Mixing Drinks (1934) Frank Meier of that elegant haunt credits himself. Yet the first recipe for a sidecar appeared in Harry MacElhone's ABC of Mixing Cocktails (1922). Confusingly, in first editions of that volume, MacElhone, who was a barman from Dundee, Scotland that came to run Harry's New York Bar, says the drink's inventor was Pat MacGarry, "the popular bartender at Buck's Club, London." Then, in later editions MacElhone reverses himself, claiming the invention as his own. Perhaps he'd grown fond of it?

MacElhone's recipe is equal parts cognac, Cointreau, and lemon juice in what's now known as "the French school" of the drink. That's as later an "English school" emerged, calling for two parts cognac and one part each Cointreau and lemon juice.

"The Sidecar is often singled out as the only good cocktail to come out of the long national nightmare that was Prohibition," writes cocktail historian David Wondrich for Esquire. "And when you're sipping one, you almost think it was all worth it." His implication is that prohibition gave the sidecar its real rise to power.

Certainly a sidecar is a splendid go-to drink wherever it came from, and it's sure to make you its passenger wherever you're going. Here's a recipe that's a take-off on the Savoy Cocktail Book's (1930). You'll notice it's from the English School.


TODAY on MHTV: With a few basic techniques, French food is easy to recreate at home. Pan-sauteed sole cooks over high heat with just a little fat, really showcasing the fish’s delicate, flakey texture. Tournéd steamed potatoes and barely touched spinach are elegant and easy sides, while coconut topped meringues for dessert couldn’t be simpler…or… View Article


Take the long way. Anywhere you go, there’s a short way to get there and a long way to get there. And for those of us who ride bikes, the long way is usually more fun. And since not many bikes are suited to handle the go-anywhere, do-anything lifestyle, GT built the Palomar to maneuver all your on- and off-road adventures.KEY FEATURESHi-Tensile Steel Triple Triangle™ Frame, w/ 1 1/8"" Head TubeSR Suntour suspension fork for comfortable ridingShimano Tourney drivetrain for easy shiftingLinear Pull V style brakes for strong consistent braking power


735 F.2d 1353
Austinv.McNamara
83-6534
United States Court of Appeals,Fourth Circuit.
6/12/84

1
E.D.N.C.

AFFIRMED


If we need to directly get resource from controller, we need to return @ResponseBody as per Spring 3 but with Spring 4, we can use @RestController for that.
In spring 4.0, we can use @RestController which is combination of @Controller + @ResponseBody.

Instead of annotating each method return type as @ResponseBody, we can directly annotate a class with @RestController. You can see Spring rest Json example to get complete working example on @RestController.


/*
* Copyright 2012-2016 Broad Institute, Inc.
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
* THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

package org.broadinstitute.gatk.utils.haplotype;

import htsjdk.samtools.Cigar;
import htsjdk.samtools.CigarElement;
import htsjdk.samtools.CigarOperator;
import htsjdk.samtools.TextCigarCodec;
import org.broadinstitute.gatk.utils.BaseTest;
import org.broadinstitute.gatk.utils.GenomeLoc;
import org.broadinstitute.gatk.utils.UnvalidatingGenomeLoc;
import org.broadinstitute.gatk.utils.haplotype.Haplotype;
import htsjdk.variant.variantcontext.Allele;
import htsjdk.variant.variantcontext.VariantContext;
import htsjdk.variant.variantcontext.VariantContextBuilder;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;

import java.util.*;

/**
 * Basic unit test for Haplotype Class
 */
public class HaplotypeUnitTest extends BaseTest {
    @Test
    public void testSimpleInsertionAllele() {
        final String bases = "ACTGGTCAACTGGTCAACTGGTCAACTGGTCA";

        final ArrayList<CigarElement> h1CigarList = new ArrayList<CigarElement>();
        h1CigarList.add(new CigarElement(bases.length(), CigarOperator.M));
        final Cigar h1Cigar = new Cigar(h1CigarList);
        String h1bases = "AACTTCTGGTCAACTGGTCAACTGGTCAACTGGTCA";
        basicInsertTest("A", "AACTT", 0, h1Cigar, bases, h1bases);
        h1bases = "ACTGGTCAACTTACTGGTCAACTGGTCAACTGGTCA";
        basicInsertTest("A", "AACTT", 7, h1Cigar, bases, h1bases);
        h1bases = "ACTGGTCAACTGGTCAAACTTCTGGTCAACTGGTCA";
        basicInsertTest("A", "AACTT", 16, h1Cigar, bases, h1bases);
    }

    @Test
    public void testSimpleDeletionAllele() {
        final String bases = "ACTGGTCAACTGGTCAACTGGTCAACTGGTCA";

        final ArrayList<CigarElement> h1CigarList = new ArrayList<CigarElement>();
        h1CigarList.add(new CigarElement(bases.length(), CigarOperator.M));
        final Cigar h1Cigar = new Cigar(h1CigarList);
        String h1bases = "ATCAACTGGTCAACTGGTCAACTGGTCA";
        basicInsertTest("ACTGG", "A", 0, h1Cigar, bases, h1bases);
        h1bases = "ACTGGTCAGTCAACTGGTCAACTGGTCA";
        basicInsertTest("AACTG", "A", 7, h1Cigar, bases, h1bases);
        h1bases = "ACTGGTCAACTGGTCAATCAACTGGTCA";
        basicInsertTest("ACTGG", "A", 16, h1Cigar, bases, h1bases);
    }

    @Test
    public void testSimpleSNPAllele() {
        final String bases = "ACTGGTCAACTGGTCAACTGGTCAACTGGTCA";

        final ArrayList<CigarElement> h1CigarList = new ArrayList<CigarElement>();
        h1CigarList.add(new CigarElement(bases.length(), CigarOperator.M));
        final Cigar h1Cigar = new Cigar(h1CigarList);
        String h1bases = "AGTGGTCAACTGGTCAACTGGTCAACTGGTCA";
        basicInsertTest("C", "G", 1, h1Cigar, bases, h1bases);
        h1bases = "ACTGGTCTACTGGTCAACTGGTCAACTGGTCA";
        basicInsertTest("A", "T", 7, h1Cigar, bases, h1bases);
        h1bases = "ACTGGTCAACTGGTCAAATGGTCAACTGGTCA";
        basicInsertTest("C", "A", 17, h1Cigar, bases, h1bases);
    }

    @Test
    public void testComplexInsertionAllele() {
        final String bases = "ATCG" + "CCGGCCGGCC" + "ATCGATCG" + "AGGGGGA" + "AGGC";

        final ArrayList<CigarElement> h1CigarList = new ArrayList<CigarElement>();
        h1CigarList.add(new CigarElement(4, CigarOperator.M));
        h1CigarList.add(new CigarElement(10, CigarOperator.I));
        h1CigarList.add(new CigarElement(8, CigarOperator.M));
        h1CigarList.add(new CigarElement(3, CigarOperator.D));
        h1CigarList.add(new CigarElement(7 + 4, CigarOperator.M));
        final Cigar h1Cigar = new Cigar(h1CigarList);
        String h1bases = "AACTTTCG" + "CCGGCCGGCC" + "ATCGATCG" + "AGGGGGA" + "AGGC";
        basicInsertTest("A", "AACTT", 0, h1Cigar, bases, h1bases);
        h1bases = "ATCG" + "CCGGCCGGCC" + "ATCACTTGATCG" + "AGGGGGA" + "AGGC";
        basicInsertTest("C", "CACTT", 6, h1Cigar, bases, h1bases);
        h1bases = "ATCG" + "CCGGCCGGCC" + "ATCGATCG" + "AGACTTGGGGA" + "AGGC";
        basicInsertTest("G", "GACTT", 16, h1Cigar, bases, h1bases);
    }

    @Test
    public void testComplexDeletionAllele() {
        final String bases = "ATCG" + "CCGGCCGGCC" + "ATCGATCG" + "AGGGGGA" + "AGGC";

        final ArrayList<CigarElement> h1CigarList = new ArrayList<CigarElement>();
        h1CigarList.add(new CigarElement(4, CigarOperator.M));
        h1CigarList.add(new CigarElement(10, CigarOperator.I));
        h1CigarList.add(new CigarElement(8, CigarOperator.M));
        h1CigarList.add(new CigarElement(3, CigarOperator.D));
        h1CigarList.add(new CigarElement(7 + 4, CigarOperator.M));
        final Cigar h1Cigar = new Cigar(h1CigarList);
        String h1bases = "A" + "CCGGCCGGCC" + "ATCGATCG" + "AGGGGGA" + "AGGC";
        basicInsertTest("ATCG", "A", 0, h1Cigar, bases, h1bases);
        h1bases = "ATCG" + "CCGGCCGGCC" + "ATAAAG" + "AGGGGGA" + "AGGC";
        basicInsertTest("CGATC", "AAA", 6, h1Cigar, bases, h1bases);
        h1bases = "ATCG" + "CCGGCCGGCC" + "ATCGATCG" + "AGA" + "AGGC";
        basicInsertTest("GGGGG", "G", 16, h1Cigar, bases, h1bases);
    }

    @Test
    public void testComplexSNPAllele() {
        final String bases = "ATCG" + "CCGGCCGGCC" + "ATCGATCG" + "AGGGGGA" + "AGGC";

        final ArrayList<CigarElement> h1CigarList = new ArrayList<CigarElement>();
        h1CigarList.add(new CigarElement(4, CigarOperator.M));
        h1CigarList.add(new CigarElement(10, CigarOperator.I));
        h1CigarList.add(new CigarElement(8, CigarOperator.M));
        h1CigarList.add(new CigarElement(3, CigarOperator.D));
        h1CigarList.add(new CigarElement(7 + 4, CigarOperator.M));
        final Cigar h1Cigar = new Cigar(h1CigarList);
        String h1bases = "AGCG" + "CCGGCCGGCC" + "ATCGATCG" + "AGGGGGA" + "AGGC";
        basicInsertTest("T", "G", 1, h1Cigar, bases, h1bases);
        h1bases = "ATCG" + "CCGGCCGGCC" + "ATCTATCG" + "AGGGGGA" + "AGGC";
        basicInsertTest("G", "T", 7, h1Cigar, bases, h1bases);
        h1bases = "ATCG" + "CCGGCCGGCC" + "ATCGATCG" + "AGCGGGA" + "AGGC";
        basicInsertTest("G", "C", 17, h1Cigar, bases, h1bases);
    }

    private void basicInsertTest(String ref, String alt, int loc, Cigar cigar, String hap, String newHap) {
        final Haplotype h = new Haplotype(hap.getBytes());
        final Allele h1refAllele = Allele.create(ref, true);
        final Allele h1altAllele = Allele.create(alt, false);
        final ArrayList<Allele> alleles = new ArrayList<Allele>();
        alleles.add(h1refAllele);
        alleles.add(h1altAllele);
        final VariantContext vc = new VariantContextBuilder().alleles(alleles).loc("1", loc, loc + h1refAllele.getBases().length - 1).make();
        h.setAlignmentStartHapwrtRef(0);
        h.setCigar(cigar);
        final Haplotype h1 = h.insertAllele(vc.getReference(), vc.getAlternateAllele(0), loc, vc.getStart());
        final Haplotype h1expected = new Haplotype(newHap.getBytes());
        Assert.assertEquals(h1, h1expected);
    }

    private Haplotype makeHCForCigar(final String bases, final String cigar) {
        final Haplotype h = new Haplotype(bases.getBytes());
        h.setCigar(TextCigarCodec.decode(cigar));
        return h;
    }

    @Test
    public void testConsolidateCigar() throws Exception {
        Assert.assertEquals(makeHCForCigar("AGCT", "4M").getConsolidatedPaddedCigar(0).toString(), "4M");
        Assert.assertEquals(makeHCForCigar("AGCT", "4M").getConsolidatedPaddedCigar(1).toString(), "5M");
        Assert.assertEquals(makeHCForCigar("AGCT", "1M1I1I1M").getConsolidatedPaddedCigar(0).toString(), "1M2I1M");
        Assert.assertEquals(makeHCForCigar("AGCT", "1M1I1I1M").getConsolidatedPaddedCigar(1).toString(), "1M2I2M");
        Assert.assertEquals(makeHCForCigar("AGCT", "1M1I1I1M").getConsolidatedPaddedCigar(2).toString(), "1M2I3M");
        Assert.assertEquals(makeHCForCigar("AGCT", "1M1I1I1I").getConsolidatedPaddedCigar(0).toString(), "1M3I");
        Assert.assertEquals(makeHCForCigar("AGCT", "1M1I1I1I").getConsolidatedPaddedCigar(1).toString(), "1M3I1M");
        Assert.assertEquals(makeHCForCigar("AGCT", "1M1I1I1I").getConsolidatedPaddedCigar(2).toString(), "1M3I2M");
    }

    @DataProvider(name = "TrimmingData")
    public Object[][] makeTrimmingData() {
        List<Object[]> tests = new ArrayList<Object[]>();

        // this functionality can be adapted to provide input data for whatever you might want in your data
        final GenomeLoc loc = new UnvalidatingGenomeLoc("20", 0, 10, 20);
        final String fullBases = "ACGTAACCGGT";
        for ( int trimStart = loc.getStart(); trimStart < loc.getStop(); trimStart++ ) {
            for ( int trimStop = trimStart; trimStop <= loc.getStop(); trimStop++ ) {
                final int start = trimStart - loc.getStart();
                final int stop = start + (trimStop - trimStart) + 1;
                final GenomeLoc trimmedLoc = new UnvalidatingGenomeLoc("20", 0, start + loc.getStart(), stop + loc.getStart() - 1);
                final String expectedBases = fullBases.substring(start, stop);
                final Haplotype full = new Haplotype(fullBases.getBytes(), loc);
                final Haplotype trimmed = new Haplotype(expectedBases.getBytes(), trimmedLoc);

                final int hapStart = 10;
                full.setAlignmentStartHapwrtRef(hapStart);
                full.setCigar(TextCigarCodec.decode(full.length() + "M"));

                trimmed.setAlignmentStartHapwrtRef(hapStart + start);
                trimmed.setCigar(TextCigarCodec.decode(trimmed.length() + "M"));

                tests.add(new Object[]{full, trimmedLoc, trimmed});
            }
        }

        final Haplotype full = new Haplotype("ACT".getBytes(), new UnvalidatingGenomeLoc("20", 0, 10, 14));
        full.setAlignmentStartHapwrtRef(10);
        full.setCigar(TextCigarCodec.decode("1M2D2M"));
        tests.add(new Object[]{full, new UnvalidatingGenomeLoc("20", 0, 11, 12), null});
        tests.add(new Object[]{full, new UnvalidatingGenomeLoc("20", 0, 10, 12), null});
        tests.add(new Object[]{full, new UnvalidatingGenomeLoc("20", 0, 11, 13), null});

        return tests.toArray(new Object[][]{});
    }

    @Test(dataProvider = "TrimmingData")
    public void testTrim(final Haplotype full, final GenomeLoc trimTo, final Haplotype expected) {
        final Haplotype actual = full.trim(trimTo);
        if ( expected != null ) {
            Assert.assertEquals(actual.getBases(), expected.getBases());
            Assert.assertEquals(actual.getStartPosition(), trimTo.getStart());
            Assert.assertEquals(actual.getStopPosition(), trimTo.getStop());
            Assert.assertEquals(actual.getCigar(), expected.getCigar());
            Assert.assertEquals(actual.getAlignmentStartHapwrtRef(), expected.getAlignmentStartHapwrtRef());
        } else {
            Assert.assertNull(actual);
        }
    }

    @Test(expectedExceptions = IllegalArgumentException.class)
    public void testBadTrimLoc() {
        final GenomeLoc loc = new UnvalidatingGenomeLoc("20", 0, 10, 20);
        final Haplotype hap = new Haplotype("ACGTAACCGGT".getBytes(), loc);
        hap.trim(new UnvalidatingGenomeLoc("20", 0, 1, 20));
    }

    @Test(expectedExceptions = IllegalStateException.class)
    public void testBadTrimNoLoc() {
        final Haplotype hap = new Haplotype("ACGTAACCGGT".getBytes());
        hap.trim(new UnvalidatingGenomeLoc("20", 0, 1, 20));
    }
}


Q:

How to Open all minimized File Explorer windows

Let's say I have Minimized several File Explorers, perhaps by right-clicking an open spot on the taskbar and choosing "Show the Desktop". Now I want to  them all Restored at once. I see no way to Restore them all other than hovering over the taskbar icon and clicking on each window separately.
Any modern version of Windows works like this. I am on Win7 currently.
Basically I would like to add an item to the right-click menu, below "Close all Windows", that says "Open all Windows".
Is there some shortcut I'm missing, or is there a way to add items to the right-click menu? I'm not interested in 3rd party tools, but I can program if someone gives me some clues.
Thanks.
[edit] Windows + D sorta worked. It closes open Windows, and hitting it again restores what it closed. But if you Win+D and then open a program, hitting it again will close that program and only open the same program back up. But question was how to open all the Explorer windows, in the same manner you can close them all, by right-click on the taskbar icon. I want an Open All option on that menu. Essentially, I want to add functionality to the right-click menu.

A:

You can try this:
Press SHIFT, right-click on the group icon and choose Restore all windows


# frozen_string_literal: true

# Presenter class used in the tests below. Note that decorator base class
# behavior is not retested here.
class TestUserPresenter < ApplicationPresenter
  forward :first_name, :last_name, :age

  def formatted_first_name
    tag.strong first_name
  end
end

describe ApplicationPresenter do
  let(:user) { OpenStruct.new(first_name: 'Test', last_name: 'User', age: 42) }

  describe '.call' do
    context 'without a block' do
      it 'returns the wrapped instance' do
        user_presenter = TestUserPresenter.(user)
        expect(user_presenter).to be_a(TestUserPresenter)
      end

      it 'uses imported view helpers' do
        user_presenter = TestUserPresenter.(user)
        formatted_first_name = "<strong>#{user.first_name}</strong>"
        expect(user_presenter.formatted_first_name).to eq formatted_first_name
      end
    end

    context 'with a block' do
      it 'yield the instance to the provided block' do
        expect { |block| TestUserPresenter.(user, &block) }.to yield_control
      end

      it 'returns the wrapped instance' do
        user_presenter = TestUserPresenter.(user) {} # no-op block
        expect(user_presenter).to be_a(TestUserPresenter)
      end
    end
  end

  describe '.present_collection' do
    it 'wraps all provided models in a presenter' do
      user_presenters = TestUserPresenter.present_collection([user, user])
      expect(user_presenters.size).to eq 2
      expect(user_presenters).to all(be_a(TestUserPresenter))
    end

    it 'yields each element to a provided block' do
      output = StringIO.new
      user_presenters =
        TestUserPresenter.present_collection([user, user]) do |u|
          output.puts(u.first_name)
        end
      output.rewind
      expect(output.string).to eq "Test\nTest\n"
      expect(user_presenters.size).to eq 2
      expect(user_presenters).to all(be_a(TestUserPresenter))
    end
  end
end


Author: garethhardman

Entries to the Merthyr Mawr Lane 5km are now open and can be made by clicking here.

The 15th edition of the race incorporates the South Wales Region 5km championships.

The measured out and back, rolling course with a start/finish at top of Merthyr Mawr Lane, welcomes runners of all abilities. Numbers can be collected on the night from Bridgend AC clubhouse, Newbridge Fields, Angel Street, CF31 4AD.

Huge congratulations to Hannah Jenkins, Ffion Higginson, Erin Andrews and Abi Davies, all Bridgend AC junior endurance athletes, who have been selected to represent Wales in the Virgin London Mini Marathon this weekend.

It’s a 3 mile road race around London, for 11 to 17 year olds, and previous competitors have included Sir Mo Farah.

Congratulations to Nadine Griffiths who completed her Leading Athletics Certificate on the weekend! A great addition to BAC coaching team.
If any other parents are interested in coaching, becoming officials, or generally want to help out, please let us know. An extra pair of hands is always welcome!

This weekend was a busy one for BAC Juniors. Saturday brought day 2 of the Welsh Athletics Junior Open champs in Cardiff and international Cross Country in Antrim. Over at NIAC, Bridgend AC were represented in no fewer than 16 events with 31 athletes taking part. The day saw excellent performances delivered by all athletes, with some competing for their first time, while others moved into new age groups. It was great to see the yellow and blue populating the podium, with a total of 8 medals. 2 Gold, 4 Silver and 2 Bronze. A great haul considering the depth and breadth of competition on display from Wales and South East England. Over in Antrim, Ffion Higginson was part of the Wales U17 team competing in the Celtic International. Ffion had a great run with a time of 16:16 and finishing in 42nd place.

This Wednesday (6th) will see the rescheduled visit from Chris Jones,WA Head of Endurance, to talk to us about “Developing Junior Endurance Runners” in the Bridgend Tennis club starting at 7pm,

This talk is exclusively for BAC Juniors – and primarily targeted to our teenage endurance runners – so primarily geared towards those in Schools Year 8 & above.

This session is relevant to both athletes and their parents and will hopefully give a attendees a better understanding of some of the best practise towards developing a healthy successful athlete now and into their athletic future.


Bandwidth Analysis

55104 Cable | Best Cable Internet Service Providers in the 55104 Zip Code

With Cable Internet Service Providers in 55104 you can get the lowest prices from Cable providers in Saint Paul 55104. Use our Cable Internet Service Providers quote tool to shop all the major Cable Internet Service Providers in the 55104 Zip Code.

You can also give us a call at (888) 765-8301 and a 55104 Cable Internet Service Providers specialist can assist you with your request!


Conjugate addition of allyl stannanes with concomitant triflation.
A new method for the conjugate addition of allyltributylstannane with concomitant triflation is described. This reaction works with functionalized enones, enals, enoates, and vinylogous esters. The resulting vinyl triflates can be used for intramolecular Heck reactions to afford the products of 5-exo-trig cyclization.