. zentangle patterns coloring pages at getcolorings 39 zentangle patterns coloring pages for printing and coloring you can use our amazing online tool to color and edit the following zentangle patterns coloring pages lovely squirrel zentangle coloring page coloring pages mandala printable colouring pages print coloring pages free colouring pages abstract coloring pages adult coloring book pages pattern coloring pages free coloring coloring for kids pyrography design flowers stained glass windows scribble painting fabric molde colour book adult colouring pages zentangle drawings mandala coloring coloring books hard zentangle coloring pages getcoloringpages 47 hard zentangle coloring pages to print and color hard zentangle coloring pages free printable hard zentangle coloring pages for kids of all ages printable coloring page zentangle inspired coloring printable coloring page zentangle inspired coloring pattern page 27 this is page 27 of my zendoodle colouring pages i am planning to add to this list regularly this listing is for the page shown in photo 1 the rest of the photos are my other colouring pages if you want to see more turtle zentangle coloring page from zentangle category turtle zentangle coloring page from zentangle category select from printable crafts of cartoons nature animals bible and many more . That photograph (Zentangle Patterns Coloring Pages Amazing 23 Best Images About Coloring Pages On Pinterest) previously mentioned can be branded using: zentangle patterns coloring pages, and submitted by Michael Williamson at 2019-01-03 10:56:02. To come up with all images inside Zentangle Patterns Coloring Pages : Pleasant Ideas You Must Consider photos gallery please bookmark this specific website URL. If you likes this post about zentangle patterns coloring pages, then please share with your friends.


text:
Explore The Street
Grocery/Liquor/ATM
Souvenirs, Gifts & Toys
Coffee/Tea House
Main Street Gallery
Ashley Sorenson has had the opportunity to gain experience from galleries throughout the country. From one of the top non-profit galleries and rotating museum exhibitions in the state of New York to one of the oldest galleries in San Francisco; these renowned organizations continue to foster some of the most knowledgeable and well trained staff in the industry. She has professionally represented both old and modern masters including Rembrandt, Monet, Picasso, Miro, Dali, Chagall, Rothko and Warhol to some of the most successful living contemporary artists today. She's an educational Children's Book Author with degrees in Business and
Behavioral Science and has remained a passionate advocate for art, education and creativity throughout her
career. As the owner of Main Street Gallery, Ashley is committed to sharing with you the advise, expertise and information you need to assemble a uniquely tailored collection to enjoy for years to come.
Closed Tuesdays
Visit our website: Main Street Gallery
Come in: 825 Main Street
Historic Park City Alliance
Email info@historicparkcityutah.com
P.O. Box 1348, Park City, UT 84060
Sign up for our newsletter for all the latest news from Historic Park City.
© 2020 Historic Park City Alliance · Privacy Policy

redpajama_set_name: RedPajamaCommonCrawl


I know I have a lot of blogging to catch up on but I just have to quickly tell you that I discovered the most delicious peanut butter today and I'm really excited about it.
Pic's Peanut Butter is made with simply peanuts and salt. Kingaroy nuts are sent over from Australia over to Nelson in the South Island where they are roasted and squashed into this divine peanut butter that I'm going to have for breakfast, lunch, and dinner tomorrow. It's really that good!


text:
Rebecca Salinas, Digital Journalist
Tags: Camping, Texas, outdoors
Kuykendahl Road widening project underway. Here's what you can expect
Photos: Fall foliage creating postcard-worthy views at Texas state parks
Here's where to head outdoors this fall season
A photo of Colorado Bend State park taken in November 2019.
SAN ANTONIO – Oh, the hues of yellow, orange and red.
Fall colors are painting over Texas state parks, and the views are nothing short of extraordinary.
The Texas Parks and Wildlife Department is regularly updating its Flickr page with photos of fall sights around state parks, from the Hill Country to North Texas.
Devils River State Natural Area near Del Rio, Inks Lake State Park near Burnet and South Llano River State Park in Junction are among Central and South Texas parks that are flashing fall colors right now.
For those who want to visit a state park for a day, TPWD recommends reserving a spot online prior to heading out.
Save the Day passes are available for each state park, and reservations can be made for a morning or afternoon arrival.
Popular parks like Garner State Park and Lost Maples State Natural Area often reach capacity early and close, according to TPWD.
Reservations for overnight camping can be made online as well.
Here are some of the Texas state parks that are worth the drive to see fall colors:
Garner State Park, Concan: About 90 miles from San Antonio
Lost Maples State Natural Area, near Vanderpool: About 100 miles from San Antonio
Palmetto State Park, Gonzales: About 70 miles from San Antonio
Devil's River State Natural Area, new Del Rio: About 215 miles from San Antonio
Inks Lake State Park, Burnet: About 100 miles from San Antonio
Colorado Bend State Park, Bend: About 146 miles from San Antonio
South Llano River State Park, Junction: About 120 miles from San Antonio
Lake Somerville State Park, Somerville: About 150 miles from San Antonio
Daingerfield State Park, northeast of Tyler: About 380 miles from San Antonio
Caddo Lake State Park: northeast of Tyler: About 370 miles from San Antonio
Lake Bob Sandlin State Park, north of Tyler: About 370 miles from San Antonio
Ray Roberts Lake State Park, north of Dallas-Fort Worth: About 320 miles from San Antonio
Sheldon Lake State Park, Houston: About 210 miles from San Antonio
Rebecca Salinas
Rebecca Salinas has worked as a digital journalist in San Antonio for six years. Her skills include content management, engagement and reporting.
emailtwitter


Why did you choose this book? I chose this book because last week I did a book that surprised me in a good way and this week I wanted to do one that surprised me in a not so good way.
Maggie Dempsey is tired of moving all over the country. Her parents are second-generation hippies who uproot her every year or so to move to a new city. When Maggie was younger, she thought it was fun and adventurous. Now that she's a teenager, she hates it. When she moved after her freshman year, she left behind good friends, a great school, and a real feeling of belonging. When she moved her sophomore year, she left behind a boyfriend, too. Now that they've moved to Austin, she knows better. She's not going to make friends. She's not going to fit in. Anything to prevent her from liking this new place and them from liking her. Only . . . things don't go exactly as planned.
I would have to say this book was just ok. When I read the title I thought I would love it. I mean I loved Meg Cabot's How to be Popular, and I love books about popularity, so this one should've been right up my alley. Only it wasn't. It was too predictable and silly. All the over-the-top clothes irked me. I mean if she didn't want people to like her why not fly under the radar and not talk to anyone? You're not exactly going to blend in if you're dressed like a star trek character or carrying around a potted plant at school, ya know? What's wrong with sweatpants and greasy hair? So yes it is fiction and I have imagination, but I just found the crazy get-ups kind of stupid.
Another problem I had with this book was that not only did this replay the tired stereotype that ALL popular people are evil and all dorks are awesome, but for some reason it offended me by doing it. I guess it was the fact that Maggie assumed that by making friends with the unpopulars, she would never get attached to them. Which to me made it seem like she saw them as beneath her, and that pissed me off. What was so great about this girl? All she did was whine, why would anyone popular or not be lining up to be friends with her?
Last thing.... I was so NOT crushing on the Young Republican Nerd-Alert with NO personality. Not into that awkward romance at all.
Overall: I thought the initial idea was cute, but it just didn't work for me. It was too superficial and you could see everything that was going to happen coming from a mile away. Also the M/C wasn't very like-able and I didn't think she deserved redemption (which is sort of a bad thing if the author was wanting you to root for Maggie).


"PDMHA" means the Port Dover Minor Hockey Association.
"Participant" means any player, team official, parent or legal guardian, family members, supporters, sponsors PDMHA Executive and Directors, and volunteers.
The PDMHA recognizes the importance of participating in online interactions and wants to ensure that all participants associated with the PDMHA receive guidance on how to participate in social media in a positive and responsible manner. When used appropriately, social media serves as a complement to other communication channels to allow the PDMHA and its members to more effectively engage and connect with the community. This policy aims to provide everyone associated with the PDMHA with guidelines to follow when engaging in communications and/or sharing content via any form of social media that can be linked to or in any way associated (whether directly or indirectly) with the PDMHA.
The guidelines set out in the policy are designed to protect the PDMHA as well as its participants and others associated with them from illegal, unauthorized, irresponsible or abusive use of social media.
All participants are required to comply with the policy when participating or engaging in communications in social media personally or as an official representative of the PDMHA. Players and team officials alike are reminded that they continue to act as representatives of the PDMHA, even outside the hockey setting, and should conduct themselves in accordance with the policy guidelines at all times. The conduct of any player or team official that violates the policy, which may be linked to or perceived to be linked to or associated with the PDMHA, may result in disciplinary action taken by the Hockey Federation and the OMHA.
g) Personal or Corporate Blogs.
PDMHA Code of Conduct; the PDMHA's Rules, Regulations and Policies; and the Rules, Regulations and Policies of Hockey Canada, the Ontario Hockey Federation and the Ontario Minor Hockey Association.
Always be courteous and respectful online. If you need help with a particularly difficult situation, contact the appropriate PDMHA Executive Member.
Anything you put online is there to stay. Confidential, proprietary, private and personal information concerning the PDMHA or any person associated with the PDMHA must remain strictly confidential. Even if you remove a Facebook post, tweet or video, it could already have been saved or shared by another user. Comments or remarks of an inappropriate nature that are detrimental to a group or an individual will not be tolerated and will be subject to disciplinary action.
Simply put, some things do not belong on the Internet. This includes, but is not limited to, discussions or other communications about the PDMHA and/or its members. Any violations or breaches of the policy may result in disciplinary action up to and including suspension and/or formal removal and termination from the PDMHA.
If you see something concerning in the social media space that could impact the PDMHA or anyone associated with the PDMHA, Talk to Us. Concerns or issues should be addressed as soon as possible to minimize potential damages caused by inappropriate or prohibited content.
a) DO NOT post, shoot video, audio clips or take photos inside any dressing room. Do not post photos or video that can be viewed as a negative influence or can be construed as bullying or harassment.
b) DO NOT divulge secrets, confidential, proprietary or personal and/or health information or status concerning any aspect of the PDMHA, whether concerning you or anyone else associated with the PDMHA.
c) ALWAYS comply with all laws, including those relating to libel, copyright, trademark and data protection, and regulations, including those made or issued by Hockey Canada, the Ontario Hockey Federation and the Ontario Minor Hockey Association.
and/or words — in any media — may reflect on the PDMHA and may cause irreparable harm to the PDMHA and its Members. Remain courteous and professional at all times.
e) THINK before posting – use your best judgment at all times. Ultimately, you are solely responsible for your comments and they are published for the public record. Your social media and any other online content is permanent and accessible to anyone. If you become aware of any breach of the social media policy by any person associated with the PDMHA, contact the appropriate PDMHA Executive Member.
Please save images or videos, or use a screenshot to capture any apparent breach of this policy.


Comprehensive and specific treatment to relieve your pain.
Live healthier with whole-body healing!
At Progressive Chiropractic in Gilbert AZ, our goal is to get you well quickly without the use of medication or surgery. We specialize in holistic health care, spinal health maintenance, and non-invasive health care and wellness programs. In more than 30 years since Progressive Chiropractic first opened its doors in Gilbert AZ, we have helped thousands of people with various health issues and concerns!
Our commitment is to educate, inspire, and serve our patients with the most effective wellness and holistic health care available. We maximize each person's human health potential without the use of drugs or surgery, through natural, gentle, specific, Chiropractic care.
Our philosophy toward health is guided by the knowledge that our bodies are self-healing. Healing is directly controlled by the brain and nervous system. Stresses, strains, and injuries can prevent your body from healing and communicating properly! Progressive Chiropractic's focus is to find where the distress is occurring within your nervous system and to remove the cause of the stress, allowing your body to heal naturally-without interference and without prescription drugs!
Take your first step to a healthier and better life. Call Progressive Chiropractic today! We would be happy to sit down with you for a complimentary consultation.
Discover how Chiropractic care can help you manage-or even eliminate-your pain!
Click here to learn more about the Progressive team.
See what others are saying about Progressive Chiropractic.


text:
Nils Klevjer Aas
Nils Klevjer Aas is Head of Analysis at the Norwegian Film Institute. He holds a cand.philol. degree from the Norwegian University of Science and Technology and has lectured and published extensively on film appreciation,film history and film and cinema industry policy. A former Director General of the National Film Board of Norway, he was Executive Director of the European Audiovisual Observatory (1997–2000) before returning to his current position in Norway. He has served as the Norwegian representative to the Board of Management of Eurimages since 2001 and the European Audiovisual Observatory since 2004.


text:
\section{Introduction}

We consider the classical linear least-squares problem
\begin{equation}\label{eq1}
\min_{\mybf{x} \in \mathbb{R}^n} f(\mybf{x}) \equiv \frac{1}{2} \| \mybf{A} \mybf{x} - \mybf{b} \|_2^2,
\end{equation}
where $\mybf{A}$ is a full-rank $m \times n$ matrix, with $m \geq n$, and $\mybf{b} \in \mathbb{R}^m$.
Such issue is typically addressed in presence of an ill-posed inverse problem
\begin{equation}\label{eq2}
\mybf{A} \mybf{x} = \mybf{b},
\end{equation}
since the existence and uniqueness of the least-squares solution $\mybf{x}^\dagger$ together with its continuously data dependence
(that is guaranteed in the discrete case) lead to a well-posed problem. However, especially in the case in which the linear system
\eqref{eq2} arises from the discretization of a continuous ill-posed inverse problem, the switch to the least-squares problem
\eqref{eq1} does not avoid the ill-conditioning pathology, that amplifies the noise affecting the data with the result of
a meaningless reconstructed solution. A classical example occurs in the image deblurring problem \cite{BER98,HAN06}, in which
$\mybf{b}$ is a blurred and noisy version of an unknown image $\mybf{x}$ and $\mybf{A}$ describes the transformation from the
target to the measured data values. The numerical instability provided by the ill-conditioning can be countered by looking for
a regularized solution of \eqref{eq1}, obtained by means of an approximation of the original problem with a one-parameter family
of better conditioned ones. A strategy for the choice of the ``best'' parameter is finally needed, according to some criteria
based for example on the knowledge of the noise level or the analysis of the residuals \cite{ENG00,HAN97,VOG02}. Besides the
classical direct regularization approaches as the truncated singular value decomposition or the Tikhonov method, an increasing
interest has been devoted to iterative regularization strategies, that are in general more computationally effective for large
scale problems and allow an easier introduction of constraints on the desired solution (e.g., non-negativity, flux conservation)
\cite{BAR06,BEN10,BER98,BER08,VOG02}. Although in general the regularization property of iterative approaches is not
theoretically proved, most of them exhibits the so-called {\em semiconvergence effect}, i.e., the reconstruction error decreases
until one optimal iterate and then diverges. Such behaviour has been analyzed e.g. by Nagy \& Palmer \cite{NAG03} and
Donatelli \& Serra Capizzano \cite{DON08} in terms of {\em filter factors} \cite{HAN06}. In particular, in \cite{NAG03}
some classical gradient methods have been reformulated as a linear combination of the singular vectors of $\mybf{A}$,
in which the coefficients form involves the inverse of the singular values $\sigma_i$ multiplied for suitable factors that balance
possible noise amplification effects due to small values of some $\sigma_i$. In this paper we want to go one step further,
proving that a similar expansion holds true even if a scaling matrix multiplying the gradient is present. Moreover,
we investigate the effect on the filter factors of some scaling matrices, arising from both the numerical optimization and
the imaging framework. In particular, we show that the apparently negative oscillating
behaviour of the filters provided by some scaled schemes results to be a surplus value for a more detailed reconstruction
of the true solution. Finally, we extend our analysis to a particular class of projected gradient methods in the case of
non-negative solutions.\\
The plan of the paper is the following: in Section 2 we introduce the optimization methods for the solution of \eqref{eq1}
we decided to analyze, while in Section 3 the state-of-the-art on such algorithms as filtering methods is summarized, and
the extensions to the scaled and projected cases are provided. Section 4 shows the behaviour of the
filter factors for the considered regularization algorithms through some numerical experiments, while our conclusions are
offered in Section 5.

\section{Gradient methods}\label{sec2}

A gradient method for the solution of \eqref{eq1} is an iterative algorithm whose $(k+1)$--th element is defined by
\begin{equation}\label{eq:SGiteration}
\mybf{x}_{k+1} = \mybf{x}_{k} -\alpha_k\mybf{M}_k\mybf{g}_k,
\end{equation}
where:
\begin{itemize}
 \item $\mybf{g}_k = \nabla f(\mybf{x}_k) = \mybf{A}^T(\mybf{A}\mybf{x}_k - \mybf{b})$ is the gradient vector;
 \item $\mybf{M}_k$ is a symmetric and positive definite scaling matrix;
 \item $\alpha_k$ is the steplength parameter.
\end{itemize}
In the literature, a large variety of possibilities for choosing the steplength $\alpha_k$ and the scaling matrix $\mybf{M}_k$
has been proposed. Classical examples of steplength selection are the Steepest Descent (SD) \cite{CAU47} and the Minimal Gradient
(MG) \cite{DAI03,ZHO06} methods, which minimize $f(\mybf{x}_k - \alpha\mybf{M}_k\mybf{g}_k)$ and
$\|\nabla f(\mybf{x}_k - \alpha\mybf{M}_k\mybf{g}_k)\|_2$, respectively:
\begin{equation}\label{eq:aSD}
\alpha_k^{SD} = \underset{\alpha \in \mathbb{R}}{\text{argmin}} \ f(\mybf{x}_k - \alpha\mybf{M}_k\mybf{g}_k) =
\frac{\mybf{g}_k^T\mybf{M}_k\mybf{g}_k}{\|\mybf{A} \mybf{M}_k\mybf{g}_k\|_2^2}.
\end{equation}
\begin{equation}\label{eq:aMG}
\alpha_k^{MG} = \underset{\alpha \in \mathbb{R}}{\text{argmin}} \ \|\nabla f(\mybf{x}_k - \alpha\mybf{M}_k\mybf{g}_k)\|_2 =
\frac{\mybf{g}_k^T\mybf{M}_k \mybf{A}^T\mybf{A} \mybf{g}_k}{\|\mybf{A}^T\mybf{A}\mybf{M}_k\mybf{g}_k\|_2^2}.
\end{equation}
In order to accelerate the slow convergence exhibited in most cases by the standard formulas \eqref{eq:aSD} and \eqref{eq:aMG},
many other strategies for the steplength selection have been proposed, as the two Barzilai and Borwein (BB) rules \cite{BAR88}
\begin{equation*}\label{eq:BB_non_scal}
\alpha_k^{BB1} = \frac{\mybf{s}_{k-1}^T\mybf{s}_{k-1}}{\mybf{s}_{k-1}^T\mybf{y}_{k-1}} \qquad ; \qquad
\alpha_k^{BB2} = \frac{\mybf{s}_{k-1}^T\mybf{y}_{k-1}}{\mybf{y}_{k-1}^T\mybf{y}_{k-1}},
\end{equation*}
where $\mybf{s}_{k-1} = \mybf{x}_{k} - \mybf{x}_{k-1}$ and $\mybf{y}_{k-1} = \mybf{g}_{k}-\mybf{g}_{k-1}$. These two schemes have been
adapted to account for the scaling matrix \cite{BON09} as follows
\begin{equation*}\label{eq:BB}
\alpha_k^{BB1S} = \frac{\mybf{s}_{k-1}^T\mybf{M}_k^{-1}\mybf{M}_k^{-1}\mybf{s}_{k-1}}{\mybf{s}_{k-1}^T\mybf{M}_k^{-1}\mybf{y}_{k-1}} \qquad ; \qquad
\alpha_k^{BB2S} = \frac{\mybf{s}_{k-1}^T\mybf{M}_k\mybf{y}_{k-1}}{\mybf{y}_{k-1}^T\mybf{M}_k\mybf{M}_k\mybf{y}_{k-1}}.
\end{equation*}
Further accelerations have been proposed hereafter by alternating different steplength rules by means of an adaptively controlled
switching criterion. Examples of such rules are the Adaptive Steepest Descent (ASD) method, the Adaptive Barzilai-Borwein (ABB)
method \cite{ZHO06} and its generalizations $\text{ABB}_{\text{min1}}$ and $\text{ABB}_{\text{min2}}$ provided by Frassoldati et
al. \cite{FRA08}.\\
As far as the scaling matrix concerns, the first example we considered is given by the well-known conjugate gradient algorithm for the
least squares problem (CGLS). Indeed, this method can be expressed in the form \eqref{eq:SGiteration} by choosing the SD steplength
and the scaling matrix
\begin{equation*}
\mybf{M}_k = \mybf{I} - \frac{\mybf{s}_{k-1}\mybf{y}_{k-1}^T}{\mybf{y}_{k-1}^T\mybf{s}_{k-1}}.
\end{equation*}
In our analysis, we also included two scaling matrices arising from the constrained optimization case. The first is the one provided by the iterative space reconstruction algorithm (ISRA), proposed by
Daube-Whiterspoon and Muehllener \cite{DAU86} for reducing the computational cost of the expectation-maximization (EM) algorithm
of Shepp and Vardi \cite{SHE82} in emission tomography. The explicit expression of the scaling matrix is
\begin{equation*}\label{ISRA}
\mybf{M}_k = \text{diag}\left(\frac{\mybf{x}_k}{\mybf{A}^T\mybf{A}\mybf{x}_k}\right),
\end{equation*}
where the quotient is intended in the Hadamard sense, and we obtain the positive definiteness by thresholding the diagonal elements
in a prefixed interval $0 < L_{\min} < L_{\max}$.\\
The second scaling matrix is the one described in \cite{HAG09} by Hager, Mair and Zhang (HMZ), that exploits a gradient splitting
strategy \cite{LAN01,LAN02} with a resulting scaling matrix given by
\begin{equation}\label{Hager}
\mybf{M}_k = \text{diag}\left(\frac{\alpha_k^{CBB1}\mybf{x}_k}{\mybf{x}_k + \alpha_k^{CBB1}(\mybf{A}^T\mybf{A}\mybf{x}_k-
\mybf{A}^T\mybf{b})^+}\right),
\end{equation}
where $t^+ = \max\{0,t\}$ and $\alpha_k^{CBB1}$ is a cyclic version of the first BB steplength rule computed by reusing
$\alpha_k^{BB1}$ for $p$ consecutive iterations \cite{DAI06}. A further thresholding step assures again the positive definiteness
of the scaling matrix.\\
We remark that here we are {\em not} considering the ISRA and HMZ algorithms, but we only borrow the scaling
matrices defined in the algorithms themselves and use them in our scaled gradient scheme.\\
We point out that, while the convergence of the nonscaled gradient methods with the steplengths described before is guaranteed,
the presence of a scaling matrix might require a thresholding of the steplength in a fixed range of positive values
$[\alpha_{min},\alpha_{max}]$, followed by the introduction of a successive steplength reduction strategy. A classical example is the well-known Armijo rule \cite{BER99}: for given scalars $0 <  \gamma,\beta < 1$ and $z_k > 0$, the steplength $\alpha_k$
is set equal to $\beta^{q_k}z_k$, where $q_k$ is the first non-negative integer $q$ for which
\begin{equation*}\label{Armijo}
f(\mybf{x}_k)-f(\mybf{x}_k-\beta^qz_k\mybf{M}_k\nabla f(\mybf{x}_k)) \geq \gamma\beta^qz_k \nabla f(\mybf{x}_k)^T\mybf{M}_k\nabla f(\mybf{x}_k).
\end{equation*}

\section{Filtering effect}

When considering a linear inverse problem with noisy data
\begin{equation*}
\mybf{b} = \mybf{A}\mybf{x}_{\text{true}} + \mybf{\eta},
\end{equation*}
it is well-known that the role played by a regularization method is to contrast the amplifying effect on the noise $\mybf{\eta}$ due to the small singular values of $\mybf{A}$. Indeed, if $\mybf{A} = \mybf{U}\mybf{\Sigma}\mybf{V}^T$ is the singular value decomposition of the matrix $\mybf{A}$, $\mybf{u}_i$, $\mybf{v}_i$ are the columns of $\mybf{U}$, $\mybf{V}$ and $\sigma_1 \geq \ldots \geq \sigma_n > 0$ are the diagonal elements of $\mybf{\Sigma}$, then the following relation for the solution $\mybf{x}^\dagger$ of \eqref{eq1} holds:
\begin{equation}\label{lincom}
\mybf{x}^\dagger = \sum_{i=1}^n \frac{\mybf{u}_i^T\mybf{b}}{\sigma_i}\mybf{v}_i = \mybf{x}_{\text{true}} + \sum_{i=1}^n \frac{\mybf{u}_i^T\mybf{\eta}}{\sigma_i}\mybf{v}_i.
\end{equation}
The classical recipe to contain the error propagation on the regularized solution $\mybf{x}_{\text{reg}}$ consists of adding some weights in the linear combination \eqref{lincom} that filter out the last components:
\begin{equation}\label{solreg}
\mybf{x}_{\text{reg}} = \sum_{i=1}^n \phi_i \frac{\mybf{u}_i^T\mybf{b}}{\sigma_i}\mybf{v}_i.
\end{equation}
The truncated singular value decomposition (TSVD) and the Tikhonov method are examples of this approach, and the corresponding regularized solutions can be written in the form \eqref{solreg} with, respectively,
\begin{equation*}
\phi_i = \begin{cases} 1 & \text{if } \ i \leq r \\ 0 & \text{if } \ i > r \end{cases} \qquad ; \qquad \phi_i = \frac{\sigma_i^2}{\sigma_i^2 + \lambda}, \end{equation*}
where $r \in \{1,\ldots,n\}$ and $\lambda > 0$.

\subsection{The nonscaled case}

Besides the classical ``direct'' approaches as TSVD and Tikhonov, also iterative regularization strategies can be thought by means of their filtering effect. Indeed, expression \eqref{solreg} can be generalized to the regularized solution $\mybf{x}_{k+1}$ provided by any gradient method by writing
\begin{equation*}\label{solregk}
\mybf{x}_{k+1} = \sum_{i=1}^n \phi_i^{k+1} \frac{\mybf{u}_i^T\mybf{b}}{\sigma_i}\mybf{v}_i.
\end{equation*}
where the filter factors $\phi_i^{k+1}$ are automatically defined during the iterative procedure. The easiest example of gradient method is the Landweber algorithm, which generates a sequence $\{\mybf{x}_k\}$ by
\begin{equation}\label{eq:Landweber}
\mybf{x}_{k+1} = \mybf{x}_{k} -\alpha\mybf{g}_k = \mybf{x}_k -\alpha\mybf{A}^T(\mybf{A}\mybf{x}_k - \mybf{b})\,,
\end{equation}
where the steplength $\alpha$ is fixed during the iterations and must satisfy $0 < \alpha < 2/\sigma_1^2$ in order
to guarantee the convergence. The iteration \eqref{eq:Landweber} can be rewritten, by choosing the initial guess
$\mybf{x}_0 = \mybf{0}$, as
\begin{equation*}
\mybf{x}_{k+1} = \alpha\sum_{\ell = 0}^k(\mybf{I} - \alpha\mybf{A}^T\mybf{A})^\ell\mybf{A}^T\mybf{b}
\end{equation*}
or, equivalently, by means of the SVD as
\begin{equation*}
\mybf{x}_{k+1} = \sum_{i = 1}^n\left(1 - (1 -\alpha\sigma_i^2)^{k+1}\right)\frac{\mybf{u}_i^T\mybf{b}}{\sigma_i}\mybf{v}_i\,,
\end{equation*}
thus obtaining an expression for the filter factors given by
\begin{equation*}\label{eq:FFLandweber}
\phi_i^{k+1} = 1 - (1 - \alpha\sigma_i^2)^{k+1}\quad k=0,1,\ldots
\end{equation*}
The previous equation suggests an extension to the case of the steplength $\alpha_k$ varying at each iteration, in the case of nonscaled gradient. If $\mybf{M}_k = \mybf{I}$, indeed, the filter factors of a general gradient method can be written as
\begin{equation}\label{eq:FFgradient-type_methods}
\phi_i^{k+1} = 1 - \prod_{\ell = 0}^k \bigl(1 - \alpha_\ell\sigma_i^2\bigr)\quad k=0,1,\ldots
\end{equation}
Since the sequence generated by the gradient method converges to the least-squares solution $\mybf{x}^\dagger$, the filter factors
$\phi_i^{k+1}$ will tend to 1 as $k$ increases. Moreover, from the form of the products in \eqref{eq:FFgradient-type_methods} we
can observe that the convergence rate of the sequence $\{\phi_i^{k+1}\}$ to its limit value depends on the steplength values
$\alpha_\ell$. In Figure \ref{fig:FiltriHeatNoScal}, the filter factors obtained in a numerical experiment with different steplength
rules have been reported as functions of the singular values index $i$. In particular, we considered the \texttt{heat} dataset
from Hansen's \textit{Regularization Tools} \cite{HAN94} and we plotted the filter factors generated at iteration 10, 30 and at
the iteration corresponding to the minimum error for gradient methods with the MG, SD, BB1, BB2, ABB and ABB$_{\text{min1}}$
steplength rules (in this very last case, we used the revised version of the ABB$_{\text{min1}}$ scheme
proposed in \cite{PRA12}). In all cases the filter factors start from zero (since we chose $\mybf{x}_0 = \mybf{0}$ as initial point) and
converge to 1, with a faster convergence clearly visible for the factors corresponding to the largest singular values.
Moreover, the regular and smooth filter trends achieved in all the figures show that any steplength selection rule is not
able to generate filter factors that behave as erratically as the true ones given by
$\sigma_i(\mybf{v}_i^T\mybf{x}_{\text{true}})/(\mybf{u}_i^T\mybf{b})$.

\begin{figure}[ht]
\begin{center}
 \begin{tabular}{ccc}
\includegraphics[scale = 0.27]{fig1a}&
\includegraphics[scale = 0.27]{fig1b}&
\includegraphics[scale = 0.27]{fig1c}\\
MG & SD & BB1\\
\includegraphics[scale = 0.27]{fig1d}&
\includegraphics[scale = 0.27]{fig1e}&
\includegraphics[scale = 0.27]{fig1f}\\
BB2  & ABB & ABB$_{\text{min1}}$
 \end{tabular}
\caption{Comparison of the $\mybf{x}_{\text{true}}$ filter factors (black thin) for the \texttt{heat} test problem with the ones generated by gradient methods with different steplength rules at iteration 10 (cyan thick), 30 (red dashed) and at the iteration corresponding to the minimum error (blue dashdot).}\label{fig:FiltriHeatNoScal}
\end{center}
\end{figure}

\subsection{Adding a scaling matrix}

If we assume $\mybf{x}_0 = \mybf{0}$, then the general expression \eqref{eq:SGiteration} of a gradient method can be easily rewritten in the form
\begin{equation*}
\mybf{x}_{k+1} = P_k(\mybf{A}^T\mybf{A})\mybf{A}^T\mybf{b},
\end{equation*}
where the polynomial $P_k$ acts on a $n \times n$ matrix $\mybf{\Omega}$ as
\begin{equation}\label{matpol}
P_k(\mybf{\Omega}) = P_{k-1}(\mybf{\Omega})+\alpha_k\mybf{M}_k(\mybf{I} - \mybf{\Omega} P_{k-1}(\mybf{\Omega})), \qquad P_{-1}(\mybf{\Omega}) = \mybf{0}.
\end{equation}
By writing $\mybf{x}_{k+1}$ in terms of the basis formed by $\mybf{v}_i$ and setting $\mybf{Q}_k = \mybf{V}^T P_k(\mybf{A}^T\mybf{A})\mybf{V}$, the following equations hold:
\begin{eqnarray}
\label{eq:xfilt_scal}
\nonumber
\mybf{x}_{k+1} & = & \mybf{V}\mybf{V}^T P_k(\mybf{A}^T\mybf{A})\mybf{V}\mybf{V}^T \mybf{A}^T\mybf{b} = \nonumber \\
& = &\sum_{i=1}^n (\mybf{Q}_k\mybf{V}^T\mybf{A}^T\mybf{b})_i\mybf{v}_i = \sum_{i=1}^n (\mybf{Q}_k\mybf{\Sigma}^T\mybf{U}^T\mybf{b})_i\mybf{v}_i =\nonumber \\
& = & \sum_{i=1}^n \left( \sum_{j=1}^n (\mybf{Q}_k)_{ij}\sigma_j \mybf{u}_j^T\mybf{b}\right) \mybf{v}_i =\nonumber\\
& = & \sum_{i=1}^n\sigma_i^2 \left( \frac{\sum_{j=1}^n (\mybf{Q}_k)_{ij}\sigma_j\mybf{u}_j^T\mybf{b}}{\sigma_i\mybf{u}_i^T\mybf{b}}\right) \frac{\mybf{u}_i^T\mybf{b}}{\sigma_i}\mybf{v}_i.
\end{eqnarray}
Comparing \eqref{solreg} and \eqref{eq:xfilt_scal}, it is easy to see that the filter factors for the $(k+1)$-th iteration of a scaled gradient method have the expression below:
\begin{equation}\label{filtscal}
\phi_i^{k+1}= \sigma_i^2 \left( \frac{\sum_{j=1}^n(\mybf{Q}_k)_{ij}\sigma_j \mybf{u}_j^T\mybf{b}}{\sigma_i\mybf{u}_i^T\mybf{b}}\right)\,,\qquad i=1,\ldots,n.
\end{equation}
Since, when $\mybf{M}_k$ is the identity matrix, $\mybf{Q}_k$ can be written as
\begin{align*}
\mybf{Q}_k = & \mybf{V}^TP_k(\mybf{A}^T\mybf{A})\mybf{V} = \mybf{V}^TP_k(\mybf{V}\mybf{\Sigma}^T\mybf{\Sigma}\mybf{V}^T)\mybf{V} =\\
= & \mybf{V}^T\left[\mybf{V} P_k(\mybf{\Sigma}^T\mybf{\Sigma})\mybf{V}^T\right]\mybf{V} = P_k(\mybf{\Sigma}^T\mybf{\Sigma})\,,
\end{align*}
it follows that the general expression \eqref{filtscal} for the nonscaled case becomes, according to
\cite{NAG03},
\begin{equation}
\label{filtnonscal}
\phi_i^{k+1} = \sigma_i^2P_{k+1}(\sigma_i^2)\,, \qquad i=1,\dots,n,
\end{equation}
where equation \eqref{matpol} reduces to a usual scalar polynomial
\begin{equation*}
P_k(\xi) = P_{k-1}(\xi)+\alpha_k(1 - \xi P_{k-1}(\xi)), \qquad P_{-1}(\xi) = 0.
\end{equation*}
From equation \eqref{filtscal} we can see the effect of the scaling matrix on the filters expression: the presence of
$\mybf{M}_k$ makes any factor $\phi_i^{k+1}$ related to all the singular values $\sigma_1,\ldots,\sigma_n$ and all
the singular vectors $\mybf{u}_1,\ldots,\mybf{u}_n$, while for the nonscaled case each value depends only of the $i$-th singular
value $\sigma_i$. For this reason, the filter factors expression \eqref{filtnonscal}, for the nonscaled methods, cannot be
directly applied to the scaled case. In Section \ref{numexp}, we will show the positive effect
of such more complicated dependence in reconstructing the actual values of the true solution filter factors.

\subsection{Non-negative solutions}\label{secproj}

When the unknown $\mybf{x}$ refers to a physical quantity, it is quite common to require its entries to be non-negative and,
consequently, the problem \eqref{eq1} becomes
$$
\min_{\mybf{x} \geq 0} f(\mybf{x}) \equiv \frac{1}{2} \| \mybf{A} \mybf{x} - \mybf{b} \|_2^2.
$$
The modified general form of a gradient method accounting for this constraint on $\mybf{x}$ is the following \cite{BER99}:
\begin{equation}\label{gradproj2}
\mybf{x}_{k+1} = \mybf{x}_{k} + \lambda_k\left(\mathbb{P}^+_{\mybf{M}_k^{-1}}(\mybf{x}_{k} -\alpha_k\mybf{M}_k\mybf{g}_k)-\mybf{x}_{k}\right), \quad k=0,1,\ldots,
\end{equation}
where $\lambda_k$ is a linesearch parameter (typically chosen by means of an Armijo rule along the feasible direction) and $\mathbb{P}^+_{\mybf{M}}(\mybf{z})$ denotes the projection of the point $\mybf{z}$ on the non-negative orthant with respect to the norm induced by the matrix $\mybf{M}$, i.e.
\begin{equation*}
\mathbb{P}^+_{\mybf{M}}(\mybf{z}) = \underset{\mybf{x} \geq 0}{\text{argmin}} (\mybf{x}-\mybf{z})^T \mybf{M} (\mybf{x}-\mybf{z}).
\end{equation*}
For a general scaled gradient method, therefore, the introduction of a constraint on $\mybf{x}$ requires the solution of a quadratic program at each iteration. Here we consider the case in which the projection on the non-negative orthant can be expressed by means of a left multiplication for a diagonal matrix $\mybf{D}_k$, where
\begin{equation*}
(\mybf{D}_k)_{ii} = \begin{cases} 1 & \text{if } (\overline{\mybf{x}}_{k+1})_i \geq 0 \\ 0 & \text{if } (\overline{\mybf{x}}_{k+1})_i < 0 \end{cases}
\end{equation*}
and
\begin{equation*}
\overline{\mybf{x}}_{k+1} = \mybf{x}_{k} -\alpha_k\mybf{M}_k\mybf{g}_k.
\end{equation*}
The resulting projected gradient method, therefore, assumes the form
\begin{equation}\label{gradprojD}
\mybf{x}_{k+1} = \mybf{x}_{k} + \lambda_k(\mybf{D}_k\overline{\mybf{x}}_{k+1}-\mybf{x}_{k}), \quad k=0,1,\ldots
\end{equation}
The easiest (and mostly used) case of scaling matrix leading to an expression \eqref{gradprojD} for the $(k+1)$--th iteration is a diagonal $\mybf{M}_k$. For a projected gradient method in the form \eqref{gradprojD}, the expression of the filter factors is given again by \eqref{filtscal}, in which the polynomial $P_k$ defining the matrix $\mybf{Q}_{k}$ is generalized accounting for the presence of the projection matrix:
\begin{equation*}\label{matpolproj2}
P_k(\mybf{\Omega}) = P_{k-1}(\mybf{\Omega})+\lambda_k\left[\alpha_k\mybf{D}_k\mybf{M}_k - (\mybf{I} - \mybf{D}_k + \alpha_k\mybf{D}_k\mybf{M}_k\mybf{\Omega}) P_{k-1}(\mybf{\Omega}))\right], \quad P_{-1}(\mybf{\Omega}) = \mybf{0}.
\end{equation*}
A similar expression holds also for the specific case of constant linesearch parameter fixed at unity, $\lambda_k=1$, $k=0,1,\ldots$ (in this case, the convergence of the scheme is guaranteed by an Armijo rule along the projection arc \cite{BER99}). Under this assumption, the gradient iteration becomes
\begin{equation}\label{gradproj2D}
\mybf{x}_{k+1} = \mybf{D}_k\overline{\mybf{x}}_{k+1}, \quad k=0,1,\ldots,
\end{equation}
and the corresponding filter factors can be written again in the form \eqref{filtscal} with
\begin{equation*}\label{matpolproj}
P_k(\mybf{\Omega}) = \mybf{D}_k\left(P_{k-1}(\mybf{\Omega})+\alpha_k\mybf{M}_k(\mybf{I} - \mybf{\Omega} P_{k-1}(\mybf{\Omega}))\right), \qquad P_{-1}(\mybf{\Omega}) = \mybf{0}.
\end{equation*}
The advantage of this simplified case is that expression \eqref{gradproj2D}, while being still valid for a diagonal $\mybf{M}_k$, can be extended also to a wider class of scalings, as the {\em diagonal matrices with respect to} $I^+(\mybf{x}_{k})$ \cite{BER99}, where
\begin{equation*}
I^+(\mybf{x}_{k}) = \left\{ i\in\{1,\ldots,n\} \ \big| \ (\mybf{x}_{k})_i=0,\frac{\partial f(\mybf{x}_{k})}{\partial x_i} > 0 \right\}.
\end{equation*}

\section{Numerical experiments}\label{numexp}

We show now the behaviour of the filter factors for the solutions obtained with the scaling matrices reported in Section \ref{sec2}, in the cases of
both unconstrained and constrained problems. The evaluation of the results will be carried out on two different examples taken
from Hansen's \textit{Regularization Tools} \cite{HAN94}. The first test is the \texttt{heat} 1-dimensional dataset already
mentioned in the previous section. For this test problem we set up $n=64$ and assumed Gaussian noise with zero mean, variance
equals to 1 and scaled so that $\|\mybf{\eta}\|_2 / \|\mybf{A}\mybf{x}_{\text{true}}\|_2 = 0.01$. In Table \ref{Tab1} we report
the best reconstruction errors $\| \mybf{x}_k - \mybf{x}_{\text{true}} \|_2 / \| \mybf{x}_{\text{true}} \|_2$ for the six
steplength rules considered in Figure \ref{fig:FiltriHeatNoScal} when $\mybf{D}_k = \mybf{M}_k = \mybf{I}$ for all $k$.
From the results obtained, we can see that at the best iteration all the steplengths provide similar filter factors and,
consequently, similar approximated solution.

\begin{table}[ht]
\caption{Numbers of iterations required by nonscaled gradient methods with different steplengths and minimum error reached
for solving \texttt{heat}.}
\label{Tab1}
\begin{center}
\begin{tabular}{l|cc}
\hline\noalign{\smallskip}
Method  						& Iter & Min err  \\
\noalign{\smallskip}\hline\noalign{\smallskip}
MG    							&   94 &    0.049 \\
SD    							&   97 &    0.049 \\
BB1   							&   30 &    0.049 \\
BB2   							&   29 &    0.049 \\
ABB   							&   30 &    0.048 \\
ABB$_\text{min1}$   &   29 &    0.048 \\
\noalign{\smallskip}\hline
\end{tabular}
\end{center}
\end{table}

\noindent For this reason, in order to evaluate the performance of the scaled and/or projected versions, in the following we
will adopt the SD rule for the steplength selection. We consider first the unconstrained case and we analyze the behaviour of the different scalings
on the restored solutions. The best reconstruction errors obtained by ISRA, HMZ and CGLS matrices are provided in Table \ref{Tab2},
while the corresponding filter factors are shown in Figure \ref{fig:FiltriHeatScal}. For the HMZ case we chose the value $p=4$
for the cyclic version of the BB1 steplength rule defining $\mybf{M}_k$ - see equation \eqref{Hager}. Moreover, the diagonal
elements of the scaling matrices provided by the ISRA and HMZ approaches have been thresholded in the range $[10^{-3},10^{8}]$.

\begin{table}[ht]
\caption{Optimal numbers of iterations required by gradient methods with SD steplength and different scaling matrices
for solving \texttt{heat}, with the corresponding minimum error. The suffix `\_P' denotes the projected algorithms.}
\label{Tab2}
\begin{center}
\begin{tabular}{l|cc}
\hline\noalign{\smallskip}
Method  & Iter & Min err \\
\noalign{\smallskip}\hline\noalign{\smallskip}
SD      &   97 &   0.049 \\
CGLS    &   11 &   0.047 \\
ISRA    &   25 &   0.037 \\
HMZ     &   33 &   0.044 \\
\noalign{\smallskip}\hline\noalign{\smallskip}
SD\_P   &  116 &   0.037 \\
ISRA\_P &   14 &   0.034 \\
HMZ\_P  &   66 &   0.037 \\
\noalign{\smallskip}\hline
\end{tabular}
\end{center}
\end{table}

\begin{figure}[ht]
\begin{center}
 \begin{tabular}{cc}
\includegraphics[scale = 0.30]{fig2a}&
\includegraphics[scale = 0.30]{fig2b}\\
SD & CGLS \\
\includegraphics[scale = 0.30]{fig2c}&
\includegraphics[scale = 0.30]{fig2d}\\
ISRA & HMZ \\
 \end{tabular}
\caption{Comparison of the $\mybf{x}_{\text{true}}$ filter factors (black dashed) for the \texttt{heat} test problem
with the ones generated by gradient methods with different scaling matrices at the iteration corresponding to the minimum
error (red solid). The nonscaled filters are also reported (SD).}
\label{fig:FiltriHeatScal}
\end{center}
\end{figure}

\noindent From the reconstruction errors and the filter factors we can make the following remarks:
\begin{itemize}
\item as expected, the presence of a scaling matrix provides an acceleration of the algorithms, resulting in a general lower
number of iterations required to achieve the best reconstruction. In particular, the well-known fast convergence of the CGLS
method is attested by the very few iterations needed;
\item the slower convergence seems to help the diagonal scalings ISRA and HMZ in providing better regularized solutions.
The improvements in the performances are clearly visible also in the plots of the filter factors.
The CGLS filters $\phi_i^{k+1}$ ($i=1,\ldots,n$) at each iteration preserve the ``regularity'' with respect to the index $i$
already observed in Figure \ref{fig:FiltriHeatNoScal} for the nonscaled methods. On the contrary, the ISRA and HMZ scalings
succeed in reconstructing more faithfully the irregular filters profile of the true solution;
\item the effect of the scaling matrix, however, seems to provide some general improvements in the reconstruction errors
also for the CGLS matrix, even if the differences with the nonscaled case are minimal.
From the plots shown in Figure \ref{fig:FiltriHeatScal}, we can observe that these improvements are due to the
slightly better reconstructions of the very first filters, corresponding to the higher singular values.
\end{itemize}
The same test problem has been used for the analysis of the projected algorithms, since its solution is a non-negative vector.
In this case, we considered only the nonscaled method and the diagonal scaling matrices ISRA and HMZ, for which the projection
is trivial (see Section \ref{secproj}). Moreover, we did not find any difference between the projection schemes \eqref{gradprojD}
and \eqref{gradproj2D}, therefore we will present only the results obtained in the latter case. The best reconstruction errors
and the corresponding numbers of iterations required by the different algorithms are reported again in Table \ref{Tab2}, while
the filter factors are plotted in Figure \ref{fig:FiltriHeatProj}. In all cases, the presence of the constraint on the
unknown produces a positive effect on the solution, attested by the reported lower reconstruction error. In particular, in the
nonscaled case we can observe the irregular filter profile already remarked for the scaled methods, in agreement with the fact
that also the presence of a matrix $\mybf{D}_k$ makes any filter factor related to all the singular values and singular vectors
of the matrix $\mybf{A}$.

\begin{figure}[ht]
\begin{center}
\begin{tabular}{ccc}
\includegraphics[scale = 0.27]{fig3a}&
\includegraphics[scale = 0.27]{fig3b}&
\includegraphics[scale = 0.27]{fig3c}\\
SD\_P & ISRA\_P & HMZ\_P
\end{tabular}
\caption{Comparison of the $\mybf{x}_{\text{true}}$ filter factors (black dashed) for the \texttt{heat} test problem with
the ones generated by projected gradient methods with the ISRA and HMZ scaling matrices at the iteration corresponding
to the minimum error (red solid). The nonscaled filters are also reported (SD\_P).}
\label{fig:FiltriHeatProj}
\end{center}
\end{figure}

\noindent Very similar considerations hold true also in the second test we carried out and concerning a 2-dimensional dataset.
In particular, we used the \texttt{blur} test problem, taken again from Hansen's \textit{Regularization Tools} and simulating
the degrading effect on a real image due to the action of a general acquisition system (see Figure \ref{figblur1}).
Here we set $n = 256$, thus obtaining the true and measured images of $16 \times 16$ pixels. Moreover, we assumed the same
parameters for the noise that we chose in the \texttt{heat} case.\\
A clear figure with the plots of the filter factors for all the considered gradient methods is hard to be produced, due to
the irregularity of the filter profiles and the higher number of filters themselves with respect to the 1-dimensional test.
However, we noticed again the regular behaviour in the unconstrained problem of the nondiagonal scalings, while the filter
factors provided by ISRA and HMZ reproduced more precisely the ones computed with the true image. With the addition of the
projection on the non-negative orthant, the reconstruction errors of both the nonscaled and the diagonally scaled algorithms
decrease, reflecting the fact that a more faithful representation of the filters leads to a better reconstruction of the true image.
In order to appreciate the positive effects on the regularized solutions, for this 2-dimensional case we reported in Figure
\ref{figblur1} the restored images by the different algorithms. In particular, we can see that the gradient method with the
ISRA scaling is able to remove most artifacts also in the unconstrained case. When the projected algorithms are used, instead,
the presence of a scaling matrix seems to provide some benefits only in the reduced number of iterations required,
since the best reconstruction error is already achievable with the nonscaled method.

\begin{table
\begin{center}
\caption{Optimal numbers of iterations required by gradient methods with SD steplength and different scaling matrices
for solving \texttt{blur}, with the corresponding minimum error. The suffix `\_P' denotes the projected algorithms.}
\label{Tabella2}
\begin{tabular}{l|cc}
\hline\noalign{\smallskip}
Method  & Iter & Min err \\
\noalign{\smallskip}\hline\noalign{\smallskip}
SD      & 1199 & 0.256 \\
CGLS    &   28 & 0.223 \\
ISRA    &  847 & 0.111 \\
HMZ     & 1352 & 0.165 \\
\noalign{\smallskip}\hline\noalign{\smallskip}
SD\_P   & 1870 & 0.089 \\
ISRA\_P & 1590 & 0.094 \\
HMZ\_P  &  707 & 0.089 \\
\noalign{\smallskip}\hline
\end{tabular}
\end{center}
\end{table}

\begin{figure}[ht]
\begin{center}
 \begin{tabular}{ccc}
\includegraphics[width = 0.25\textwidth]{fig4a}&
\includegraphics[width = 0.25\textwidth]{fig4b}&
\includegraphics[width = 0.25\textwidth]{fig4c}\\
True image & Measured image & SD \\
\includegraphics[width = 0.25\textwidth]{fig4d}&
\includegraphics[width = 0.25\textwidth]{fig4e}&
\includegraphics[width = 0.25\textwidth]{fig4f}\\
ISRA & HMZ & CGLS \\
\includegraphics[width = 0.25\textwidth]{fig4g}&
\includegraphics[width = 0.25\textwidth]{fig4h}&
\includegraphics[width = 0.25\textwidth]{fig4i}\\
SD\_P & ISRA\_P & HMZ\_P
 \end{tabular}
\caption{Comparison of the best reconstructed images for the \texttt{blur} test problem generated by gradient methods with
different scaling matrices. The reconstruction with a nonscaled method is also reported (SD). The suffix `\_P' denotes the
projected algorithms. True object and corresponding blurred noisy image are also showed.}\label{figblur1}
\end{center}
\end{figure}

\section{Conclusions}

In this paper we analyzed the regularizing effect of several gradient methods for the solution of the linear least-squares problem,
i.e., the ability of the scheme to produce a sequence of vectors that, at a certain iteration, approximates as close as possible the
true solution. The analysis we carried out has been made in terms of the ability of a given method to reproduce correctly the filter
factors of the solution, accounting for the way in which the resulting sequence opposes the amplification effect of the noise on the
data due to the presence of small singular values. The starting point of our work has been a paper of Nagy \& Palmer, in which the
filter factors for nonscaled gradient methods have been formally calculated and numerically analyzed. In our paper we extended this
analysis to the presence of scaling matrices in defining the descent direction, showing the analytical form of the corresponding filter
factors and the advantages that can be obtained not only in terms of efficiency in decreasing the
least-squares functional, but also in providing a better approximations of the unknown solution (as remarked e.g. in \cite{BON13}).
Moreover, we also considered the case of non-negative constraints, and we generalized the expression of the filter factors to the
projected gradient methods whose projection can be performed by means of the multiplication with a suitable diagonal matrix.
We showed on some numerical examples the positive effect of the projection in reconstructing the irregular
filter profiles of the true solution, in both scaled and nonscaled cases.

\section*{Acknowledgements}
This work has been partially supported by the Italian Spinner2013 PhD Project ``High-complexity inverse problems in biomedical applications and social systems'' and by a grant of the Italian Gruppo Nazionale per il Calcolo Scientifico (GNCS) - Istituto Nazionale di Alta Matematica (INdAM).

redpajama_set_name: RedPajamaArXiv


In the Welcome Article for this blogsite I raised the remarkable phenomenon of how the gospel spread so quickly and pervasively when it burst onto Greco-Rome of classical times – even though it was met with ferocious and bloody opposition from that same world. So what fueled such a forceful advance? Several reasons stand out, but the one that I want to focus on for the next while has to do with what the people of that era saw in the Bible of their day. But to better appreciate what they saw, we need to re-discover their Bible since it has become a mostly forgotten book in our day. So with this endgoal in mind, I introduce the Bible of that era – the Septuagint. But first let's back up abit in history.
When Alexander the Great conquered the then known world he brought the Greek language, culture and philosophy to the civilizations of the Mediterranean, the Middle East, and Asia. When he died in 323 BC at the age of 32 he left behind a world that almost universally adopted the Greek language, thought and culture (known as Hellenism), thus unifying the world so that ideas and writings could be exchanged by all in one universal language – Greek. And the Roman Empire which succeeded his short-lived conquests continued to use, and thus increase the influence of, Greek.
Greek was the principal language of the classical world from about 300 BC – 300 AD, and thus a translation of the Hebrew Old Testament into Greek was made around 200 B.C. by a group of Jewish rabbis in Alexandria (a city in Egypt present till today and founded by Alexander the Great). Known as the Septuagint (or LXX), it was widely used in the Greco-Roman world and was of critical importance in the development of the Gospel for several reasons.
First of all, the Septuagint translation was made because in that Hellenistic world the Jewish people were slowly losing their grasp of Hebrew and many were becoming primarily Greek-speakers and the LXX thus allowed them to continue reading their scriptures in their new language. But it also allowed the writings of the Old Testament to be read and assessed by basically all Gentiles (non-Jews). And in the spirit of that age in which philosophy, history and religion of various cultures were read, for the first time many non-Jews were exposed to the writings of the ancient Hebrew prophets.
We see the impact of this in the New Testament historical accounts. John 12:20 tells us that Greeks (i.e. non-Jews) were worshiping at a Jewish feast in Jerusalem and asked to meet with Jesus. Why are Greeks 'worshiping' at a Jewish festival in Jerusalem? It is the influence of the Septuagint. The book of Acts records the travels of the apostles subsequent to the ministry of Jesus and it notes how they would come upon (and even look for) non-Jewish converts to Judaism. Why are there non-Jewish converts to Judaism dotted around the Greco-Roman world in the period 30-60 AD (the period covered by Acts)? Again, the influence of the Septuagint having been read, heard, and brought to the attention of non-Jews for more than two hundred years had fostered this development.
And what did these people 'see' in the Septuagint? For starters they saw 'Christ' in the pages of the Old Testament because the word was used directly in it.
The Septuagint is also significant in textual criticism. We noted in the 2nd video of Session 3 (the one dealing with Old Testament textual reliability) that we basically have two families of Hebrew manuscripts with which we access the Hebrew Old Testament and translate it into a modern language. The more traditional stream is the Masoretic family of manuscripts, which has extant manuscripts dating from about 900 AD. This is the traditional source for the Old Testament in today's Bible. I noted that the second stream, the Dead Sea Scrolls (DSS) were only recently discovered in 1948 and are dated back to about 200 BC. Thus in the DSS we have a much older family of manuscripts than the Masoretic text. And I noted that these two families of texts are basically identical – showing how well preserved the Hebrew Old Testament is.
The Septuagint gives us a third stream of text to access the Old Testament. Since the Septuagint was translated from the Hebrew around 200 BC we can see (if in a sense we reverse translate) what these translators had in their Hebrew manuscripts that they translated from. The most widely accepted view today is that the Septuagint provides an accurate record of an early Hebrew text, now lost, that had some variance from the ancestors of the Masoretic text. And so it is used as a supplemental source in translation today. This is why you can see some footnotes in modern translations of the Old Testament where our modern translators tell us what the Septuagint says in some particular passage. In other words, translation scholars use the Septuagint to this day to help them translate some of the more difficult passages of the Old Testament. Greek is very well understood and in some passages where the Hebrew is obscure translators can see how the Septuagint translators understood these obscure passages. As an example, when the New International Version translates the last phrase of Job 7:20 to 'Have I become a burden to you?' they are helped by the Septuagint. How do I know this? The footnotes indicate it. The overall contribution then of the Septuagint to the Old Testament is that it provides another manuscript stream supporting the reliability of the Old Testament as well as providing insight for some more obscure passages.
But even more than a supplement to translate the Old Testament, followers of the Gospel in Eastern Orthodox traditions (Greek, Coptic etc.) to this day use the Septuagint over the Masoretic text (either in reading from the LXX directly or in translating primarily from the LXX rather than the Hebrew text). It is their preferred manuscript family.
We can summarize what we have covered of the Old Testament text using a timeline shown in the figure below. The individual books of the Old Testament were written down in Hebrew over more than a thousand year period . They were translated into the Septuagint (LXX) around 200 BC so from then on there was a Greek as well as a Hebrew text stream. The Codices Vaticanus and Sinaiticus (from early-mid 300's AD) are extant copies of the LXX. The Hebrew text was preserved by the Masoretes, from whom we have extant manuscripts dating approximately 900 AD. The Dead Sea Scrolls was another Hebrew textual family dating to around 200-100 BC that was essentially identical to the Masoretic text. Translations into English today primarily use the Hebrew Masoretic and Dead Sea Scrolls, but the LXX is also used to inform translators on meaning and choice of words.
But these are not the primary reasons why the Septuagint 'has changed human history' We consider that in our next post.
In my previous post I noted that a really good comment had been submitted on the External Evidence Session, basically questioning the value of external evidence. The comment noted that external evidence does not tell us whether or not the gospel stories were legendary extrapolations built around a historical kernel of events. I agreed, but submitted that at the very minimum external evidence can be used to weed out pretenders from contenders, similar to how first-year university courses are often designed to weed out students with insufficient motivation or aptitude.
First-year courses also serve as the foundational prerequisites upon which the more useful upper-year courses are built – the ones that give the knowledge and information that we really use. In a similar way we are now in a position to integrate the External Evidence Session with that of Session 5 – where we opened a case to see if there is a Divine Mind behind the biblical account.
In that 5th Session we looked at two very important stories in the earliest section of the Old Testament – in the Pentateuch of the books ascribed to Moses. We first looked at the account of Abraham being willing to sacrifice his son on Mount Moriah, which (though many are not aware of it) we showed to be the place where the city of Jerusalem was eventually established. And we saw that there are allusions in this account of Abraham that have fascinating parallels with, and point to, Jesus' crucifixion in Jerusalem. It is the fact that the allusion predates the event it alludes to by thousands of years that makes it so especially intriguing. It points to a drama/literary mind, but since no human mind can coordinate events far into the future it opens the possibility that there is indeed a Divine Mind coordinating these events.
In other words, though the Roman center had previously been in Cesarea, Pilate was in Jerusalem when Jesus was executed. So we have two external sources with unbiased or negative motives that corroborate the crucifixion of Jesus being under Pilate in Jerusalem. Thus we know that the Gospel writers did not fabricate this detail to make it 'fit' the allusion from Abraham.
Similarly with the Mosaic Passover story we saw allusions pointing to the Passover as the time of year when Jesus was to be executed. For Jesus' death to fall on that same festival by chance is slim indeed. Adding to that is that the Mosaic account tells us that this festival is a 'sign for us' and it comes with so many parallels to Jesus crucifixion. Did the Gospel writers fabricate this link to the Passover to make it 'fit' the allusion from Moses?
We did not cover this particular item in the External Evidence session, but in the Jewish Talmud is preserved this statement about the execution of Jesus.
So we have, once again, hostile witnesses, that though disagreeing on the meaning of Jesus, place Jesus' crucifixion (ie hanging) at Passover. They would be the last people to have any motive to do so because it strengthens the meaning of Jesus that they are vehemently at odds with.
So we cannot simply dismiss the fulfillment of these allusions that we looked at in Session 5 as simply fabrications on the part of the gospel writers. We have to take it seriously as history.
In other words, how can one verify the miraculous? And we here are confronted with a strengthening case for a Divine Mind in these accounts since, using external evidence, we cannot dismiss their fulfillment simply by saying that the gospel writers made it up. These particular details are verifiable. And if there is a Divine Mind, i.e. God, then certainly miracles are possible. Now, I titled Session 5 as an 'opening case' because I think if there are only these two allusions it is certainly conceivable that coincidence could explain them. But it does open up a possibility that surely warrants further investigation. Are there more, even ones that are more explicit? Here is a good place to start to investigate.
Though he had a reputation as an 'intellectual' these statements are simply that – sheer assertions without any supporting reasons – just as dogmatic and religiously held as the assertion 'God is Great!' Hitchens obviously never took the time familiarize himself with the information that are covered in Sessions 3, 4 & 5. There are many reasons for a person to reject considering the gospel: atrocities have been committed in the name of Jesus, following the gospel is difficult, and a bewildering array of evil things continue marching on in this world, as if oblivious to the hand of a good God. But the case for the reliability of the Bible is a solid one. It is a pity that so few, Hitchens being a prime example, look into it.
Error: must be one or more categories.
Is this true? Is there even an academic discipline that can answer this question? We look first at the books of the New Testament.
But what about the Old Testament? The manuscipt basis for the Old Testament is different enough that it warrants its own discussion which is highlighted in the 7 minute video here.
30/09/2012 - Did Jesus have a wife?
16/01/2012 - Did Constantine corrupt the Gospel or Bible?


text:
Perama es un género con 30 especies de plantas fanerógamas perteneciente a la familia de las rubiáceas. Es el único miembro de la tribu Perameae.

Es nativa del Caribe y Sudamérica tropical.

Especies seleccionadas
Perama carajensis J.H.Kirkbr. (1980).Perama dichotoma Poepp. in E.F.Poeppig & S.L.Endlicher (1841).Perama ericoides Poepp. in E.F.Poeppig & S.L.Endlicher (1841).Perama galioides'' (Kunth) Poir. in G.-F.Cuvier (1825).

Referencias

Rubioideae

redpajama_set_name: RedPajamaWikipedia


The gist here is that you only worry when people and companies start borrowing money to invest in cryptocurrencies. Basically, if you're putting a small amount on your credit card via one of the exchanges that support it, it is unlikely to create systemic risk; its only when people decide to mortgage their homes and go all in on crypto that there may be issues. This may start happening now that Wall Street is starting to notice this, but its unlikely to happen anytime soon.
"First, let's think about why such a crash might happen. The long-term case for bitcoin is based on its viability as a currency — basically, if people stop using government-issued fiat currencies to buy cars and TVs and bread, and start using cryptocurrencies, early investors who happen to have stashes of the new money on hand will benefit mightily.
People who want to pay for black-market goods like drugs, or who want to launder money, will continue to use it, as will those who want to evade capital controls like those used by China. Other cryptocurrencies, such as ether, are also part of software platforms that allow people to execute smart contracts.
As to why you only worry when people are borrowing to buy it?
Why does debt make bubbles so much worse? When equity crashes, notional wealth simply vanishes. That makes people feel poorer, which makes them consume less — a phenomenon known as the wealth effect. But when companies or households have borrowed a lot of money from each other, an asset price crash can also cause other bad effects. Lenders who see their loans go bad will themselves be forced to borrow money, which slows the real economy because borrowing is costlier than funding a business internally. Debt also creates systemic risk, because key financial institutions can go bankrupt easily if they have too much leverage.
Next post: Can China Contain Bitcoin?


Welcome to Kayak Missouri; your one stop kayaking resource for the state of Missouri.
Kayak Missouri is set up as a place for kayakers to share their adventures in the great State of Missouri; be it flat, open water and (or) river kayaking. Kayak Missouri hopes to expose the great paddling potential available in our own back yard; take a moment to have a look around our great state and explore it in a way few other people have.


text:
About OCRWC Meet Our Team
Meet the OCRWC Team
It takes a special crew to bring the OCRWC to life. These people strive tirelessly to bring you the best experience in obstacle course racing.
Adrian Bijanada
After years of endurance racing himself, Adrian founded the Obstacle Course Racing World Championships in 2013 with the goal of providing an unparalleled and independent platform to unify the sport's athletes and communities. Since then, Adrian has helped grow the OCRWC from a small 600-athlete event in rural Ohio, to a premier international sporting event featuring more than 5,000 athletes representing 75 nations. Under his guidance, OCRWC-related competitions have been held in the United States, Canada, United Kingdom, South Africa, and Australia. A creative entrepreneur at heart, Adrian resides in Brooklyn, NY with his wife and young son.
Rachelanne Gladden
Athlete Services and International Races Manager
Rachelanne is Adventurey's link between the athletes, the qualifying races, and the event itself. She manages all the athlete inquiries, registration needs, visa requests and qualification confirmations, as well as working internationally with the qualifying races to create a mutually beneficial relationship that helps keep our sport growing and thriving. She began a meandering career path straight out of university that began with managing musician bookings for nightclubs in San Francisco. This role morphed into talent management of high-level actors in Los Angeles, jumped to the study of medicine in Seattle, and eventually landed her back in Los Angeles to work in a coveted position as an executive assistant at Warner Brothers. Rachelanne has been with OCRWC since the very beginning. In 2014, she joined the Adventurey team doing research and writing articles. At the first OCR World Championships she showed up a few days early and was asked to help answer the endless barrage of emails that were coming in just days before the event. She loved it. When she was offered a full-time position, there was no looking back. Rachelanne lives in the UK which allows her to be the liaison for Adventurey's international needs. She loves running, hiking, and going on adventures all over the world with her partner.
Brett Stewart
OCRWC Race Director
Fitness Author Brett Stewart's 4th book, Ultimate Obstacle Race Training, was the first book published on the sport of Obstacle Course Racing back in 2012. He is the Co-founder of Mud Run Guide, host & creator of OCR Warrior, and one of the "Founding Four" responsible for the creation and early development of OCR World Championships. Brett has been the Event Director for 2019 North American OCR Champs and 2019 OCR World Championships. He also operates Adventure Fitness with his wife and daughter, developing the next generation of OCR through school obstacle racing programs.
Sandra Sawyer
Partnerships Director
For more than 15 years, Sandra Sawyer has revolutionized sales and marketing in the fitness sector with her invaluable industry expertise, networking know-how and innovative instincts. Early in her career she forged partnerships with Disney, Ragnar Relay Series, Bondi Band, Amazon, and UFC fighter Justin "J-Bomb" Salas. These relationships are testaments to her impressive sales and marketing prowess and keen business insight and intuition. Now, as OCRWC's partnerships director, she uses those same brilliant marketing instincts and communications skills to forge coveted relationships with OCR brand giants inov-8, Hammer Nutrition, MudGear, LegendBorne, Dryrobe, Wreck Bag, Hoo-rag, Veloforte, Force5, and Akuma Sports, just to name a few. When she's not fostering long-lasting OCRWC partnerships, she enjoys volunteering as treasurer for John Bapst Hockey Boosters, having fun with family and friends, and trail running with her Labrador retrievers.
Our Team is Bigger Than Its Founders
About Stratton Mountain Resort
Stratton is a championship-caliber venue with the facilities and infrastructure to provide our athletes and spectators with the best possible experience in the sport of OCR.
Volunteer at the OCRWC
Whether it's the free future race entry or the free lunch, there's always a reward (above the personal satisfaction!) to volunteering.
From the opening fireworks to the international jersey swap, you won't want to miss one minute of the action.
See the Schedule


text:
package sk.henrichg.phoneprofilesplus;

import android.annotation.SuppressLint;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.location.Criteria;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.os.SystemClock;
import android.text.format.DateUtils;
import android.text.format.Time;

import java.util.Calendar;
import java.util.Iterator;

class TwilightScanner {

    //private static final String TAG = "TwilightScanner";
    //private static final boolean DEBUG = false;
    private static final String ACTION_UPDATE_TWILIGHT_STATE = PPApplication.PACKAGE_NAME + ".TwilightScanner.ACTION_UPDATE_TWILIGHT_STATE";

    private final Object mLock = new Object();

    private final Context context;
    private final AlarmManager mAlarmManager;
    private final LocationManager mLocationManager;
    private final LocationHandler mLocationHandler;

    private TwilightState mTwilightState;

    TwilightScanner(Context context) {
        this.context = context;

        mAlarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
        mLocationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
        mLocationHandler = new LocationHandler(null);
    }

    void start() {
        IntentFilter filter = new IntentFilter(Intent.ACTION_AIRPLANE_MODE_CHANGED);
        filter.addAction(Intent.ACTION_TIME_CHANGED);
        filter.addAction(Intent.ACTION_TIMEZONE_CHANGED);
        filter.addAction(TwilightScanner.ACTION_UPDATE_TWILIGHT_STATE);
        context.registerReceiver(mUpdateLocationReceiver, filter);

        mLocationHandler.enableLocationUpdates();
    }

    void stop() {
        mLocationHandler.requestLocationUpdate();

        try {
            context.unregisterReceiver(mUpdateLocationReceiver);
        } catch (Exception e) {
            //PPApplication.recordException(e);
        }
    }

    private void setTwilightState(TwilightState state) {
        synchronized (mLock) {
            if ((mTwilightState == null) || (state == null) || !mTwilightState.equals(state)) {

                mTwilightState = state;

                //final Context appContext = context.getApplicationContext();

                if (!PPApplication.getApplicationStarted(true))
                    // application is not started
                    return;

                if (Event.getGlobalEventsRunning()) {

                    PPExecutors.handleEvents(context, EventsHandler.SENSOR_TYPE_TIME, "SENSOR_TYPE_TIME", 10);
                    /*
                    Data workData = new Data.Builder()
                            .putInt(PhoneProfilesService.EXTRA_SENSOR_TYPE, EventsHandler.SENSOR_TYPE_TIME)
                            .build();

                    OneTimeWorkRequest worker =
                            new OneTimeWorkRequest.Builder(MainWorker.class)
                                    .addTag(MainWorker.HANDLE_EVENTS_TWILIGHT_SCANNER_WORK_TAG)
                                    .setInputData(workData)
                                    .setInitialDelay(10, TimeUnit.SECONDS) // 10 seconds to get location
                                    //.keepResultsForAtLeast(PPApplication.WORK_PRUNE_DELAY_MINUTES, TimeUnit.MINUTES)
                                    .build();
                    try {
                        if (PPApplication.getApplicationStarted(true)) {
                            WorkManager workManager = PPApplication.getWorkManagerInstance();
                            if (workManager != null) {

//                                //if (PPApplication.logEnabled()) {
//                                ListenableFuture<List<WorkInfo>> statuses;
//                                statuses = workManager.getWorkInfosForUniqueWork(MainWorker.HANDLE_EVENTS_TWILIGHT_SCANNER_WORK_TAG);
//                                try {
//                                    List<WorkInfo> workInfoList = statuses.get();
//                                } catch (Exception ignored) {
//                                }
//                                //}

//                                PPApplication.logE("[WORKER_CALL] TwilightScanner.setTwilightState", "xxx");
                                //workManager.enqueue(worker);
                                workManager.enqueueUniqueWork(MainWorker.HANDLE_EVENTS_TWILIGHT_SCANNER_WORK_TAG, ExistingWorkPolicy.REPLACE, worker);
                            }
                        }
                    } catch (Exception e) {
                        PPApplication.recordException(e);
                    }
                    */

                    /*
                    PPApplication.startHandlerThread();//"TwilightScanner.setTwilightState"
                    final Handler handler = new Handler(PPApplication.handlerThread.getLooper());
                    handler.post(new Runnable() {
                        @Override
                        public void run() {
                            PowerManager powerManager = (PowerManager) appContext.getSystemService(Context.POWER_SERVICE);
                            PowerManager.WakeLock wakeLock = null;
                            try {
                                if (powerManager != null) {
                                    wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, PPApplication.PACKAGE_NAME + ":TwilightScanner_setTwilightState");
                                    wakeLock.acquire(10 * 60 * 1000);
                                }

                                EventsHandler eventsHandler = new EventsHandler(appContext);
                                eventsHandler.handleEvents(EventsHandler.SENSOR_TYPE_TIME);

                            } finally {
                                if ((wakeLock != null) && wakeLock.isHeld()) {
                                    try {
                                        wakeLock.release();
                                    } catch (Exception ignored) {
                                    }
                                }
                            }
                        }
                    });
                    */
                }
            }
        }
    }

    TwilightState getTwilightState(/*boolean log*/) {
        synchronized (mLock) {
            mLocationHandler.updateTwilightState(false/*, log*/);
            return mTwilightState;
        }
    }

    // The user has moved if the accuracy circles of the two locations don't overlap.
    private static boolean hasMoved(Location from, Location to) {
        if (to == null) {
            return false;
        }

        if (from == null) {
            return true;
        }

        // if new location is older than the current one, the device hasn't moved.
        if (to.getElapsedRealtimeNanos() < from.getElapsedRealtimeNanos()) {
            return false;
        }

        // Get the distance between the two points.
        float distance = from.distanceTo(to);

        // Get the total accuracy radius for both locations.
        float totalAccuracy = from.getAccuracy() + to.getAccuracy();

        // If the distance is greater than the combined accuracy of the two
        // points then they can't overlap and hence the user has moved.
        return distance >= totalAccuracy;
    }

    private final class LocationHandler extends Handler {
        private static final int MSG_ENABLE_LOCATION_UPDATES = 1;
        private static final int MSG_GET_NEW_LOCATION_UPDATE = 2;
        private static final int MSG_PROCESS_NEW_LOCATION = 3;
        private static final int MSG_DO_TWILIGHT_UPDATE = 4;

        private static final long LOCATION_UPDATE_MS = 24 * DateUtils.HOUR_IN_MILLIS;
        private static final long MIN_LOCATION_UPDATE_MS = 30 * DateUtils.MINUTE_IN_MILLIS;
        private static final float LOCATION_UPDATE_DISTANCE_METER = 1000 * 20;
        private static final long LOCATION_UPDATE_ENABLE_INTERVAL_MIN = 5000;
        private static final long LOCATION_UPDATE_ENABLE_INTERVAL_MAX =
                15 * DateUtils.MINUTE_IN_MILLIS;
        private static final double FACTOR_GMT_OFFSET_LONGITUDE =
                1000.0 * 360.0 / DateUtils.DAY_IN_MILLIS;

        private boolean mPassiveListenerEnabled;
        private boolean mNetworkListenerEnabled;
        private boolean mDidFirstInit;
        private long mLastNetworkRegisterTime = -MIN_LOCATION_UPDATE_MS;
        private long mLastUpdateInterval;
        private Location mLocation;

        @SuppressWarnings({"deprecation", "unused"})
        LocationHandler(Looper looper) {
        }

        void processNewLocation(Location location) {
            Message msg = obtainMessage(MSG_PROCESS_NEW_LOCATION, location);
            sendMessage(msg);
        }

        void enableLocationUpdates() {
            sendEmptyMessage(MSG_ENABLE_LOCATION_UPDATES);
        }

        void requestLocationUpdate() {
            sendEmptyMessage(MSG_GET_NEW_LOCATION_UPDATE);
        }

        void requestTwilightUpdate() {
            sendEmptyMessage(MSG_DO_TWILIGHT_UPDATE);
        }

        @SuppressLint("MissingPermission")
        @Override
        public void handleMessage(Message msg) {
//            PPApplication.logE("[IN_THREAD_HANDLER] TwilightScanner.LocationHandler", "xxx");

            switch (msg.what) {
                case MSG_PROCESS_NEW_LOCATION: {
                    final Location location = (Location) msg.obj;
                    final boolean hasMoved = hasMoved(mLocation, location);
                    final boolean hasBetterAccuracy = mLocation == null
                            || location.getAccuracy() < mLocation.getAccuracy();

                    if (hasMoved || hasBetterAccuracy) {
                        setLocation(location);
                    }
                    break;
                }

                case MSG_GET_NEW_LOCATION_UPDATE:
                    if (!mNetworkListenerEnabled) {
                        // Don't do anything -- we are still trying to get a
                        // location.
                        return;
                    }
                    if ((mLastNetworkRegisterTime + MIN_LOCATION_UPDATE_MS) >=
                            SystemClock.elapsedRealtime()) {
                        // Don't do anything -- it hasn't been long enough
                        // since we last requested an update.
                        return;
                    }

                    // Unregister the current location monitor, so we can
                    // register a new one for it to get an immediate update.
                    mNetworkListenerEnabled = false;
                    if (mLocationManager != null)
                        mLocationManager.removeUpdates(mEmptyLocationListener);

                    // Fall through to re-register listener.
                case MSG_ENABLE_LOCATION_UPDATES:
                    // enable network provider to receive at least location updates for a given
                    // distance.
                    boolean networkLocationEnabled;
                    try {
                        //noinspection ConstantConditions
                        networkLocationEnabled =
                                mLocationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER);
                    } catch (Exception e) {
                        // we may get IllegalArgumentException if network location provider
                        // does not exist or is not yet installed.
                        networkLocationEnabled = false;
                    }
                    if (!mNetworkListenerEnabled && networkLocationEnabled) {
                        if (Permissions.checkLocation(context)) {
                            mNetworkListenerEnabled = true;
                            mLastNetworkRegisterTime = SystemClock.elapsedRealtime();
                            mLocationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER,
                                    LOCATION_UPDATE_MS, 0, mEmptyLocationListener);

                            if (!mDidFirstInit) {
                                mDidFirstInit = true;
                                if (mLocation == null) {
                                    retrieveLocation();
                                }
                            }
                        }
                    }

                    // enable passive provider to receive updates from location fixes (gps
                    // and network).
                    boolean passiveLocationEnabled;
                    try {
                        passiveLocationEnabled =
                                mLocationManager.isProviderEnabled(LocationManager.PASSIVE_PROVIDER);
                    } catch (Exception e) {
                        // we may get IllegalArgumentException if passive location provider
                        // does not exist or is not yet installed.
                        passiveLocationEnabled = false;
                    }

                    if (!mPassiveListenerEnabled && passiveLocationEnabled) {
                        if (Permissions.checkLocation(context)) {
                            mPassiveListenerEnabled = true;
                            mLocationManager.requestLocationUpdates(LocationManager.PASSIVE_PROVIDER,
                                    0, LOCATION_UPDATE_DISTANCE_METER, mLocationListener);
                        }
                    }

                    if (!(mNetworkListenerEnabled && mPassiveListenerEnabled)) {
                        mLastUpdateInterval *= 1.5;
                        if (mLastUpdateInterval == 0) {
                            mLastUpdateInterval = LOCATION_UPDATE_ENABLE_INTERVAL_MIN;
                        } else if (mLastUpdateInterval > LOCATION_UPDATE_ENABLE_INTERVAL_MAX) {
                            mLastUpdateInterval = LOCATION_UPDATE_ENABLE_INTERVAL_MAX;
                        }
                        sendEmptyMessageDelayed(MSG_ENABLE_LOCATION_UPDATES, mLastUpdateInterval);
                    }
                    break;

                case MSG_DO_TWILIGHT_UPDATE:
                    updateTwilightState(true/*, true*/);
                    break;
            }
        }

        private void retrieveLocation() {
            Location location = null;
            if (Permissions.checkLocation(context)) {
                if (mLocationManager != null) {
                    final Iterator<String> providers =
                            mLocationManager.getProviders(new Criteria(), true).iterator();
                    //noinspection WhileLoopReplaceableByForEach
                    while (providers.hasNext()) {
                        @SuppressLint("MissingPermission")
                        final Location lastKnownLocation =
                                mLocationManager.getLastKnownLocation(providers.next());
                        // pick the most recent location
                        if (location == null || (lastKnownLocation != null &&
                                location.getElapsedRealtimeNanos() <
                                        lastKnownLocation.getElapsedRealtimeNanos())) {
                            location = lastKnownLocation;
                        }
                    }
                }
            }

            // In the case there is no location available (e.g. GPS fix or network location
            // is not available yet), the longitude of the location is estimated using the timezone,
            // latitude and accuracy are set to get a good average.
            if (location == null) {

                //noinspection deprecation
                Time currentTime = new Time();
                currentTime.set(System.currentTimeMillis());
                double lngOffset = FACTOR_GMT_OFFSET_LONGITUDE *
                        (currentTime.gmtoff - (currentTime.isDst > 0 ? 3600 : 0));

                location = new Location("fake");
                location.setLongitude(lngOffset);
                location.setLatitude(0);
                location.setAccuracy(417000.0f);
                location.setTime(System.currentTimeMillis());
                location.setElapsedRealtimeNanos(SystemClock.elapsedRealtimeNanos());

            }

            setLocation(location);
        }

        private void setLocation(Location location) {
            mLocation = location;
            updateTwilightState(true/*, true*/);
        }

        void updateTwilightState(boolean setAlarm/*, boolean log*/) {
            if (mLocation == null) {
                setTwilightState(null);
                return;
            }

            Calendar now = Calendar.getInstance();

            // calculate correction
            Calendar[] twilight = SunriseSunset.getSunriseSunset(now, mLocation.getLatitude(), mLocation.getLongitude());

            // check if must be applied correction
            Calendar _now = Calendar.getInstance();
            _now.set(Calendar.HOUR_OF_DAY, 0);
            _now.set(Calendar.MINUTE, 0);
            _now.set(Calendar.SECOND, 0);
            _now.set(Calendar.MILLISECOND, 0);
            Calendar _twilight = twilight[0];
            _twilight.set(Calendar.HOUR_OF_DAY, 0);
            _twilight.set(Calendar.MINUTE, 0);
            _twilight.set(Calendar.SECOND, 0);
            _twilight.set(Calendar.MILLISECOND, 0);

            int correction = -_twilight.compareTo(_now);

            // calculate today twilight
            _now = Calendar.getInstance();
            _now.add(Calendar.DAY_OF_YEAR, correction);
            twilight = SunriseSunset.getSunriseSunset(_now, mLocation.getLatitude(), mLocation.getLongitude());
            boolean isNight = SunriseSunset.isNight(_now, mLocation.getLatitude(), mLocation.getLongitude());
            long todaySunrise = twilight[0].getTimeInMillis();
            long todaySunset = twilight[1].getTimeInMillis();

            // calculate yesterday's twilight
            Calendar yesterday = Calendar.getInstance();
            yesterday.add(Calendar.DAY_OF_YEAR, -1 + correction);
            twilight = SunriseSunset.getSunriseSunset(yesterday, mLocation.getLatitude(), mLocation.getLongitude());
            final long yesterdaySunrise = twilight[0].getTimeInMillis();
            final long yesterdaySunset = twilight[1].getTimeInMillis();

            // calculate tomorrow's twilight
            Calendar tomorrow = Calendar.getInstance();
            tomorrow.add(Calendar.DAY_OF_YEAR, 1 + correction);
            twilight = SunriseSunset.getSunriseSunset(tomorrow, mLocation.getLatitude(), mLocation.getLongitude());
            final long tomorrowSunrise = twilight[0].getTimeInMillis();
            final long tomorrowSunset = twilight[1].getTimeInMillis();

            long[] daysSunrise = new long[9];
            long[] daysSunset = new long[9];
            Calendar day = Calendar.getInstance();

            day.add(Calendar.DAY_OF_YEAR, -1 + correction); // index = 0 -> yesterday,

            for (int i = 0; i < 9; i++) {
                twilight = SunriseSunset.getSunriseSunset(day, mLocation.getLatitude(), mLocation.getLongitude());
                daysSunrise[i] = twilight[0].getTimeInMillis();
                daysSunset[i] = twilight[1].getTimeInMillis();
                day.add(Calendar.DAY_OF_YEAR, 1);
            }

            // set twilight state
            TwilightState state = new TwilightState(isNight, yesterdaySunrise, yesterdaySunset,
                    todaySunrise, todaySunset, tomorrowSunrise, tomorrowSunset, daysSunrise, daysSunset);

            setTwilightState(state);

            if (setAlarm) {
                // schedule next update
                long nextUpdate = 0;
                if (todaySunrise == -1 || todaySunset == -1) {
                    // In the case the day or night never ends the update is scheduled 12 hours later.
                    nextUpdate = now.getTimeInMillis() + 12 * DateUtils.HOUR_IN_MILLIS;
                } else {
                    // add some extra time to be on the safe side.
                    nextUpdate += DateUtils.MINUTE_IN_MILLIS;

                    if (now.getTimeInMillis() > todaySunset) {
                        nextUpdate += tomorrowSunrise;
                    } else if (now.getTimeInMillis() > todaySunrise) {
                        nextUpdate += todaySunset;
                    } else {
                        nextUpdate += todaySunrise;
                    }
                }

                // remove alarm
                try {
                    Intent updateIntent = new Intent(ACTION_UPDATE_TWILIGHT_STATE);
                    PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 0, updateIntent, PendingIntent.FLAG_NO_CREATE);
                    if (pendingIntent != null) {
                        if (mAlarmManager != null)
                            mAlarmManager.cancel(pendingIntent);
                        pendingIntent.cancel();
                    }
                } catch (Exception e) {
                    PPApplication.recordException(e);
                }
                //PPApplication.cancelWork(WorkerWithoutData.ELAPSED_ALARMS_TWILIGHT_SCANNER_TAG_WORK);

                // set alarm
                Intent updateIntent = new Intent(ACTION_UPDATE_TWILIGHT_STATE);

                if (mAlarmManager != null) {
                    PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 0, updateIntent, PendingIntent.FLAG_NO_CREATE);
                    if (pendingIntent != null) {

                        mAlarmManager.cancel(pendingIntent);
                        pendingIntent.cancel();
                    }

                    pendingIntent = PendingIntent.getBroadcast(context, 0, updateIntent, PendingIntent.FLAG_UPDATE_CURRENT);
                    if (ApplicationPreferences.applicationUseAlarmClock) {
                        Intent editorIntent = new Intent(context, EditorActivity.class);
                        editorIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
                        PendingIntent infoPendingIntent = PendingIntent.getActivity(context, 1000, editorIntent, PendingIntent.FLAG_UPDATE_CURRENT);
                        AlarmManager.AlarmClockInfo clockInfo = new AlarmManager.AlarmClockInfo(nextUpdate, infoPendingIntent);
                        mAlarmManager.setAlarmClock(clockInfo, pendingIntent);
                    } else {
                        //if (android.os.Build.VERSION.SDK_INT >= 23)
                            mAlarmManager.setExactAndAllowWhileIdle(AlarmManager.RTC_WAKEUP, nextUpdate, pendingIntent);
                        //else
                        //    mAlarmManager.setExact(AlarmManager.RTC_WAKEUP, nextUpdate, pendingIntent);
                    }
                }
            }
        }
    }

    private final BroadcastReceiver mUpdateLocationReceiver = new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent) {
//            PPApplication.logE("[IN_BROADCAST] TwilightScanner.mUpdateLocationReceiver", "xxx");
//            PPApplication.logE("[IN_BROADCAST_ALARM] TwilightScanner.mUpdateLocationReceiver", "xxx");

            if (Intent.ACTION_AIRPLANE_MODE_CHANGED.equals(intent.getAction())
                    && !intent.getBooleanExtra("state", false)) {
                // Airplane mode is now off!
                mLocationHandler.requestLocationUpdate();
                return;
            }

            // Time zone has changed or alarm expired.
            mLocationHandler.requestTwilightUpdate();
        }
    };

    static void doWork() {
        if (PhoneProfilesService.getInstance() != null) {
            TwilightScanner twilightScanner = PhoneProfilesService.getInstance().getTwilightScanner();
            if (twilightScanner != null) {
                // Time zone has changed or alarm expired.
                twilightScanner.mLocationHandler.requestTwilightUpdate();
            }
        }
    }

    // A LocationListener to initialize the network location provider. The location updates
    // are handled through the passive location provider.
    private final LocationListener mEmptyLocationListener =  new LocationListener() {
        public void onLocationChanged(Location location) {
//            PPApplication.logE("[IN_LISTENER] TwilightScanner.mEmptyLocationListener.onLocationChanged", "xxx");
        }

        public void onProviderDisabled(String provider) {
//            PPApplication.logE("[IN_LISTENER] TwilightScanner.mEmptyLocationListener.onProviderDisabled", "xxx");
        }

        public void onProviderEnabled(String provider) {
//            PPApplication.logE("[IN_LISTENER] TwilightScanner.mEmptyLocationListener.onProviderEnabled", "xxx");
        }

        public void onStatusChanged(String provider, int status, Bundle extras) {
//            PPApplication.logE("[IN_LISTENER] TwilightScanner.mEmptyLocationListener.onStatusChanged", "xxx");
        }
    };

    private final LocationListener mLocationListener = new LocationListener() {
        public void onLocationChanged(Location location) {
//            PPApplication.logE("[IN_LISTENER] TwilightScanner.mLocationListener.onLocationChanged", "xxx");
            mLocationHandler.processNewLocation(location);
        }

        public void onProviderDisabled(String provider) {
//            PPApplication.logE("[IN_LISTENER] TwilightScanner.mLocationListener.onProviderDisabled", "xxx");
        }

        public void onProviderEnabled(String provider) {
//            PPApplication.logE("[IN_LISTENER] TwilightScanner.mLocationListener.onProviderEnabled", "xxx");
        }

        public void onStatusChanged(String provider, int status, Bundle extras) {
//            PPApplication.logE("[IN_LISTENER] TwilightScanner.mLocationListener.onStatusChanged", "xxx");
        }
    };

}

redpajama_set_name: RedPajamaGithub


text:
Home >Poets >Maura Dooley
Find poems & poets
Maura Dooley
Maura Dooley is a freelance writer and lectures at Goldsmiths College, University of London. She edited Making for Planet Alice: New Women Poets (1997) and The Honey Gatherers: A Book of Love Poems (2002) for Bloodaxe, and How Novelists Work (2000) for Seren. Her collections include Life Under Water (Bloodaxe, 2008) and Sound Barrier: Poems 1982-2002 (Bloodaxe, 2002), which drew on collections including Explaining Magnetism (1991) and Kissing a Bone (1996), both Poetry Book Society Recommendations. Kissing a Bone was shortlisted for the T.S. Eliot Prize and Life Under Water was shortlisted for the T.S. Eliot Prize 2008.