text:
%----------------------------------------------------------------------------------------
%	LAB BOOK CONTENTS
%----------------------------------------------------------------------------------------

\labday{Friday, 08 July, 2016}

%-----------------------------------------

I have been remiss in writing in the research journal.  Many things have happened.
I won't even bother trying to summarize.  Hopefully I can start to become regular
again.

\experiment{Nondiagonal Stabilization}
Digging up this old problem.  I never published it, but a good portion of the work is ready to go.
It seems that a nondiagonal stabilization parameter could be useful for MHD problems.  Assad and I
developed such a paramter for MHD and got some promising results.  I no longer have access to those
results, but I'd like to publish them.  I'm trying to use \fenics to generate the results.

At the moment, I have a Burger's implementation that solves the steady Burger's equation,
\begin{align}
 u\pdeone{u}{x} = \nu\pden{u}{x}{2}, \quad u\lr{x_{L}} = u_{L}, \ u\lr{x_{R}} = u_{R} \label{eq:burgers}
\end{align}
where the left ($u_{L}$) and right ($u_{R}$) boundary conditions are determined from
\begin{align}
  \frac{1}{2}\lr{x_{R}\lr{1-x_{*}} + x_{L}\lr{1+x_{*}}} = u_{*}
\end{align}
where $*$ can be either $L$ or $R$ indicating left or right.  Right now I am using
$x_{L} = -1$ and $x_{R} = 1$ which gives $u_{L} = -1$ and $u_{R} = 1$.  This gives
a ``shock'' at the center of the domain as shown in figure~\ref{fig:burgers_shock}.
\begin{figure}[h!]
  \centering
  \includegraphics[width=0.7\textwidth]{/h1/dsondak/Research-Notebook/figures/2016/July/burgers_shock.pdf}
  \caption{Illustration of \fenics solution to the steady Burger's equation~\eqref{eq:burgers} using $5000$ finite elements.}
  \label{fig:burgers_shock}
\end{figure}

Next, I need to figure out how to introduce the stabilization parameter into
\fenics.  I'll base this off of Umberto's \fenics implementation of the
stabilization parameter.  Once the stabilization parameter is working, I can
code up the magnetic field equation, followed by the nondiagonal stabilization
parameter.  Then I will introduce the nondiagonal stabilization parameter and
start compiling the results and the paper.  I will also probably need to
test everything on a two-dimensional problem.  We know that Hartmann flow
doesn't work great.  I'll have to think of another one.

\labday{Tuesday, 19 July, 2016}

\experiment{Combustion Model Inadequacy}
Nearing the end of the calibration of the reduced model.  The hold-up has been invalidating the
reduced model.  The latest results indicate that we may be able to call the calibrated
reduced model inadequate.

\subexperiment{Chemical Kinetics Inadequacy}
It would be nice to invalidate the calibrated reduced model based solely on the 0D reactor.  This has proven difficult
for the five reaction reduced model (see discussion below).  I have tried to invalidate the model with a four
reaction reduced model by removing the three-body reaction.  The algorithmic peformance is much improved (rejection
rates of around $79\%$) and chains that appear stationary.  Figures~\ref{fig:chain_1}-\ref{fig:chain_4} present
the chains from each of the four reactions.
\begin{figure}[h!]
  \centering
  \includegraphics[width=0.7\textwidth]{/h1/dsondak/Research-Notebook/figures/2016/July/reaction0_chain.pdf}
  \caption{Chains from the calibrated Arrhenius parameters for reaction 1.}
  \label{fig:chain_1}
\end{figure}
\begin{figure}[h!]
  \centering
  \includegraphics[width=0.7\textwidth]{/h1/dsondak/Research-Notebook/figures/2016/July/reaction1_chain.pdf}
  \caption{Chains from the calibrated Arrhenius parameters for reaction 2.  Note that the modified Arrhenius
           parameter, $b$, was frozen in the simulations even though we present a chain.}
  \label{fig:chain_2}
\end{figure}
\begin{figure}[h!]
  \centering
  \includegraphics[width=0.7\textwidth]{/h1/dsondak/Research-Notebook/figures/2016/July/reaction2_chain.pdf}
  \caption{Chains from the calibrated Arrhenius parameters for reaction 3.}
  \label{fig:chain_3}
\end{figure}
\begin{figure}[h!]
  \centering
  \includegraphics[width=0.7\textwidth]{/h1/dsondak/Research-Notebook/figures/2016/July/reaction3_chain.pdf}
  \caption{Chains from the calibrated Arrhenius parameters for reaction 4.}
  \label{fig:chain_4}
\end{figure}
We also provide the posterior and prior distributions for each parameter in Figures~\ref{fig:dist_1}-\ref{fig:dist_4}.
Note that the modified Arrhenius parameter, $b$, was not actually calibrated.  It was frozen during the simulation.
\begin{figure}[h!]
  \centering
  \includegraphics[width=0.7\textwidth]{/h1/dsondak/Research-Notebook/figures/2016/July/reaction0_dist.pdf}
  \caption{Posterior and prior distributions from the calibrated Arrhenius parameters for reaction 1.}
  \label{fig:dist_1}
\end{figure}
\begin{figure}[h!]
  \centering
  \includegraphics[width=0.7\textwidth]{/h1/dsondak/Research-Notebook/figures/2016/July/reaction1_dist.pdf}
  \caption{Posterior and prior distributions from the calibrated Arrhenius parameters for reaction 2.  Note that the modified Arrhenius
           parameter, $b$, was frozen in the simulations even though we present a chain.}
  \label{fig:dist_2}
\end{figure}
\begin{figure}[h!]
  \centering
  \includegraphics[width=0.7\textwidth]{/h1/dsondak/Research-Notebook/figures/2016/July/reaction2_dist.pdf}
  \caption{Posterior and prior distributions from the calibrated Arrhenius parameters for reaction 3.}
  \label{fig:dist_3}
\end{figure}
\begin{figure}[h!]
  \centering
  \includegraphics[width=0.7\textwidth]{/h1/dsondak/Research-Notebook/figures/2016/July/reaction3_dist.pdf}
  \caption{Posterior and prior distributions from the calibrated Arrhenius parameters for reaction 4.}
  \label{fig:dist_4}
\end{figure}
It appears that we are learning quite a bit about a few parameters.  The maximum likelihood and MAP point
were obtained from the chains and the forward problem was run at each of these parameter sets.  The
problem was also run at the nominal parameter set.  Results were compared with the detailed model and are
shown in Figure~\ref{fig:four_rxn_inad}.
\begin{figure}[h!]
  \centering
  \includegraphics[width=0.7\textwidth]{/h1/dsondak/Research-Notebook/figures/2016/July/Toft_four_rxn_inad.pdf}
  \caption{Time evolution of the temperature.  Comparisons are made between the four reaction reduced model
           for three different parameter sets and the detailed model.  Results are shown at $\phi=1$ which
           is the equivalence ratio at which the data was calibrated.}
  \label{fig:four_rxn_inad}
\end{figure}
Even after calibration, the four reaction model is inadequate.  This may provide a simple route to helping
Rebecca get her stuff going again.  I'll need to calibrate the stochastic operator on this problem and then
see how things look.  For now, I need to get the stochastic operator up and running.

\subexperiment{Diffusion Flame}
The diffusion flame will eventually be used to build up a flamelet library.  For now, I'm just using it to
see if it helps us invalidate the five reaction reduced mechanism.  Figures~\ref{fig:T_Z}-\ref{fig:H2_x} were generated
from samples of the five reaction reduced mechanism.
\begin{figure}[h!]
  \centering
  \includegraphics[width=0.7\textwidth]{/h1/dsondak/Research-Notebook/figures/2016/July/T_Z.pdf}
  \caption{Temperature as a function of mixture fraction.}
  \label{fig:T_Z}
\end{figure}
\begin{figure}[h!]
  \centering
  \includegraphics[width=0.7\textwidth]{/h1/dsondak/Research-Notebook/figures/2016/July/T_x.pdf}
  \caption{Temperature as a function of space.}
  \label{fig:T_x}
\end{figure}
\begin{figure}[h!]
  \centering
  \includegraphics[width=0.7\textwidth]{/h1/dsondak/Research-Notebook/figures/2016/July/H_Z.pdf}
  \caption{Hydrogen as a function of mixture fraction.}
  \label{fig:H2_Z}
\end{figure}
\begin{figure}[h!]
  \centering
  \includegraphics[width=0.7\textwidth]{/h1/dsondak/Research-Notebook/figures/2016/July/H_x.pdf}
  \caption{Hydrogen as a function of space.}
  \label{fig:H2_x}
\end{figure}
The plots of \ce{H} are clearly inadequate by almost any measure.  The plot of temperature with
mixture fraction also appears inadequate.  However, when plotting temperature with space, the results
look pretty good.  Other results indicate that some species are shifted in the domain.  That is,
the flame location is not correct.  The concentration of \ce{HO2} is horrendously off to the point
where the reduced model predicts non-negligible concentrations while the detailed model predicts
that \ce{HO2} is a trace species.  A few species, such as \ce{H2O}, \ce{H2} and \ce{O2} are more
or less correct as expected.  To quantify this a bit more, I will run a few samples from the chain
through the diffusion flame to see if I can put some error bars on the plots.  It will be difficult
to do this for the plots with mixture fraction since the mixture fraction will also have error bars.
However, maybe the spatial plots will show some inadequacy.

I propagated $1000$ samples through the diffusion flame and computed the mean and standard deviation
of the temperature at each grid point.  The results are plotted in Figure~\ref{fig:inad_T_x}.
\begin{figure}[h!]
  \centering
  \includegraphics[width=0.7\textwidth]{/h1/dsondak/Research-Notebook/figures/2016/July/inad_T_x.pdf}
  \caption{Inadequacy in temperature profile across the diffusion flame.  Dark shading represents two
           standard deviations while light shading represents one standard deviation.  Most of the
           inadequacy occurs near the boundary of the flame.}
  \label{fig:inad_T_x}
\end{figure}
The calibrated reduced model does quite well at predicting the diffusion flame.  The main inadequacies
are found near the boundaries of the flame.  Otherwise, the detailed model falls easily within one
standard deviation of the mean.

%----------------------------------------------------------------------------------------

\labday{Friday, 29 July, 2016}

%-----------------------------------------
\experiment{Combustion Model Inadequacy}
\begin{itemize}
  \item Working on APS abtract for Turbulent Combustion session
  \item Found a mistake in Rebecca's formulation.
\end{itemize}

\subexperiment{Chemical Kinetics Inadequacy}
Theorem 3.2 in ~\cite{morrison2016representing} describes how to form a reaction based upon the stochastic operator.  The problem is that the stoichiometric coefficients are not treated correctly in the theorem.  They should enter as exponents, not as prefactors.  I present a description here of a system of reactions induced by the linear part of the stochastic operator.  Recall that the system of equations governing concentrations of species in the zero-D rector is
\begin{align}
  \odeone{\mathbf{x}}{t} = \mathbf{f}\lr{\mathbf{x}} + \mathcal{S}\mathbf{x} + \mathbf{g}\lr{\mathbf{x}} \label{eq:OD-system}
\end{align}
where $\mathbf{x} = \left[x_{1}, \ldots, x_{2}\right]^{T}$ is a vector containing species concentrations.  The $i^{\text{th}}$ component represents species $i$.  The right hand side consists of the chemical mechanism, $f\lr{\mathbf{x}}$, the linear part of the stochastic operator $\mathcal{S}\mathbf{x}$ and the so-called catchall reactions $g\lr{\mathbf{x}}$.  We will not consider the catchall reactions here because their form is not in question at the moment.  In chemical kinetics, the reaction rate for species $k$ given by
\begin{align}
  \dot{\omega}_{k} = \sum_{j=1}^{M}\lr{\nup{kj} - \nur{kj}}r_{j} \label{eq:react_rate}
\end{align}
where the progress rate of reaction $j$ is
\begin{align}
  r_{j} = \frate{j}\prod_{k=1}^{N}{x_{k}^{\nur{kj}}} - \rrate{j}\prod_{k=1}^{N}{x_{k}^{\nup{kj}}}.
\end{align}
Note that we are working with molar concentrations here.  To convert to mass fraction, we would multiply~\eqref{eq:react_rate} by the molecular weight of species $k$.  The classical expression for the forward reaction rate coefficient is the Arrhenius reaction rate
\begin{align}
  \frate{j} = A_{j}T^{b_{j}}\exp\lr{-\frac{E_{j}}{RT}} \label{eq:arrhenius}.
\end{align}
The goal is now to interpret $\mathcal{S}\mathbf{x}$ in terms of the previously described reaction rates.

Note that the contribution to species $k$ from the linear part of the stochastic operator is
\begin{align}
  \lr{\mathcal{S}\mathbf{x}}_{k} = \sum_{j=1}^{N}{s_{kj}x_{j}}. \label{eq:Sx}
\end{align}
Equation~\eqref{eq:Sx} can be interpreted as a reaction rate induced by $N$ reactions of the form
\begin{align}
  \ce{x_{p} ->[$s_{kp}$] x_{k}}, \quad p \neq k
\end{align}
where the reaction rate parameter $\frate{j}$ is just a constant $s_{kj}$.  When $p = k$ a modification must be introduced,
\begin{align}
  \ce{x_{k} ->[$s_{kk}$] 2 x_{k}}.
\end{align}

To clarify this formulation, we do a couple of examples.  In the \ce{H2}-\ce{O2} example, the linear part of the stochastic operator contributes to atomic hydrogen via
\begin{align}
  \odeone{\left[\ce{H}\right]}{t} = f_{\ce{H}}\lr{\mathbf{x}} + s_{57}\left[\ce{OH}\right] + s_{58}\left[\ce{HO2}\right] + s_{59}\left[\ce{H2O}\right].
\end{align}
The set of reactions is therefore
\begin{align}
  \ce{OH ->[s_{57}] H} \\
  \ce{HO2 ->[s_{58}] H} \\
  \ce{H2O ->[s_{59}] H}.
\end{align}
The progress rates become
\begin{align}
  r_{1} = s_{57}\left[\ce{OH}\right] \\
  r_{2} = s_{58}\left[\ce{HO2}\right] \\
  r_{3} = s_{59}\left[\ce{H2O}\right].
\end{align}
Therefore, the reaction rate for the linear part of the operator is
\begin{align}
  \dot{\omega}_{\ce{H}} = s_{57}\left[\ce{OH}\right] + s_{58}\left[\ce{HO2}\right] + s_{59}\left[\ce{H2O}\right].
\end{align}

The contribution to hydrogen is more involved.  It is
\begin{align}
  \odeone{\left[\ce{H2}\right]}{t} = f_{\ce{H2}}\lr{\mathbf{x}} + s_{31}\left[\ce{H^{\prime}}\right] + s_{33}\left[\ce{H2}\right] + s_{35}\left[\ce{H}\right] + s_{37}\left[\ce{OH}\right] + s_{38}\left[\ce{HO2}\right] + s_{39}\left[\ce{H2O}\right].
\end{align}
The corresponding reaction set is
\begin{align}
  \ce{H^{\prime} ->[s_{31}] \ce{H2}} \\
  \ce{H          ->[s_{35}] \ce{H2}} \\
  \ce{OH         ->[s_{37}] \ce{H2}} \\
  \ce{HO2        ->[s_{38}] \ce{H2}} \\
  \ce{H2O        ->[s_{39}] \ce{H2}}
\end{align}
and
\begin{align}
  \ce{H2 ->[s_{33}] \ce{2H2}}
\end{align}
with reaction progress rates
\begin{align}
  r_{1} = s_{31}\left[\ce{H^{\prime}}\right] \\
  r_{2} = s_{33}\left[\ce{H2}\right] \\
  r_{3} = s_{35}\left[\ce{H}\right] \\
  r_{4} = s_{37}\left[\ce{OH}\right] \\
  r_{5} = s_{38}\left[\ce{HO2}\right] \\
  r_{6} = s_{39}\left[\ce{H2O}\right].
\end{align}
We are then able to recover the reaction rate induced for \ce{H2} by the linear part of the stochastic operator.  Implementation of this formulation in the \textt{XML} input format will be a challenge.


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<title>Free Porn Videos - Nonk Porn.com</title>
	<meta name="description" content="Watch Free Porn Videos at Nonk Porn.com! Nonk Porn.com is best choice to get you Free Porn!" />
	<meta name="keywords" content="porn, porn com, free porn, nonk, porn videos, free porn videos" />
	<meta name="robots" content="index,follow" />
	<meta name="revisit-after" content="1 days" />
	<meta name="verify-v1" content="qUaPSNYbKwX94kg0NW1qJKC0y5qf1sDeCAmBUYcsnKA=" />
	<meta name="google-site-verification" content="tkwK9SujTMrWYJLl5KeQjQXf595EsmSqWWgIaebgZLE" />
	<meta name="juicyads-site-verification" content="09faf3755cc5d4676d5c930ab8e50762" />

	<base href="http://www.nonkporn.com/" />
	<link rel="canonical" href="http://www.nonkporn.com/" />
	<link rel="dns-prefetch" href="http://www.xclickers.com" />
	<link rel="dns-prefetch" href="http://www.fpcpopunder.com" />

Home

Hosted

Japanese

Painful Anal

Ebony

Mature

Anal Porn

MILF Porn

Homemade

Amateur

Dad Teen

		<form action="http://www.nonkporn.com/?ctr=search" id="search" accept-charset="utf-8" id="contentsearch" name="contentsearch" method="post">
			<input type="text" name="search_phrase" value="" type="text" class="form-control" id="text-field" size="100" maxlength="50" placeholder="Search...">
		</form>

Nonk Porn.com is best choice for free porn. Welcome!

Free Porn Videos

Shocked Daughter Bust Her Young Husband Fucking Her Lustful Mother

1390 views

Amateur Tranny Hooker Fucked In Cheep Hotel

944 views

Wasted Japanese Sisters Fucking Their Older Cousin In A HomemadeThreesome

1315 views

Extreme Face Fucking

1263 views

His Erected Cock Could Not Give Him A Peace

800 views

Arab Girl Fucked In Ass For The First Time In the Stable

1248 views

Blackmailed Busty Milf Stepmother Gets Her Dress Ripped Off and Roughly Fucked

4136 views

Young Japanese Housewife Has an Awful Father In Law

2306 views

Kidnapped Teen Gets Brutally Raped By Her Kidnappers

1978 views

Blackmailed Busty Milf Teacher Violated By Her Students In the Locker Room

1053 views

School Tutor Gets Secretly Fucked By One Of Her Students

1507 views

Saying Goodbye To Hubby and Staying Home Alone With Brother In Law

1433 views

ing" src="images/5star.png" />

1848 views

Just Published Porn Videos

Latina Girls Got Fucked Anal By Judge Before Miss Election Stolen Tape

1 views

Brunette Slut Gets Molested And Force Fucked By Customer In Stripper Bar

1 views

Amateur Teen Rides Dildo While Being Fucked Anal

3 views

Hot Teen Could Not Hold On Her Moan While Getting Fucked By Big Dick

3 views

Son Saw The Opportunity When His Dad Went To Work And Fucked His Confused Future Stepmom

13 views

Evil Son Finds Out That His Stepmom Is Fucking With His Classmate And Blackmail Her To Fuck Him Too

6 views

While Rest Of The House Were Sleeping Boy Sneak In Stepsisters Bedroom And Forced Her To Suck Him Off

13 views

Girl Attracts Attention Of A Horny Cousin While Sleeping

7 views

Stepmother Hisae Yabe Home Alone With Her Stepson

13 views

Bunch Of Guys Had No Mercy For Poor Girl

20 views

2 Blackmailed Busty Milfs Got Mercilessly Fucked By 2 Evil Teenage Boys

31 views

Wife Lock Husband Dick When She Go Out To Protect Her Sister Being Fucked But It Didnt Help

18 views

Boss Couldnt Resist Not To Grab Busty Secretary For Big Ass

18 views

Mouthwatering Step Father is Crazy About Daughters Sexy Ass Porn Fantasy

13 views

Busty Mexican Slut Will Pay Carpenter Services With Pussy

9 views

Quickie Amateur Sex In Shopping Mall Toilet

12 views

Guy Drinking Beer While His Gf Sucking Him Off

10 views

Insane Guy Almost Drown His Sister In Law Cause She Refuse To Have Sex With Him

11 views

Dirty Boy Wants Much More Than Milk From Stepmoms Boobs

30 views

Devoted To Work Secretary Takes Serious Task Of Taking Good Care Of Black Boss

18 views

Boy Has Strange Relationship With Girlfriends Stepmom

21 views

A Sultry Day Makes Two Strangers Horny

36 views

Not Every Dad Is Father Figure To His Daughters Girlfriends

12 views

Asian Girl And Her Boyfriend Are Having Wild Sex On Live Chat

12 views

Hot Amateur Busty MILF Talking On The Phone While Cheating On Her Hubby

19 views

Sleeping Alone In The Woods Attract Attention Of Old Maniac

23 views

Drugged Sleeping Teen Abused and Fucked While Passed Out Japanese Uncensored

20 views

Teen Kidnapped and Brutally Anal Fucked Under Gun Threat

14 views

Teen Girl Show Daddy What She Learned Today On Massage Class

12 views

Adorable Tempting Big Ass Step Mother Yumi Kazama

39 views

Horny Guy Fucks His Fat Girlfriend In The Ass

27 views

Bored Stepsister Decided To Deal With Her Stepbrothers Dick While He Was Sleeping

16 views

Humiliated Boy Could Only Watch How 2 Bums Brutally Fuck Love Of His Life While She Screaming In Agony

29 views

Indonesian Teen Girl Called Maya Caught On Hidden Cam While Having Sex

23 views

Boozed Chick Was Too Wasted To Defend Pussy Of Getting Fucked

13 views

Busty Asian Teen With Very Tight Pussy Enjoys Good Fuck With Cum On Her Face

37 views

Big Tits Milf Claudia Marie Fucks Young Guy

21 views

Masked Intruder Brutally Attack And Fuck Home Alone Girl

12 views

Wasted Teen Melissa Matthews Forced Fuck In the Closet

15 views

Teen Anal

21 views

Busty Stepmom Knows How To Wake Up Her Sleeping Stepson

53 views

Helping Friends Mature Mom In The Bathroom Results With A Blowjob

19 views

Nerd Boy Open His Soul To Milf Stepmommy And Begs Her To Help Him Not To Be Virgin Anymore

34 views

Boy Gets Interrupted While Playing Games By His Sisters Punk Friend

24 views

Asian Teen Hottie Mona Kasuga Gets Creampied Uncensored at Bathroom

35 views

Stepdad Was Not Happy With His Daughter Dressing Up For School

29 views

Awful Step Father Makes His Poor Teen Step Daughter Cry Again

51 views

Son Drugged His Dad So He Could Fuck His Busty Stepmom In Front Of Him

67 views

Spying On Stepsister While She Was Masturbating Totaly Pays Off

22 views

Old Pervert Daddy Went Too Far With New Step Daughter

20 views

Latino College Teens Makes Awesome Sex Tape At Dorm Room

43 views

Sinful Stepmom Gave Stepson Something To Talk About For The Rest Of His Life

22 views

Hot Housewife Didnt Have Something Like This In Her Mind When She Called Masseur To Give Her Home Massage

35 views

Submissive Wify Bent Over To Get Nice Ass Fuck

34 views

Sleeping Sister In Law Gets Fucked

44 views

This is How they do it in Rio

20 views

Milf Gets Roughly Raped By Stranger After Being Caught Masturbating In Car

36 views

Not Real Daughter And Father Raze All The Boundaries Of Ideal Family Uncensored

39 views

Bondage Secretary Suffers Rough Harassment At Work

16 views

Cheating Wife Almost Got Caught While Fucking With Stranger At Spa

55 views

More Random Videos

Handyman Attacked And Raped Home Alone Teen

1400 views

Hot Brunette Gets Brutally Raped By Pissed Off Guy

3197 views

License To Sex - Daughter Gets Fucked Infront Of Her Parents

1687 views

Japanese Maid Sakurai Ayu Gets Abused By Her Employer And Fucked Against Her Will

478 views

Father Catches Step Daughter Being Fucked By Old Neighbor

998 views

Sleeping Milf Abused and Fucked By Mail Delivery Boy

6434 views

Train Conductor Woman Brutally Raped By 2 Armed Hooligans

2335 views

Two Sisters Came To Defend Third One From Awful Step Daddy

6456 views

Japanese Boy Caught Mother Doing Blowjob To Fathers Friend

8780 views

Unconscious Village Woman Gets Brutally Fucked In The Field

2393 views

Wasted Drunk Japanese Girl Found On The Street Abused and Fucked By Stranger

1281 views

Teen Fucks A Fat Guy Due To A Lost Bet

999 views

Nagase Ryoko Never Expected Late Night Visit From Her Stepson

222 views

Hot Blonde Playing With A Dildo Before Her Boyfriend Nailed Her Pussy And Ass With A Big Fat Dick

353 views

The Sweetest Homemade Anal Fuck

1188 views

Teenager Patient Groped Busty Milf Doctor In Hospital

11061 views

Real Korean Drunk Girl Fucked By Unknown Guy And Taped By His Friend

1664 views

Two Robbers Brutally Rape Cashier Woman Rape Fantasy

1662 views

Busty Shaved Pussy Amateur Teen Fucking Hard In A Kitchen

986 views

Arab Teenagers Having Their First Time Fuck Struggle In The Ruins

2123 views

French Wife Anal Fucked In Her Home By Intruder

3144 views

Passed Out Drunk Sleeping Wife Gets Fucked

3311 views

Shhhh Mommy We Dont Want To Dad To Hear Us

127 views

Stunning Hot Blonde Mom Begged Me To Fuck Her Hard

2930 views

Horny Stepsister Did Not Notice That Her Stepbrother Recording Her All Time Masturbating

388 views

Nazi Soldiers Anal Rapes Village Woman During WW2

4982 views

Teen Girl Groped and Gangraped By Bunch Of Strangers In Bus

2747 views

Village Teen Gets Roughly Fucked By Two Young Guys

68079 views

Brutal Anal Fucking And Vacuum Tits Humiliated This Girl

2439 views

Aikido Girl Gets Assaulted By Companions During Training Uncensored

533 views

Teen Sells Her Asshole For Money

847 views

Knocked Down Tied and Fucked

3205 views

Busty Milf Boss Hitomi Tanaka Gets Punished By Angry Employees

1534 views

Japanese MILF Sneaks Husbands Brother Bed Late at Night

5608 views

Young japanese Housewife Violated In Kitchen By Three Guys

1402 views

Daughter In Law Didnt Expected Sucha Bawdiness From Her Old Father in Law

1556 views

Drugged Sleeping Blonde Teen Gets Raped While Passed Out

1462 views

Hot MILF Lawyer Molested And Anal Raped By Imprisoned Client

4780 views

Villagers Forced To Brutally Rape Their Own Woman By Enemy Soldiers

2483 views

Japanese Boy Attack and Fuck Resisting Girlfriends Mother In Kitchen

1275 views

Black Slut Gives All The Guys A Go

1342 views

Mature Blonde Stepmother Knows How Her Baby Boy Loves To Be Awake

543 views

fantasy hard anal

1456 views

After He Sent Off His Pregnant Wife To A Doctor Guy Jumps On His Hot Mother In Law In A Kitchen

1617 views

Vintage Nerd Milf Gets Anal Fucked With Black Monster Cock

1848 views

Time Stop Group Fuck

3006 views

Blond Milf Gets Fucked By Chef Cook

1202 views

Amateur Interracial Fuck at Work In Bushes

1919 views

Crying Teen Endures Quick Doggystyle Pounding by Her Dads Fat Friend

2229 views

Wife Fucks Husband With Huge Strap On

775 views

Horrified Crying German Housewife Gets Brutally Raped By Masked Intruder Under a Gun Threat

1369 views

Daddy Brutally Fucks Two Teens Anal

2534 views

Captured Terrorist Gets Brutally Punished By Cruel SWAT Team

888 views

Teen In Wheel Chair Gets Sleeping Pills Then Gets Raped Along With Her Mother

2348 views

Schoolgilrl Gets Kidnapped And Violated In Some Dark Scary Place

3132 views

Mad About Big Breasted Friends Stepmom

1096 views

Brave Guy Sexually Attacked Chubby Mother In Law In The Kitchen While Wife Was In Next Room

484 views

Mom Left Teen Daughter Home Alone With An Old Pervert

1689 views

The Reason Why the BrotherInLaw Arrived Early for Dinner

3744 views

Japanese Schoolgirl Gets Molested And Brutally Fucked In The Public Park

2402 views

ts Brutally Fucked By Two Masked Robbers" target="_blank">

Sales Girl Gets Brutally Fucked By Two Masked Robbers

1453 views

Fucking My Long Legged GF Doggystyle On The Sofa

753 views

next »

Disclaimer

2257

Terms

Privacy

Sitemap

RSS Hosted

RSS Plugs

Contact

Copyright © 2008-2017 www.nonkporn.com All rights reserved.

redpajama_set_name: RedPajamaGithub


text:
<?php

/***************************************************************************
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version. Although none of the code may be
 *   sold. If you have been sold this script, get a refund.
 ***************************************************************************/

include 'common.php';

// If user is not logged in redirect to login page
if (!$user->checkAuth())
{
	$_SESSION['LOGIN_MESSAGE'] = $MSG['5000'];
	$_SESSION['REDIRECT_AFTER_LOGIN'] = 'auction_watch.php';
	header('location: user_login.php');
	exit;
}

// insert a new watch item
if (isset($_GET['insert']) && $_GET['insert'] == 'true' && !empty($_REQUEST['add']))
{
	$requestadd = $_REQUEST['add'];
	// Check if this keyword is not already added
	$auctions = trim($user->user_data['auc_watch']);
	unset($match); // just incase
	if (!empty($auctions))
	{
		$checkarray = explode(' ', $requestadd);
		$requestadd = '';
		foreach ($checkarray as $check)
		{
			if (strpos($auctions, $check) === false)
			{
				$requestadd .= $check . ' ';
			}
		}
	}

	if (!isset($match) || empty($match))
	{
		$auction_watch = trim($auctions . ' ' . $requestadd);
		$query = "UPDATE " . $DBPrefix . "users SET auc_watch = :auc_watch WHERE id = :id";
		$params = array(
			array(':auc_watch', $system->cleanvars($auction_watch), 'str'),
			array(':id', $user->user_data['id'], 'int'),
		);
		$db->query($query, $params);
		$user->user_data['auc_watch'] = $auction_watch;
	}
}

// Delete auction from auction watch
if (isset($_GET['delete']))
{
	$item_to_delete = $_GET['delete'];
	$currently_watched_auctions = explode(' ', trim($user->user_data['auc_watch']));

	$auctions_to_watch = array();

	for ($j = 0; $j < count($currently_watched_auctions); $j++)
	{
		if ($currently_watched_auctions[$j] != $item_to_delete)
		{
			array_push($auctions_to_watch, $currently_watched_auctions[$j]);
		}
	}

	$query = "UPDATE " . $DBPrefix . "users SET auc_watch = :auc_watch WHERE id = :id";
	$params = array(
		array(':auc_watch', implode(' ', $auctions_to_watch), 'str'),
		array(':id', $user->user_data['id'], 'int'),
	);
	$db->query($query, $params);
	$user->user_data['auc_watch'] = implode(' ', $auctions_to_watch);
}

$auctions = trim($user->user_data['auc_watch']);

if ($auctions != '')
{
	$auction = explode(' ', $auctions);
	for ($j = 0; $j < count($auction); $j++)
	{
		$template->assign_block_vars('items', array(
				'ITEM' => $auction[$j],
				'ITEMENCODE' => urlencode($auction[$j])
				));
	}
}

include 'header.php';
$TMP_usmenutitle = $MSG['471'];
include INCLUDE_PATH . 'user_cp.php';
$template->set_filenames(array(
		'body' => 'auction_watch.tpl'
		));
$template->display('body');
include 'footer.php';


text:
"use strict";

var _ = require('../');
var root = _.path.fun(__dirname);

var test_server = require('../test_server/server.tjs');

function main(){

    _.shell(root("..", "build"), function(code){
        if(code){ throw(_.error("build_error", "Build error code: " + code)); }
        test_server.start_server(function(){
            _.shell("./bin/resolve_run phantomjs-prebuilt/bin/phantomjs `bin/resolve mocha-phantomjs-core/mocha-phantomjs-core.js` http://localhost:9999/index.html dot", function(code){
                test_server.stop_server(function(){
                    if(code){ process.exit(code); }
                });
            });
        });
    });
}

main();


text:
/**
 * @file fw_pos_control_l1_params.c
 *
 * Parameters defined by the L1 position control task
 *
 * @author Lorenz Meier <lm@inf.ethz.ch>
 */

#include <nuttx/config.h>
#include <systemlib/param/param.h>

/*
 * Controller parameters, accessible via MAVLink
 */

/**
 * L1 period
 *
 * This is the L1 distance and defines the tracking
 * point ahead of the aircraft its following.
 * A value of 25 meters works for most aircraft. Shorten
 * slowly during tuning until response is sharp without oscillation.
 *
 * @min 1.0
 * @max 100.0
 * @group L1 Control
 */
PARAM_DEFINE_FLOAT(FW_L1_PERIOD, 25.0f);

/**
 * L1 damping
 *
 * Damping factor for L1 control.
 *
 * @min 0.6
 * @max 0.9
 * @group L1 Control
 */
PARAM_DEFINE_FLOAT(FW_L1_DAMPING, 0.75f);

/**
 * Cruise throttle
 *
 * This is the throttle setting required to achieve the desired cruise speed. Most airframes have a value of 0.5-0.7.
 *
 * @min 0.0
 * @max 1.0
 * @group L1 Control
 */
PARAM_DEFINE_FLOAT(FW_THR_CRUISE, 0.7f);

/**
 * Throttle max slew rate
 *
 * Maximum slew rate for the commanded throttle
 *
 * @min 0.0
 * @max 1.0
 * @group L1 Control
 */
PARAM_DEFINE_FLOAT(FW_THR_SLEW_MAX, 0.0f);

/**
 * Negative pitch limit
 *
 * The minimum negative pitch the controller will output.
 *
 * @unit degrees
 * @min -60.0
 * @max 0.0
 * @group L1 Control
 */
PARAM_DEFINE_FLOAT(FW_P_LIM_MIN, -45.0f);

/**
 * Positive pitch limit
 *
 * The maximum positive pitch the controller will output.
 *
 * @unit degrees
 * @min 0.0
 * @max 60.0
 * @group L1 Control
 */
PARAM_DEFINE_FLOAT(FW_P_LIM_MAX, 45.0f);

/**
 * Controller roll limit
 *
 * The maximum roll the controller will output.
 *
 * @unit degrees
 * @min 0.0
 * @group L1 Control
 */
PARAM_DEFINE_FLOAT(FW_R_LIM, 45.0f);

/**
 * Throttle limit max
 *
 * This is the maximum throttle % that can be used by the controller.
 * For overpowered aircraft, this should be reduced to a value that
 * provides sufficient thrust to climb at the maximum pitch angle PTCH_MAX.
 *
 * @group L1 Control
 */
PARAM_DEFINE_FLOAT(FW_THR_MAX, 1.0f);

/**
 * Throttle limit min
 *
 * This is the minimum throttle % that can be used by the controller.
 * For electric aircraft this will normally be set to zero, but can be set
 * to a small non-zero value if a folding prop is fitted to prevent the
 * prop from folding and unfolding repeatedly in-flight or to provide
 * some aerodynamic drag from a turning prop to improve the descent rate.
 *
 * For aircraft with internal combustion engine this parameter should be set
 * for desired idle rpm.
 *
 * @group L1 Control
 */
PARAM_DEFINE_FLOAT(FW_THR_MIN, 0.0f);

/**
 * Throttle limit value before flare
 *
 * This throttle value will be set as throttle limit at FW_LND_TLALT,
 * before arcraft will flare.
 *
 * @group L1 Control
 */
PARAM_DEFINE_FLOAT(FW_THR_LND_MAX, 1.0f);

/**
 * Climbout Altitude difference
 *
 * If the altitude error exceeds this parameter, the system will climb out
 * with maximum throttle and minimum airspeed until it is closer than this
 * distance to the desired altitude. Mostly used for takeoff waypoints / modes.
 * Set to zero to disable climbout mode (not recommended).
 *
 * @group L1 Control
 */
PARAM_DEFINE_FLOAT(FW_CLMBOUT_DIFF, 25.0f);

/**
 * Maximum climb rate
 *
 * This is the best climb rate that the aircraft can achieve with
 * the throttle set to THR_MAX and the airspeed set to the
 * default value. For electric aircraft make sure this number can be
 * achieved towards the end of flight when the battery voltage has reduced.
 * The setting of this parameter can be checked by commanding a positive
 * altitude change of 100m in loiter, RTL or guided mode. If the throttle
 * required to climb is close to THR_MAX and the aircraft is maintaining
 * airspeed, then this parameter is set correctly. If the airspeed starts
 * to reduce, then the parameter is set to high, and if the throttle
 * demand required to climb and maintain speed is noticeably less than
 * FW_THR_MAX, then either FW_T_CLMB_MAX should be increased or
 * FW_THR_MAX reduced.
 *
 * @group L1 Control
 */
PARAM_DEFINE_FLOAT(FW_T_CLMB_MAX, 5.0f);

/**
 * Minimum descent rate
 *
 * This is the sink rate of the aircraft with the throttle
 * set to THR_MIN and flown at the same airspeed as used
 * to measure FW_T_CLMB_MAX.
 *
 * @group Fixed Wing TECS
 */
PARAM_DEFINE_FLOAT(FW_T_SINK_MIN, 2.0f);

/**
 * Maximum descent rate
 *
 * This sets the maximum descent rate that the controller will use.
 * If this value is too large, the aircraft can over-speed on descent.
 * This should be set to a value that can be achieved without
 * exceeding the lower pitch angle limit and without over-speeding
 * the aircraft.
 *
 * @group Fixed Wing TECS
 */
PARAM_DEFINE_FLOAT(FW_T_SINK_MAX, 5.0f);

/**
 * TECS time constant
 *
 * This is the time constant of the TECS control algorithm (in seconds).
 * Smaller values make it faster to respond, larger values make it slower
 * to respond.
 *
 * @group Fixed Wing TECS
 */
PARAM_DEFINE_FLOAT(FW_T_TIME_CONST, 5.0f);

/**
 * TECS Throttle time constant
 *
 * This is the time constant of the TECS throttle control algorithm (in seconds).
 * Smaller values make it faster to respond, larger values make it slower
 * to respond.
 *
 * @group Fixed Wing TECS
 */
PARAM_DEFINE_FLOAT(FW_T_THRO_CONST, 8.0f);

/**
 * Throttle damping factor
 *
 * This is the damping gain for the throttle demand loop.
 * Increase to add damping to correct for oscillations in speed and height.
 *
 * @group Fixed Wing TECS
 */
PARAM_DEFINE_FLOAT(FW_T_THR_DAMP, 0.5f);

/**
 * Integrator gain
 *
 * This is the integrator gain on the control loop.
 * Increasing this gain increases the speed at which speed
 * and height offsets are trimmed out, but reduces damping and
 * increases overshoot.
 *
 * @group Fixed Wing TECS
 */
PARAM_DEFINE_FLOAT(FW_T_INTEG_GAIN, 0.1f);

/**
 * Maximum vertical acceleration
 *
 * This is the maximum vertical acceleration (in metres/second square)
 * either up or down that the controller will use to correct speed
 * or height errors. The default value of 7 m/s/s (equivalent to +- 0.7 g)
 * allows for reasonably aggressive pitch changes if required to recover
 * from under-speed conditions.
 *
 * @group Fixed Wing TECS
 */
PARAM_DEFINE_FLOAT(FW_T_VERT_ACC, 7.0f);

/**
 * Complementary filter "omega" parameter for height
 *
 * This is the cross-over frequency (in radians/second) of the complementary
 * filter used to fuse vertical acceleration and barometric height to obtain
 * an estimate of height rate and height. Increasing this frequency weights
 * the solution more towards use of the barometer, whilst reducing it weights
 * the solution more towards use of the accelerometer data.
 *
 * @group Fixed Wing TECS
 */
PARAM_DEFINE_FLOAT(FW_T_HGT_OMEGA, 3.0f);

/**
 * Complementary filter "omega" parameter for speed
 *
 * This is the cross-over frequency (in radians/second) of the complementary
 * filter used to fuse longitudinal acceleration and airspeed to obtain an
 * improved airspeed estimate. Increasing this frequency weights the solution
 * more towards use of the arispeed sensor, whilst reducing it weights the
 * solution more towards use of the accelerometer data.
 *
 * @group Fixed Wing TECS
 */
PARAM_DEFINE_FLOAT(FW_T_SPD_OMEGA, 2.0f);

/**
 * Roll -> Throttle feedforward
 *
 * Increasing this gain turn increases the amount of throttle that will
 * be used to compensate for the additional drag created by turning.
 * Ideally this should be set to  approximately 10 x the extra sink rate
 * in m/s created by a 45 degree bank turn. Increase this gain if
 * the aircraft initially loses energy in turns and reduce if the
 * aircraft initially gains energy in turns. Efficient high aspect-ratio
 * aircraft (eg powered sailplanes) can use a lower value, whereas
 * inefficient low aspect-ratio models (eg delta wings) can use a higher value.
 *
 * @group Fixed Wing TECS
 */
PARAM_DEFINE_FLOAT(FW_T_RLL2THR, 10.0f);

/**
 * Speed <--> Altitude priority
 *
 * This parameter adjusts the amount of weighting that the pitch control
 * applies to speed vs height errors. Setting it to 0.0 will cause the
 * pitch control to control height and ignore speed errors. This will
 * normally improve height accuracy but give larger airspeed errors.
 * Setting it to 2.0 will cause the pitch control loop to control speed
 * and ignore height errors. This will normally reduce airspeed errors,
 * but give larger height errors. The default value of 1.0 allows the pitch
 * control to simultaneously control height and speed.
 * Note to Glider Pilots - set this parameter to 2.0 (The glider will
 * adjust its pitch angle to maintain airspeed, ignoring changes in height).
 *
 * @group Fixed Wing TECS
 */
PARAM_DEFINE_FLOAT(FW_T_SPDWEIGHT, 1.0f);

/**
 * Pitch damping factor
 *
 * This is the damping gain for the pitch demand loop. Increase to add
 * damping to correct for oscillations in height. The default value of 0.0
 * will work well provided the pitch to servo controller has been tuned
 * properly.
 *
 * @group Fixed Wing TECS
 */
PARAM_DEFINE_FLOAT(FW_T_PTCH_DAMP, 0.0f);

/**
 * Height rate P factor
 *
 * @group Fixed Wing TECS
 */
PARAM_DEFINE_FLOAT(FW_T_HRATE_P, 0.05f);

/**
 * Height rate FF factor
 *
 * @group Fixed Wing TECS
 */
PARAM_DEFINE_FLOAT(FW_T_HRATE_FF, 0.0f);

/**
 * Speed rate P factor
 *
 * @group Fixed Wing TECS
 */
PARAM_DEFINE_FLOAT(FW_T_SRATE_P, 0.05f);

/**
 * Landing slope angle
 *
 * @group L1 Control
 */
PARAM_DEFINE_FLOAT(FW_LND_ANG, 5.0f);

/**
 *
 *
 * @group L1 Control
 */
PARAM_DEFINE_FLOAT(FW_LND_HVIRT, 10.0f);

/**
 * Landing flare altitude (relative to landing altitude)
 *
 * @unit meter
 * @group L1 Control
 */
PARAM_DEFINE_FLOAT(FW_LND_FLALT, 8.0f);

/**
 * Landing throttle limit altitude (relative landing altitude)
 *
 * Default of -1.0f lets the system default to applying throttle
 * limiting at 2/3 of the flare altitude.
 *
 * @unit meter
 * @group L1 Control
 */
PARAM_DEFINE_FLOAT(FW_LND_TLALT, -1.0f);

/**
 * Landing heading hold horizontal distance
 *
 * @group L1 Control
 */
PARAM_DEFINE_FLOAT(FW_LND_HHDIST, 15.0f);

/**
 * Enable or disable usage of terrain estimate during landing
 *
 * 0: disabled, 1: enabled
 *
 * @group L1 Control
 */
PARAM_DEFINE_INT32(FW_LND_USETER, 0);

/**
 * Flare, minimum pitch
 *
 * Minimum pitch during flare, a positive sign means nose up
 * Applied once FW_LND_TLALT is reached
 *
 */
PARAM_DEFINE_FLOAT(FW_FLARE_PMIN, 2.5f);

/**
 * Flare, maximum pitch
 *
 * Maximum pitch during flare, a positive sign means nose up
 * Applied once FW_LND_TLALT is reached
 *
 */
PARAM_DEFINE_FLOAT(FW_FLARE_PMAX, 15.0f);


text:
/* ----------------------------------------------------------------------
 * Project:      CMSIS DSP Library
 * Title:        arm_fir_decimate_init_q31.c
 * Description:  Initialization function for Q31 FIR Decimation filter
 *
 * $Date:        23 April 2021
 * $Revision:    V1.9.0
 *
 * Target Processor: Cortex-M and Cortex-A cores
 * -------------------------------------------------------------------- */
/*
 * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved.
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Licensed under the Apache License, Version 2.0 (the License); you may
 * not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an AS IS BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include "dsp/filtering_functions.h"

/**
  @ingroup groupFilters
 */

/**
  @addtogroup FIR_decimate
  @{
 */

/**
  @brief         Initialization function for the Q31 FIR decimator.
  @param[in,out] S          points to an instance of the Q31 FIR decimator structure
  @param[in]     numTaps    number of coefficients in the filter
  @param[in]     M          decimation factor
  @param[in]     pCoeffs    points to the filter coefficients
  @param[in]     pState     points to the state buffer
  @param[in]     blockSize  number of input samples to process
  @return        execution  status
                   - \ref ARM_MATH_SUCCESS      : Operation successful
                   - \ref ARM_MATH_LENGTH_ERROR : blockSize is not a multiple of M

  @par           Details
                   pCoeffs points to the array of filter coefficients stored in time reversed order:

      {b[numTaps-1], b[numTaps-2], b[N-2], ..., b[1], b[0]}

  @par
                   pState points to the array of state variables.
                   pState is of length numTaps+blockSize-1 words where blockSize is the number of input samples passed to arm_fir_decimate_q31().
                   M is the decimation factor.
 */

arm_status arm_fir_decimate_init_q31(
        arm_fir_decimate_instance_q31 * S,
        uint16_t numTaps,
        uint8_t M,
  const q31_t * pCoeffs,
        q31_t * pState,
        uint32_t blockSize)
{
  arm_status status;

  /* The size of the input block must be a multiple of the decimation factor */
  if ((blockSize % M) != 0U)
  {
    /* Set status as ARM_MATH_LENGTH_ERROR */
    status = ARM_MATH_LENGTH_ERROR;
  }
  else
  {
    /* Assign filter taps */
    S->numTaps = numTaps;

    /* Assign coefficient pointer */
    S->pCoeffs = pCoeffs;

    /* Clear the state buffer. The size is always (blockSize + numTaps - 1) */
    memset(pState, 0, (numTaps + (blockSize - 1U)) * sizeof(q31_t));

    /* Assign state pointer */
    S->pState = pState;

    /* Assign Decimation Factor */
    S->M = M;

    status = ARM_MATH_SUCCESS;
  }

  return (status);

}

/**
  @} end of FIR_decimate group
 */


text:
var f = require('util').format,
	async = require('async'),
	assert = require('chai').assert,
	Cache = require('../index.js');

var helpers = module.exports = {};

helpers.describeStore = function(storeName, Store) {

	describe(f('%s store', storeName), function() {
		it('should allow a store Constructor', function() {
			var cache = new Cache({
				store: Store
			});

			assert.isNotNull(cache.store);
			assert.equal(cache.store.type, storeName);
			assert.instanceOf(cache.store, Store);
		});

		it('should allow a store Object', function() {
			var cache = new Cache({
				store: new Store()
			});

			assert.isNotNull(cache.store);
			assert.equal(cache.store.type, storeName);
			assert.instanceOf(cache.store, Store);
		});

	});
};

helpers.describeSetAndGet = function(getCache, TTL, TIMEOUT) {
	var value = 'burpadurp';

	describe(f('set() and get() for %s', getCache().store.type), function() {

		it('should return undefined for misses', function(done) {
			var cache = getCache();

			cache.get(getKey(), function(err, v) {
				assert.isNull(err);
				assert.isUndefined(v);

				done();
			});
		});

		it('should set without a callback', function(done) {
			var cache = getCache();

			assert.doesNotThrow(function() {
				cache.set(getKey(), value);

				done();
			});
		});

		it('should set a null value', function(done) {
			var cache = getCache(),
				key = getKey();

			cache.set(key, null, function(err, set) {
				assert.isNull(err);
				assert.isTrue(set);

				cache.get(key, function(err, v) {
					assert.isNull(err);
					assert.isNull(v);

					done();
				});
			});
		});

		it('should set a 0 value', function(done) {
			var cache = getCache(),
				key = getKey();

			cache.set(key, 0, function(err, set) {
				assert.isNull(err);
				assert.isTrue(set);

				cache.get(key, function(err, v) {
					assert.isNull(err);
					assert.equal(v, 0);

					done();
				});
			});
		});

		it('should set a an empty string', function(done) {
			var cache = getCache(),
				key = getKey();

			cache.set(key, '', function(err, set) {
				assert.isNull(err);
				assert.isTrue(set);

				cache.get(key, function(err, v) {
					assert.isNull(err);
					assert.equal(v, '');

					done();
				});
			});
		});

		describe('without a ttl', function() {

			it('should set a value and get that value', function(done) {
				var cache = getCache(),
					key = getKey();

				cache.set(key, value, function(err, set) {
					assert.isNull(err);
					assert.isTrue(set);

					cache.get(key, function(err, v) {
						assert.isNull(err);
						assert.equal(v, value);

						done();
					});
				});
			});
		});

		describe('with a ttl', function() {

			it('should set a value and get that value before expiration', function(done) {
				var cache = getCache(),
					key = getKey();

				cache.set(key, value, TTL, function(err, set) {
					assert.isNull(err);
					assert.isTrue(set);

					cache.get(key, function(err, v) {
						assert.isNull(err);
						assert.equal(v, value);

						done();
					});
				});
			});

			it('should set a value and get a miss for that value after expiration', function(done) {
				var cache = getCache(),
					key = getKey();

				cache.set(key, value, TTL, function(err, set) {
					assert.isNull(err);
					assert.isTrue(set);

					// check existence after ttl is up
					setTimeout(function() {
						cache.get(key, function(err, v) {
							assert.isNull(err);
							assert.isUndefined(v);

							done();
						});
					}, TIMEOUT);
				});
			});

		});

		describe('with a load function', function() {

			it('should call the load function if there is a miss', function(done) {
				var called = false,
					cache = getCache(),
					key = getKey();

				function load(key, cb) {
					called = true;
					cb(null, value);
				}

				cache.get(key, load, function(err, v) {
					assert.isNull(err);
					assert.equal(v, value);
					assert.isTrue(called);

					// check existence after event loop is done
					setTimeout(function() {
						cache.get(key, function(err, v) {
							assert.isNull(err);
							assert.equal(v, value);

							done();
						});
					}, 0);

				});

			});

			it('should set the ttl with a load function', function(done) {
				var called = false,
					cache = getCache(),
					key = getKey();

				function load(key, cb) {
					called = true;
					cb(null, value);
				}

				cache.get(key, load, TTL, function(err, v) {
					assert.isNull(err);
					assert.equal(v, value);
					assert.isTrue(called);

					// check existence after ttl is up
					setTimeout(function() {
						cache.get(key, function(err, v) {
							assert.isNull(err);
							assert.isUndefined(v);

							done();
						});
					}, TIMEOUT);

				});
			});
		});

	});

};

helpers.describeMultiGet = function(getCache, description, method, TTL, TTL_STRING, TIMEOUT) {
	var value = 'burpadurp';

	describe(description, function() {
		var value1 = 'bop',
			value2 = 'burp';

		it('should set 2 values, and return both in the same order', function(done) {
			var cache = getCache(),
				key1 = getKey(),
				key2 = getKey();

			cache.set(key1, value1, function(err, set) {
				assert.isNull(err);
				assert.isTrue(set);

				cache.set(key2, value2, function(err, set) {
					assert.isNull(err);
					assert.isTrue(set);

					cache[method]([key2, key1], function(err, results) {
						assert.isNull(err);
						assert.lengthOf(results, 2);
						assert.equal(results[0], value2);
						assert.equal(results[1], value1);

						done();
					});
				});
			});
		});

		it('should handle a load function for missing values', function(done) {
			var called = false,
				cache = getCache(),
				key1 = getKey(),
				key2 = getKey();

			function loadIt(keys, cb) {
				called = true;
				cb(null, [value2, value1]);
			}

			cache[method]([key2, key1], loadIt, function(err, results) {
				assert.isNull(err);
				assert.lengthOf(results, 2);
				assert.equal(results[0], value2);
				assert.equal(results[1], value1);
				assert.isTrue(called);

				done();
			});

		});

		it('should handle a load function and a ttl for missing values', function(done) {
			var called = false,
				cache = getCache(),
				key1 = getKey(),
				key2 = getKey();

			function loadIt(keys, cb) {
				called = true;
				cb(null, [value2, value1]);
			}

			cache[method]([key2, key1], loadIt, 1, function(err, results) {
				assert.isNull(err);
				assert.lengthOf(results, 2);
				assert.equal(results[0], value2);
				assert.equal(results[1], value1);
				assert.isTrue(called);

				done();
			});

		});

		it('should handle a load function and a string ttl for missing values', function(done) {
			var called = false,
				cache = getCache(),
				key1 = getKey(),
				key2 = getKey();

			function loadIt(keys, cb) {
				called = true;
				cb(null, [value2, value1]);
			}

			cache[method]([key2, key1], loadIt, '1s', function(err, results) {
				assert.isNull(err);
				assert.lengthOf(results, 2);
				assert.equal(results[0], value2);
				assert.equal(results[1], value1);
				assert.isTrue(called);

				done();
			});

		});

		it('should handle a load function and a ttl for missing values and not return them after expiration', function(done) {
			var called = false,
				cache = getCache(),
				key1 = getKey(),
				key2 = getKey();

			function loadIt(keys, cb) {
				called = true;
				cb(null, [value2, value1]);
			}

			cache[method]([key2, key1], loadIt, TTL, function(err, results) {
				assert.isNull(err);
				assert.lengthOf(results, 2);
				assert.equal(results[0], value2);
				assert.equal(results[1], value1);
				assert.isTrue(called);

				setTimeout(function() {
					cache[method]([key1, key2], function(err, results) {
						assert.isNull(err);
						assert.lengthOf(results, 2);
						assert.isUndefined(results[0]);
						assert.isUndefined(results[1]);

						done();
					});
				}, TIMEOUT);

			});

		});

		it('should handle a load function and a string ttl for missing values and not return them after expiration', function(done) {
			var called = false,
				cache = getCache(),
				key1 = getKey(),
				key2 = getKey();

			function loadIt(keys, cb) {
				called = true;
				cb(null, [value2, value1]);
			}

			cache[method]([key2, key1], loadIt, TTL_STRING, function(err, results) {
				assert.isNull(err);
				assert.lengthOf(results, 2);
				assert.equal(results[0], value2);
				assert.equal(results[1], value1);
				assert.isTrue(called);

				setTimeout(function() {
					cache[method]([key1, key2], function(err, results) {
						assert.isNull(err);
						assert.lengthOf(results, 2);
						assert.isUndefined(results[0]);
						assert.isUndefined(results[1]);

						done();
					});
				}, TIMEOUT);

			});

		});

	});
};

helpers.describeMultiSet = function(getCache, description, method, TTL, TTL_STRING, TIMEOUT) {

	describe(description, function() {
		var value1 = 'bop',
			value2 = 'burp';

		it('should set multiple values, and then allow them to be retreived', function(done) {
			var cache = getCache(),
				key1 = getKey(),
				key2 = getKey(),
				hash = {};

			hash[key1] = value1;
			hash[key2] = value2;

			cache[method](hash, function(err, set) {
				assert.isNull(err);
				assert.isTrue(set);

				cache.mget([key1, key2], function(err, results) {
					assert.isNull(err);
					assert.lengthOf(results, 2);
					assert.equal(results[0], value1);
					assert.equal(results[1], value2);

					done();
				});

			});
		});

		it('should set multiple values with a ttl, and then allow them to be retreived', function(done) {
			var cache = getCache(),
				key1 = getKey(),
				key2 = getKey(),
				hash = {};

			hash[key1] = value1;
			hash[key2] = value2;

			cache[method](hash, TTL, function(err, set) {
				assert.isNull(err);
				assert.isTrue(set);

				cache.mget([key1, key2], function(err, results) {
					assert.isNull(err);
					assert.lengthOf(results, 2);
					assert.equal(results[0], value1);
					assert.equal(results[1], value2);

					done();
				});

			});
		});

		it('should set multiple values with a ttl, and then not allow them to be retreived after expiration', function(done) {
			var cache = getCache(),
				key1 = getKey(),
				key2 = getKey(),
				hash = {};

			hash[key1] = value1;
			hash[key2] = value2;

			cache[method](hash, TTL, function(err, set) {
				assert.isNull(err);
				assert.isTrue(set);

				setTimeout(function() {
					cache.mget([key1, key2], function(err, results) {
						assert.isNull(err);
						assert.lengthOf(results, 2);
						assert.isUndefined(results[0]);
						assert.isUndefined(results[1]);

						done();
					});
				}, TIMEOUT);

			});
		});

		it('should function without a callback', function(done) {
			var cache = getCache(),
				key1 = getKey(),
				key2 = getKey(),
				hash = {};

			hash[key1] = value1;
			hash[key2] = value2;

			assert.doesNotThrow(function() {
				cache[method](hash);

				done();
			});
		});

	});
};

helpers.describeExpire = function(getCache, TTL, TTL_STRING, TIMEOUT) {
	var value = 'foobar';

	describe('expire()', function() {

		it('should return false when trying to expire non-existent keys', function(done) {
			var cache = getCache();

			cache.expire('non-existent-key', function(err, expired) {
				assert.isNull(err);
				assert.isFalse(expired);

				done();
			});

		});

		it('should remove an existing key when no ttl is passed', function(done) {
			var cache = getCache(),
				key = getKey();

			cache.set(key, value, TTL, function(err, set) {
				assert.isNull(err);
				assert.isTrue(set);

				cache.expire(key, function(err, expired) {
					assert.isNull(err);
					assert.isTrue(expired);

					cache.get(key, function(err, v) {
						assert.isNull(err);
						assert.isUndefined(v);

						done();
					});
				});
			});
		});

		it('should change an existing keys expiration', function(done) {
			var cache = getCache(),
				key = getKey();

			cache.set(key, value, 10, function(err, set) {
				assert.isNull(err);
				assert.isTrue(set);

				cache.expire(key, TTL, function(err, expired) {
					assert.isNull(err);
					assert.isTrue(expired);

					setTimeout(function() {
						cache.get(key, function(err, v) {
							assert.isNull(err);
							assert.isUndefined(v);

							done();
						});
					}, TIMEOUT);
				});
			});
		});

		it('should function without a callback', function(done) {
			var cache = getCache();

			assert.doesNotThrow(function() {
				cache.expire('non-existent-key');

				done();
			});
		});

	});

};

helpers.describeTagging = function(getCache) {

	describe('tagging', function() {
		var value = 'burpadurp',
			value1 = 'foo',
			value2 = 'biz';

		it('should allow getKeys() wit a single tag', function(done) {
			var cache = getCache(),
				key = getKey(),
				tag = getTag();

			cache.set(key, value, [tag], function(err, set) {
				assert.isNull(err);
				assert.isTrue(set);

				cache.getKeys(tag, function(err, keys) {
					assert.isNull(err);

					assert.deepEqual(keys, [key]);

					done();
				});
			});
		});

		it('should tag 4 cache keys the same way', function(done) {
			var cache = getCache(),
				tags = [ getTag(), getTag(), getTag() ],
				key1 = getKey(),
				key2 = getKey(),
				key3 = getKey(),
				key4 = getKey(),
				hash = {};

			hash[key1] = 'value1';
			hash[key2] = 'value2';
			hash[key3] = 'value3';
			hash[key4] = 'value4';

			async.parallel(
				Object.keys(hash).map(function(key) {
					return function(cb) {
						cache.set(key, hash[key], tags, function(err, set) {
							assert.isNull(err);
							assert.isTrue(set);
							cb();
						});
					};
				}),
				function(err, results) {

					async.parallel(
						tags.map(function(tag) {
							return function(cb) {
								cache.getKeys(tag, function(err, keys) {
									assert.sameMembers(keys, Object.keys(hash));
									cb();
								});
							};
						}),
						function(err) {
							assert.isUndefined(err);
							done();
						}
					);
				}
			);
		});

		it('should tag 4 cache keys differently', function(done) {
			var cache = getCache(),
				key1 = getKey(),
				key2 = getKey(),
				key3 = getKey(),
				key4 = getKey(),
				tags = {},
				hash = {};

			hash[key1] = 'value1';
			hash[key2] = 'value2';
			hash[key3] = 'value3';
			hash[key4] = 'value4';

			tags[key1] = [ getTag(), getTag(), getTag() ];
			tags[key2] = [ getTag(), getTag(), getTag() ];
			tags[key3] = [ getTag(), getTag(), getTag() ];
			tags[key4] = [ getTag(), getTag(), getTag() ];

			async.parallel(
				Object.keys(hash).map(function(key) {
					return function(cb) {
						cache.set(key, hash[key], tags[key], function(err, set) {
							assert.isNull(err);
							assert.isTrue(set);
							cb();
						});
					};
				}),
				function(err, results) {

					var tagList = {};
					Object.keys(tags).forEach(function(key) {
						tags[key].forEach(function(tag) {
							if(!tagList[tag]) tagList[tag] = [];
							tagList[tag].push(key);
						});
					});

					async.parallel(
						Object.keys(tagList).reduce(function(map, tag) {
							map[tag] = function(cb) {
								cache.getKeys(tag, function(err, keys) {
									assert.sameMembers(keys, tagList[tag]);
									cb(err, keys);
								});
							};

							return map;
						}, {}),
						function(err, results) {
							assert.isUndefined(err);
							done();
						}
					);
				}
			);
		});

		it('should set one tag for one key via mset()', function(done) {
			var cache = getCache(),
				key1 = getKey(),
				key2 = getKey(),
				hash = {},
				tags = {},
				tag = getTag();

			hash[key1] = value1;
			hash[key2] = value2;

			tags[key1] = [tag];

			cache.mset(hash, tags, function(err, set) {
				assert.isNull(err);
				assert.isTrue(set);

				cache.getKeys(tag, function(err, keys) {
					assert.isNull(err);
					assert.deepEqual(keys, [key1]);

					done();
				});
			});
		});

		it('should set one tag for one key via set()', function(done) {
			var cache = getCache(),
				key1 = getKey(),
				key2 = getKey(),
				hash = {},
				tags = {},
				tag = getTag();

			hash[key1] = value1;
			hash[key2] = value2;

			tags[key1] = [tag];

			cache.set(hash, tags, function(err, set) {
				assert.isNull(err);
				assert.isTrue(set);

				cache.getKeys(tag, function(err, keys) {
					assert.isNull(err);
					assert.deepEqual(keys, [key1]);

					done();
				});
			});
		});

		it('should set two tags for one key via mset()', function(done) {
			var cache = getCache(),
				key1 = getKey(),
				key2 = getKey(),
				hash = {},
				tags = {},
				tag1 = getTag(),
				tag2 = getTag();

			hash[key1] = value1;
			hash[key2] = value2;

			tags[key1] = [tag1, tag2];

			cache.mset(hash, tags, function(err, set) {
				assert.isNull(err);
				assert.isTrue(set);

				cache.getKeys([tag1, tag2], function(err, keys) {
					assert.isNull(err);
					assert.deepEqual(keys, [key1]);

					done();
				});
			});
		});

		it('should set two tags for one key via set()', function(done) {
			var cache = getCache(),
				key1 = getKey(),
				key2 = getKey(),
				hash = {},
				tags = {},
				tag1 = getTag(),
				tag2 = getTag();

			hash[key1] = value1;
			hash[key2] = value2;

			tags[key1] = [tag1, tag2];

			cache.mset(hash, tags, function(err, set) {
				assert.isNull(err);
				assert.isTrue(set);

				cache.getKeys([tag1, tag2], function(err, keys) {
					assert.isNull(err);
					assert.deepEqual(keys, [key1]);

					done();
				});
			});
		});

		it('should set two tags for one key and one tag for another via mset()', function(done) {
			var cache = getCache(),
				key1 = getKey(),
				key2 = getKey(),
				hash = {},
				tags = {},
				tag1 = getTag(),
				tag2 = getTag();

			hash[key1] = value1;
			hash[key2] = value2;

			tags[key1] = [tag1, tag2];
			tags[key2] = [tag1];

			cache.mset(hash, tags, function(err, set) {
				assert.isNull(err);
				assert.isTrue(set);

				cache.getKeys([tag1, tag2], function(err, keys) {
					assert.isNull(err);
					assert.include(keys, key1);
					assert.include(keys, key2);
					assert.lengthOf(keys, 2);

					cache.getKeys([tag1], function(err, keys){
						assert.isNull(err);
						assert.include(keys, key1);
						assert.include(keys, key2);
						assert.lengthOf(keys, 2);

						done();
					});
				});
			});
		});

		it('should set two tags for one key and one tag for another via set()', function(done) {
			var cache = getCache(),
				key1 = getKey(),
				key2 = getKey(),
				hash = {},
				tags = {},
				tag1 = getTag(),
				tag2 = getTag();

			hash[key1] = value1;
			hash[key2] = value2;

			tags[key1] = [tag1, tag2];
			tags[key2] = [tag1];

			cache.set(hash, tags, function(err, set) {
				assert.isNull(err);
				assert.isTrue(set);

				cache.getKeys([tag1, tag2], function(err, keys) {
					assert.isNull(err);
					assert.include(keys, key1);
					assert.include(keys, key2);
					assert.lengthOf(keys, 2);

					cache.getKeys([tag1], function(err, keys){
						assert.isNull(err);
						assert.include(keys, key1);
						assert.include(keys, key2);
						assert.lengthOf(keys, 2);

						done();
					});
				});
			});
		});

	});

};

var idx = 0;
var getKey = helpers.getKey = function() {
	return ['testkey',++idx,Date.now()].join(':');
};

var tagIdx = 0;
var getTag = helpers.getTag = function() {
	return ['tagtag',++tagIdx,Date.now()].join(':');
};


text:
using System;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using JetBrains.Annotations;
using NUnit.Framework;
using osu.Framework.Extensions;
using osu.Framework.Logging;
using osu.Framework.Platform;
using osu.Game.Beatmaps;
using osu.Game.Database;
using osu.Game.IO;
using osu.Game.Models;
using osu.Game.Rulesets;

namespace osu.Game.Tests.Database
{
    [TestFixture]
    public abstract class RealmTest
    {
        protected void RunTestWithRealm([InstantHandle] Action<RealmAccess, OsuStorage> testAction, [CallerMemberName] string caller = "")
        {
            using (HeadlessGameHost host = new CleanRunHeadlessGameHost(callingMethodName: caller))
            {
                host.Run(new RealmTestGame(() =>
                {
                    var defaultStorage = host.Storage;

                    var testStorage = new OsuStorage(host, defaultStorage);

                    using (var realm = new RealmAccess(testStorage, OsuGameBase.CLIENT_DATABASE_FILENAME))
                    {
                        Logger.Log($"Running test using realm file {testStorage.GetFullPath(realm.Filename)}");
                        testAction(realm, testStorage);

                        realm.Dispose();

                        Logger.Log($"Final database size: {getFileSize(testStorage, realm)}");
                        realm.Compact();
                        Logger.Log($"Final database size after compact: {getFileSize(testStorage, realm)}");
                    }
                }));
            }
        }

        protected void RunTestWithRealmAsync(Func<RealmAccess, Storage, Task> testAction, [CallerMemberName] string caller = "")
        {
            using (HeadlessGameHost host = new CleanRunHeadlessGameHost(callingMethodName: caller))
            {
                host.Run(new RealmTestGame(async () =>
                {
                    var testStorage = host.Storage;

                    using (var realm = new RealmAccess(testStorage, OsuGameBase.CLIENT_DATABASE_FILENAME))
                    {
                        Logger.Log($"Running test using realm file {testStorage.GetFullPath(realm.Filename)}");
                        await testAction(realm, testStorage);

                        realm.Dispose();

                        Logger.Log($"Final database size: {getFileSize(testStorage, realm)}");
                        realm.Compact();
                    }
                }));
            }
        }

        protected static BeatmapSetInfo CreateBeatmapSet(RulesetInfo ruleset)
        {
            RealmFile createRealmFile() => new RealmFile { Hash = Guid.NewGuid().ToString().ComputeSHA2Hash() };

            var metadata = new BeatmapMetadata
            {
                Title = "My Love",
                Artist = "Kuba Oms"
            };

            var beatmapSet = new BeatmapSetInfo
            {
                Beatmaps =
                {
                    new BeatmapInfo(ruleset, new BeatmapDifficulty(), metadata) { DifficultyName = "Easy", },
                    new BeatmapInfo(ruleset, new BeatmapDifficulty(), metadata) { DifficultyName = "Normal", },
                    new BeatmapInfo(ruleset, new BeatmapDifficulty(), metadata) { DifficultyName = "Hard", },
                    new BeatmapInfo(ruleset, new BeatmapDifficulty(), metadata) { DifficultyName = "Insane", }
                },
                Files =
                {
                    new RealmNamedFileUsage(createRealmFile(), "test [easy].osu"),
                    new RealmNamedFileUsage(createRealmFile(), "test [normal].osu"),
                    new RealmNamedFileUsage(createRealmFile(), "test [hard].osu"),
                    new RealmNamedFileUsage(createRealmFile(), "test [insane].osu"),
                }
            };

            for (int i = 0; i < 8; i++)
                beatmapSet.Files.Add(new RealmNamedFileUsage(createRealmFile(), $"hitsound{i}.mp3"));

            foreach (var b in beatmapSet.Beatmaps)
                b.BeatmapSet = beatmapSet;

            return beatmapSet;
        }

        protected static RulesetInfo CreateRuleset() =>
            new RulesetInfo("osu", "osu!", string.Empty, 0) { Available = true };

        private class RealmTestGame : Framework.Game
        {
            public RealmTestGame([InstantHandle] Func<Task> work)
            {
                // ReSharper disable once AsyncVoidLambda
                Scheduler.Add(async () =>
                {
                    await work().ConfigureAwait(true);
                    Exit();
                });
            }

            public RealmTestGame([InstantHandle] Action work)
            {
                Scheduler.Add(() =>
                {
                    work();
                    Exit();
                });
            }
        }

        private static long getFileSize(Storage testStorage, RealmAccess realm)
        {
            try
            {
                using (var stream = testStorage.GetStream(realm.Filename))
                    return stream?.Length ?? 0;
            }
            catch
            {
                // windows runs may error due to file still being open.
                return 0;
            }
        }
    }
}


text:
package com.intellij.diagnostic;

import com.intellij.idea.IdeaApplication;
import com.intellij.idea.Main;
import com.intellij.openapi.application.Application;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.diagnostic.ErrorLogger;
import com.intellij.openapi.diagnostic.ExceptionWithAttachments;
import com.intellij.openapi.diagnostic.IdeaLoggingEvent;
import com.intellij.util.ExceptionUtil;
import com.intellij.util.containers.ContainerUtil;
import org.apache.log4j.AppenderSkeleton;
import org.apache.log4j.Level;
import org.apache.log4j.spi.LoggingEvent;
import org.apache.log4j.spi.ThrowableInformation;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.TestOnly;

import javax.swing.*;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;

/**
 * @author Mike
 */
public class DialogAppender extends AppenderSkeleton {
  private static final ErrorLogger DEFAULT_LOGGER = new DefaultIdeaErrorLogger();
  private static final int MAX_ASYNC_LOGGING_EVENTS = 5;

  private volatile Runnable myDialogRunnable = null;
  private final AtomicInteger myPendingAppendCounts = new AtomicInteger();

  @Override
  protected synchronized void append(@NotNull final LoggingEvent event) {
    if (!event.getLevel().isGreaterOrEqual(Level.ERROR) ||
        Main.isCommandLine() ||
        !IdeaApplication.isLoaded()) {
      return;
    }

    Runnable action = new Runnable() {
      @Override
      public void run() {
        try {
          List<ErrorLogger> loggers = new ArrayList<ErrorLogger>();
          loggers.add(DEFAULT_LOGGER);

          Application application = ApplicationManager.getApplication();
          if (application != null) {
            if (application.isHeadlessEnvironment() || application.isDisposed()) return;
            ContainerUtil.addAll(loggers, application.getComponents(ErrorLogger.class));
          }

          appendToLoggers(event, loggers.toArray(new ErrorLogger[loggers.size()]));
        }
        finally {
          myPendingAppendCounts.decrementAndGet();
        }
      }
    };

    if (myPendingAppendCounts.addAndGet(1) > MAX_ASYNC_LOGGING_EVENTS) {
      // Stop adding requests to the queue or we can get OOME on pending logging requests (IDEA-95327)
      myPendingAppendCounts.decrementAndGet(); // number of pending logging events should not increase
    }
    else {
      // Note, we MUST avoid SYNCHRONOUS invokeAndWait to prevent deadlocks
      //noinspection SSBasedInspection
      SwingUtilities.invokeLater(action);
    }
  }

  void appendToLoggers(@NotNull LoggingEvent event, @NotNull ErrorLogger[] errorLoggers) {
    if (myDialogRunnable != null) {
      return;
    }

    final IdeaLoggingEvent ideaEvent;
    final Object message = event.getMessage();
    if (message instanceof IdeaLoggingEvent) {
      ideaEvent = (IdeaLoggingEvent)message;
    }
    else {
      ThrowableInformation info = event.getThrowableInformation();
      if (info == null) {
        return;
      }
      ideaEvent = extractLoggingEvent(message, info.getThrowable());
    }
    for (int i = errorLoggers.length - 1; i >= 0; i--) {
      final ErrorLogger logger = errorLoggers[i];
      if (!logger.canHandle(ideaEvent)) {
        continue;
      }
      myDialogRunnable = new Runnable() {
        @Override
        public void run() {
          try {
            logger.handle(ideaEvent);
          }
          finally {
            myDialogRunnable = null;
          }
        }
      };

      final Application app = ApplicationManager.getApplication();
      if (app == null) {
        new Thread(myDialogRunnable, "dialog appender logger").start();
      }
      else {
        app.executeOnPooledThread(myDialogRunnable);
      }
      break;
    }
  }

  private static IdeaLoggingEvent extractLoggingEvent(Object message, Throwable throwable) {
    //noinspection ThrowableResultOfMethodCallIgnored
    Throwable rootCause = ExceptionUtil.getRootCause(throwable);
    if (rootCause instanceof LogEventException) {
      return ((LogEventException)rootCause).getLogMessage();
    }

    String strMessage = message == null ? "<null> " : message.toString();
    ExceptionWithAttachments withAttachments = ExceptionUtil.findCause(throwable, ExceptionWithAttachments.class);
    if (withAttachments != null) {
      return LogMessageEx.createEvent(strMessage, ExceptionUtil.getThrowableText(throwable), withAttachments.getAttachments());
    }

    return new IdeaLoggingEvent(strMessage, throwable);
  }

  @TestOnly
  Runnable getDialogRunnable() {
    return myDialogRunnable;
  }

  @Override
  public boolean requiresLayout() {
    return false;
  }

  @Override
  public void close() {
  }
}


text:
<?php

declare(strict_types=1);

namespace WsdlToPhp\PackageGenerator\Tests\File\Validation;

use TypeError;

/**
 * @internal
 * @coversDefaultClass
 */
final class BooleanRuleTest extends AbstractRuleTest
{
    public function testSetPrimaryWithStringValueMustThrowAnException()
    {
        $this->expectException(TypeError::class);

        $instance = self::getWhlBookingChannelInstance();

        $instance->setPrimary('true');
    }

    public function testSetPrimaryWithTrueValueMustPass()
    {
        $instance = self::getWhlBookingChannelInstance();

        $this->assertSame($instance, $instance->setPrimary(true));
    }

    public function testSetPrimaryWithFalseValueMustPass()
    {
        $instance = self::getWhlBookingChannelInstance();

        $this->assertSame($instance, $instance->setPrimary(false));
    }

    public function testSetPrimaryWithNullValueMustPass()
    {
        $instance = self::getWhlBookingChannelInstance();

        $this->assertSame($instance, $instance->setPrimary(null));
    }
}


text:
var constants = {
	SET_DOMAIN: 'SET_DOMAIN',
	ADD_KEYWORD: 'ADD_KEYWORD',
	KEYWORD_PAGE_DETECTED: 'KEYWORD_PAGE_DETECTED'
};

module.exports = constants;


text:
if [ -z "$RED5_HOME" ]; then export RED5_HOME=.; fi

# Debug options
export JAVA_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n $JAVA_OPTS"

# Start Red5
exec $RED5_HOME/red5.sh


text:
/* $OpenBSD: dh_lib.c,v 1.15 2014/06/12 15:49:28 deraadt Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
 * All rights reserved.
 *
 * This package is an SSL implementation written
 * by Eric Young (eay@cryptsoft.com).
 * The implementation was written so as to conform with Netscapes SSL.
 *
 * This library is free for commercial and non-commercial use as long as
 * the following conditions are aheared to.  The following conditions
 * apply to all code found in this distribution, be it the RC4, RSA,
 * lhash, DES, etc., code; not just the SSL code.  The SSL documentation
 * included with this distribution is covered by the same copyright terms
 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
 *
 * Copyright remains Eric Young's, and as such any Copyright notices in
 * the code are not to be removed.
 * If this package is used in a product, Eric Young should be given attribution
 * as the author of the parts of the library used.
 * This can be in the form of a textual message at program startup or
 * in documentation (online or textual) provided with the package.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *    "This product includes cryptographic software written by
 *     Eric Young (eay@cryptsoft.com)"
 *    The word 'cryptographic' can be left out if the rouines from the library
 *    being used are not cryptographic related :-).
 * 4. If you include any Windows specific code (or a derivative thereof) from
 *    the apps directory (application code) you must include an acknowledgement:
 *    "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
 *
 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 * The licence and distribution terms for any publically available version or
 * derivative of this code cannot be changed.  i.e. this code cannot simply be
 * copied and put under another distribution licence
 * [including the GNU Public Licence.]
 */

#include <stdio.h>
#include "cryptlib.h"
#include <openssl/bn.h>
#include <openssl/dh.h>
#ifndef OPENSSL_NO_ENGINE
#include <openssl/engine.h>
#endif

const char DH_version[]="Diffie-Hellman" OPENSSL_VERSION_PTEXT;

static const DH_METHOD *default_DH_method = NULL;

void DH_set_default_method(const DH_METHOD *meth)
	{
	default_DH_method = meth;
	}

const DH_METHOD *DH_get_default_method(void)
	{
	if(!default_DH_method)
		{
		default_DH_method = DH_OpenSSL();
		}
	return default_DH_method;
	}

int DH_set_method(DH *dh, const DH_METHOD *meth)
	{
	/* NB: The caller is specifically setting a method, so it's not up to us
	 * to deal with which ENGINE it comes from. */
        const DH_METHOD *mtmp;
        mtmp = dh->meth;
        if (mtmp->finish) mtmp->finish(dh);
#ifndef OPENSSL_NO_ENGINE
	if (dh->engine)
		{
		ENGINE_finish(dh->engine);
		dh->engine = NULL;
		}
#endif
        dh->meth = meth;
        if (meth->init) meth->init(dh);
        return 1;
	}

DH *DH_new(void)
	{
	return DH_new_method(NULL);
	}

DH *DH_new_method(ENGINE *engine)
	{
	DH *ret;

	ret = malloc(sizeof(DH));
	if (ret == NULL)
		{
		DHerr(DH_F_DH_NEW_METHOD,ERR_R_MALLOC_FAILURE);
		return(NULL);
		}

	ret->meth = DH_get_default_method();
#ifndef OPENSSL_NO_ENGINE
	if (engine)
		{
		if (!ENGINE_init(engine))
			{
			DHerr(DH_F_DH_NEW_METHOD, ERR_R_ENGINE_LIB);
			free(ret);
			return NULL;
			}
		ret->engine = engine;
		}
	else
		ret->engine = ENGINE_get_default_DH();
	if(ret->engine)
		{
		ret->meth = ENGINE_get_DH(ret->engine);
		if(!ret->meth)
			{
			DHerr(DH_F_DH_NEW_METHOD,ERR_R_ENGINE_LIB);
			ENGINE_finish(ret->engine);
			free(ret);
			return NULL;
			}
		}
#endif

	ret->pad=0;
	ret->version=0;
	ret->p=NULL;
	ret->g=NULL;
	ret->length=0;
	ret->pub_key=NULL;
	ret->priv_key=NULL;
	ret->q=NULL;
	ret->j=NULL;
	ret->seed = NULL;
	ret->seedlen = 0;
	ret->counter = NULL;
	ret->method_mont_p=NULL;
	ret->references = 1;
	ret->flags=ret->meth->flags & ~DH_FLAG_NON_FIPS_ALLOW;
	CRYPTO_new_ex_data(CRYPTO_EX_INDEX_DH, ret, &ret->ex_data);
	if ((ret->meth->init != NULL) && !ret->meth->init(ret))
		{
#ifndef OPENSSL_NO_ENGINE
		if (ret->engine)
			ENGINE_finish(ret->engine);
#endif
		CRYPTO_free_ex_data(CRYPTO_EX_INDEX_DH, ret, &ret->ex_data);
		free(ret);
		ret=NULL;
		}
	return(ret);
	}

void DH_free(DH *r)
	{
	int i;
	if(r == NULL) return;
	i = CRYPTO_add(&r->references, -1, CRYPTO_LOCK_DH);
	if (i > 0) return;

	if (r->meth->finish)
		r->meth->finish(r);
#ifndef OPENSSL_NO_ENGINE
	if (r->engine)
		ENGINE_finish(r->engine);
#endif

	CRYPTO_free_ex_data(CRYPTO_EX_INDEX_DH, r, &r->ex_data);

	if (r->p != NULL) BN_clear_free(r->p);
	if (r->g != NULL) BN_clear_free(r->g);
	if (r->q != NULL) BN_clear_free(r->q);
	if (r->j != NULL) BN_clear_free(r->j);
	free(r->seed);
	if (r->counter != NULL) BN_clear_free(r->counter);
	if (r->pub_key != NULL) BN_clear_free(r->pub_key);
	if (r->priv_key != NULL) BN_clear_free(r->priv_key);
	free(r);
	}

int DH_up_ref(DH *r)
	{
	int i = CRYPTO_add(&r->references, 1, CRYPTO_LOCK_DH);
	return ((i > 1) ? 1 : 0);
	}

int DH_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
	     CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func)
        {
	return CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_DH, argl, argp,
				new_func, dup_func, free_func);
        }

int DH_set_ex_data(DH *d, int idx, void *arg)
	{
	return(CRYPTO_set_ex_data(&d->ex_data,idx,arg));
	}

void *DH_get_ex_data(DH *d, int idx)
	{
	return(CRYPTO_get_ex_data(&d->ex_data,idx));
	}

int DH_size(const DH *dh)
	{
	return(BN_num_bytes(dh->p));
	}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>SET-CERTAIN-OPINION</title>

I initialise the uncertainty with which I hold an opinion to a low
	value (i.e. I'm pretty certain).

	Begin micro-behaviour

SET-CERTAIN-OPINION

	Begin NetLogo code:

substitute-text-area-for initial-uncertainty 0.1
set my-uncertainty initial-uncertainty

	End NetLogo code

Variants

You can a different uncertainty value instead of 0.1, use a random number
	between 0 and 1 instead, or the value of a slider
	CREATE-SLIDER.

Related Micro-behaviours

The my-uncertainty attribute is used by
	RELATIVE-AGREEMENT.
	SET-OPINION-UNCERTAINTY sets it to a more normal value.
	SET-RANDOM-OPINION
	should also be used to set the "level" of this opinion.

How this works

It sets the attribute my-uncertainty to a 0.1 as was done for the
	extremists in the model described in [1].

History

This was implemented by Ken Kahn.

Footnotes

[1] An implementation of "How can extremism prevail? A study based on the
	relative agreement interaction model" by Guillaume Deffuant, Frédéric
	Amblard, Gérard Weisbuch and Thierry Faure (2002); Journal of Artificial
	Societies and Social Simulation vol. 5, no. 4; <http://jasss.soc.surrey.ac.uk/5/4/1.html#2.3>


text:
Install New Plugins

To install a new plugin, ensure it is compressed in a zip file, upload it, and the site will do the rest.

    <form method="post" enctype="multipart/form-data">
    Upload File
    <input type="file" name="zipfile" class="uploadfile" id="zipfile" style="opacity:0; width: 0px; height: 0px;">
</form>


text:
export class Session {
	id: number;
	user: number;
	name: string;
	questions: number[];
	answers: number[];
	status: number[];
	correct: number;
	answered: number;
	total: number;
	current: number;

	finishQuestion(answer: number, state: number): void {
		if (this.status[this.current] == 2) {
			this.status[this.current] = state;
			this.answers[this.current] = answer;
			this.answered++;
			this.correct += state == 1 ? 1 : 0;
		}
	};

	next(): void {
		if (this.current < this.total - 1) {
			this.current++;
		}
	};

	previous(): void {
		if (this.current > 0) {
			this.current--;
		}
	};

	getMcqId(): number{
		return this.questions[this.current];
	};

	getAnswer(): number{
		return this.answers[this.current];
	};

	getState(): number{
		return this.status[this.current];
	};

	removeCurrent(): void {
		if (this.status[this.current] == 1) {
			this.answered -= 1;
			this.correct -= 1;
		} else if (this.status[this.current] == 0) {
			this.answered -= 1;
		}
		this.total -= 1;
		delete this.questions[this.current];
		delete this.answers[this.current];
		delete this.status[this.current];
	};
}


text:
package io.hawt.web.filters;

import java.io.IOException;
import java.util.concurrent.TimeUnit;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class CORSFilter implements Filter {

    public CORSFilter() {
    }

    public void init(FilterConfig fConfig) throws ServletException {
    }

    public void destroy() {
    }

    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
        if (response instanceof HttpServletResponse) {
            HttpServletResponse resp = (HttpServletResponse) response;
            HttpServletRequest req = (HttpServletRequest) request;

            if (allowAny()) {
                if ("OPTIONS".equals(req.getMethod())) {
                    resp.addHeader("Access-Control-Request-Method", "GET, POST, PUT, DELETE");
                    String headers = req.getHeader("Access-Control-Request-Headers");
                    if (headers != null) {
                        resp.addHeader("Access-Control-Allow-Headers", headers);
                    }
                    resp.addHeader("Access-Control-Max-Age", "" + TimeUnit.DAYS.toSeconds(1));
                }
                resp.addHeader("Access-Control-Allow-Origin", "*");
            }
        }
        chain.doFilter(request, response);
    }

    protected boolean allowAny() {
        // TODO allow configuration...
        return true;
    }
}


text:
package de.javakaffee.web.msm;

/**
 * This exception is thrown, if session data was loaded from memcached but the
 * version does not match the current version.
 *
 * @author Martin Grotzke
 */
public class InvalidVersionException extends RuntimeException {

    private static final long serialVersionUID = 1L;

    private final short _version;

    /**
     * Creates a new {@link InvalidVersionException}.
     * @param msg the error message
     * @param version the version (the first 2 bytes) read from the session data that was loaded from memcached.
     */
    public InvalidVersionException( final String msg, final short version ) {
        super( msg );
        _version = version;
    }

    /**
     * The version (the first 2 bytes) read from the session data that was loaded from memcached.
     * @return the version
     */
    public short getVersion() {
        return _version;
    }

}


text:
package org.nuxeo.common.utils;

import java.io.File;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @author Bogdan Stefanescu
 *
 */
public class FileMatcher {

    private static final Pattern VAR = Pattern.compile("(.*)?\\{(.+):(.+)\\}(.*)?");

    public static FileMatcher getMatcher(String path) {
        Matcher m = VAR.matcher(path);
        if (m.matches()) {
            String prefix = m.group(1);
            String key = m.group(2).trim();
            String value = m.group(3).trim();
            String suffix = m.group(4);
            Pattern pattern = null;
            if (prefix.length() == 0) {
                if (suffix.length() == 0) {
                    pattern = Pattern.compile("(" + value + ")");
                } else {
                    pattern = Pattern.compile("(" + value + ")" + suffix);
                }
            } else if (suffix.length() == 0) {
                pattern = Pattern.compile(prefix + "(" + value + ")");
            } else {
                pattern = Pattern.compile(prefix + "(" + value + ")" + suffix);
            }
            return new FileMatcher(pattern, key);
        }
        return new FileMatcher(null, path);
    }

    public static FileMatcher getMatcher(File file) {
        return getMatcher(file.getName());
    }

    /**
     * Look for a matching file for the given path.
     *
     * @param path Searched file path, optionally including the pattern.
     * @param map The pattern variable will be put in the given map if any.
     *            Since 5.5, map can be null.
     *
     * @return File found. Null if none.
     */
    public static File getMatchingFile(String path, Map<String, Object> map) {
        File file = new File(path);
        FileMatcher matcher = getMatcher(path);
        if (matcher.getPattern() == null) {
            return file;
        }
        // a pattern -> find the first file that match that pattern
        File dir = file.getParentFile();
        File[] list = dir.listFiles();
        if (list != null) {
            for (File f : list) {
                if (matcher.match(f.getName())) {
                    if (map != null) {
                        map.put(matcher.getKey(), matcher.getValue());
                    }
                    return f;
                }
            }
        }
        return null;
    }

    protected final Pattern pattern;

    protected final String key;

    protected String value;

    public FileMatcher(Pattern pattern, String key) {
        this.pattern = pattern;
        this.key = key;
    }

    public String getKey() {
        return pattern != null ? key : null;
    }

    public Pattern getPattern() {
        return pattern;
    }

    public String getValue() {
        return value;
    }

    public boolean match(String name) {
        value = null;
        if (pattern != null) {
            Matcher m = pattern.matcher(name);
            if (m.matches()) {
                value = m.group(1);
                return true;
            }
            return false;
        } else if (name.equals(key)) {
            return true;
        }
        return false;
    }

}


text:
import angular from 'angular';
import uiRouter from 'angular-ui-router';
import usersComponent from './users.component';

let usersModule = angular.module('users', [
  uiRouter
])

.config(($stateProvider) => {
  "ngInject";
  $stateProvider
    .state('users', {
      url: '/users',
      component: 'users'
    });
})

.component('users', usersComponent)

.name;

export default usersModule;


text:
package com.thesett.aima.search.util.informed;

import java.util.Comparator;

import com.thesett.aima.search.SearchNode;

/**
 * GreedyComparator is a Comparator that compares the heuristic values of heuristic search nodes. This can be used to
 * order the search nodes in a greedy search.
 *
 *

CRC Card

 *
 Responsibilities  Collaborations
 *
 Order heuristic search nodes by heuristic value.
 *

 *
 * @author Rupert Smith
 */
public final class GreedyComparator implements Comparator<SearchNode>
{
    /**
     * Compares two heuristic search nodes by their heuristic values.
     *
     * @param  object1 The first search node to compare.
     * @param  object2 The second search node to compare.
     *
     * @return 1 if the first search node has a larger heuristic value than the second, -1 if it has a smaller heuristic
     *         value and 0 if they are the same.
     */
    public int compare(SearchNode object1, SearchNode object2)
    {
        float h1 = ((HeuristicSearchNode) object1).getH();
        float h2 = ((HeuristicSearchNode) object2).getH();

        return (h1 > h2) ? 1 : ((h1 < h2) ? -1 : 0);
    }
}


text:
import { satisfies } from 'semver';
import { version as TYPESCRIPT_VERSION } from 'typescript';
import { VERSION as COMPILER_CLI_VERSION } from '@angular/compiler-cli';

export function validateDeps(): { warn?: string[], error?: string[] } {
  const result = {
    warn: [],
    error: []
  };

  if (satisfies(COMPILER_CLI_VERSION.full, '<5.0.0') ) {
    result.error.push(`Angular Library Starter supports angular version 5 or greater, please upgrade.`);
  } else if (satisfies(COMPILER_CLI_VERSION.full, '<=5.0.2') && satisfies(TYPESCRIPT_VERSION, '>=2.5.0')) {
    result.error.push(`Angular ${COMPILER_CLI_VERSION.full} supports TypeScript 2.4.x or lower, Library will not build properly.`);
  } else {
    if (satisfies(TYPESCRIPT_VERSION, '<2.4.2')) {
      result.warn.push(`You are using TypeScript ${TYPESCRIPT_VERSION}. TypeScript ~2.4.2 is recommended, please upgrade.`);
    }
  }

  if (result.warn.length === 0) {
    delete result.warn;
  }
  if (result.error.length === 0) {
    delete result.error;
  }
  return result;
}


text:
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
/**
 * @class search::SearchVisitor
 *
 * @brief Visitor that applies a search query to visitor data and converts them to a SearchResultCommand
 */
#pragma once

#include "extendableattributes.h"
#include "attrvector.hpp"

namespace search {

template <typename T>
std::unique_ptr<attribute::SearchContext>
SingleExtAttribute<T>::getSearch(QueryTermSimpleUP term, const attribute::SearchContextParams & params) const
{
    (void) term;
    (void) params;
    return {};
}

template <typename T>
SingleExtAttribute<T>::SingleExtAttribute(const vespalib::string &name)
    : Super(name, Config(BasicType::fromType(T()), attribute::CollectionType::SINGLE))
{}

template <typename T>
bool
SingleExtAttribute<T>::addDoc(typename Super::DocId &docId) {
    docId = this->_data.size();
    this->_data.push_back(attribute::getUndefined<T>());
    this->incNumDocs();
    this->setCommittedDocIdLimit(this->getNumDocs());
    return true;
}
template <typename T>
bool
SingleExtAttribute<T>::add(typename AddValueType<T>::Type v, int32_t ) {
    this->_data.back() = v;
    return true;
}
template <typename T>
void
SingleExtAttribute<T>::onAddDocs(typename Super::DocId lidLimit) {
    this->_data.reserve(lidLimit);
}

template <typename T>
MultiExtAttribute<T>::MultiExtAttribute(const vespalib::string &name, const attribute::CollectionType &ctype)
    : Super(name, Config(BasicType::fromType(T()), ctype))
{ }
template <typename T>
std::unique_ptr<attribute::SearchContext>
MultiExtAttribute<T>::getSearch(QueryTermSimpleUP term, const attribute::SearchContextParams & params) const
{
    (void) term;
    (void) params;
    return {};
}

template <typename T>
MultiExtAttribute<T>::MultiExtAttribute(const vespalib::string &name)
    : Super(name, Config(BasicType::fromType(static_cast<T>(0)), attribute::CollectionType::ARRAY))
{}

template <typename T>
bool
MultiExtAttribute<T>::addDoc(typename Super::DocId &docId) {
    docId = this->_idx.size() - 1;
    this->_idx.push_back(this->_idx.back());
    this->incNumDocs();
    this->setCommittedDocIdLimit(this->getNumDocs());
    return true;
}
template <typename T>
bool
MultiExtAttribute<T>::add(typename AddValueType<T>::Type v, int32_t) {
    this->_data.push_back(v);
    std::vector<uint32_t> &idx = this->_idx;
    idx.back()++;
    this->checkSetMaxValueCount(idx.back() - idx[idx.size() - 2]);
    return true;
}
template <typename T>
void
MultiExtAttribute<T>::onAddDocs(uint32_t lidLimit) {
    this->_data.reserve(lidLimit);
}

template <typename T>
MultiExtAttribute<T>::~MultiExtAttribute() = default;

template <typename B>
WeightedSetExtAttributeBase<B>::WeightedSetExtAttributeBase(const vespalib::string & name)
    : B(name, attribute::CollectionType::WSET),
      _weights()
{}

template <typename B>
WeightedSetExtAttributeBase<B>::~WeightedSetExtAttributeBase() = default;

template <typename B>
void
WeightedSetExtAttributeBase<B>::addWeight(int32_t w) {
    _weights.push_back(w);
}

}  // namespace search