text:
CLEXIT – Climate Exit
The Clexit Coalition is leading The Great Climate Escape. "Clexit will prevail, because Mother Nature is on our side."
About/Join
Part Time Power
Solar power only works while the sun shines – it is part-time power.
Wind power only works when suitable winds blows – also part-time power.
Batteries only work when charged – part-time power again.
Hydro fails in droughts – more part-time power.
And using full-time power like gas to fill the inevitable supply gaps from part-time power forces backup gas to operate like part-time power.
Moreover, on sunny windy days, wind and solar generators spew out electricity at little extra cost. These erratic surges of part-time power drive short-term electricity prices so low that even low-cost full-time producers like coal cannot operate profitably at those times. They are throttled back and forced to operate as yet another part-time power plant.
24/7 electricity users such as hospitals, trains, factories, refineries, fuel and water pumps, cash registers, infrastructure and mines cannot operate on part-time electricity.
Moreover, every part-time power producer (using sun, wind, batteries, hydro, gas or coal) consumes money full-time for operations, standby, maintenance and replacement. Each also has to fund its own specialised generators, transmission lines, access roads and workforce. Electricity becomes both unreliable and expensive, and consumers suffer.
Using taxes, subsidies, dictates and mandates to replace a full-time power producer like coal with up to five part-time power producers only makes sense in the part-time minds that inhabit Greentopia.
Canberra cannot improve any of this with more laws and regulations – they must REPEAL all the legislation, regulations, subsidies and taxes that created the mess in the first place. State governments too should repeal their silly energy laws, and stop shutting and destroying power stations. More laws and regulations can only make things worse.
To comment on this article visit:
https://wattsupwiththat.com/2017/10/18/green-power-is-part-time-power/
Viv Forbes
Author clexit-adminPosted on November 29, 2017 Categories UncategorisedLeave a comment on Part Time Power
Party Time for Climateers
The climate warriors have held yet another Global Warming Jamboree in Bonn. As expected we were treated to an orchestrated flood of frightening forecasts to support their alarmist agenda.
Naturally most of them did not use carbon energy to get there.
Image credits to www.carbon-sense.com
For 23 years they have maintained these shindigs with no effect on the climate but causing great harm to many ordinary people – soaring costs for unreliable subsidised green electricity, loss of manufacturing and mining jobs, and increased food costs caused by high power prices and using food for ethanol/biodiesel.
Climate alarm is just a cover story. The glittering goal they seek is world government directed by unelected officials and funded by a global carbon tax.
What has kept these unproductive conferences alive for so long?
The money is great, the parties are fun, and the prize is power.
https://www.iceagenow.info/party-time-climateers/
An acute case of Apocalypse Fatigue Syndrome by Keith DeLacy:
https://carbon-sense.com/2017/11/17/apocalypse-fatigue-syndrome/
An Avalanche of Global Warming Alarmism:
http://dailycaller.com/2017/11/03/an-avalanche-of-global-warming-alarmism-is-about-to-hit/
Here is the First Alarming Salvo:
https://www.nytimes.com/2017/11/03/climate/us-climate-report.html
Climate Policy Is: Redistributing The World's Wealth:
https://wattsupwiththat.com/2010/11/18/ipcc-official-%E2%80%9Cclimate-policy-is-redistributing-the-worlds-wealth%E2%80%9D/
What we need to do – Drain the Canberra Swamps like they are doing in Washington:
http://thehill.com/opinion/energy-environment/360763-epas-scott-pruitt-drains-the-swamp-like-no-one-else-in-washington
Author clexit-adminPosted on November 29, 2017 Categories UncategorisedLeave a comment on Party Time for Climateers
"Zero Emissions" will Test the Convictions of Canberrans
Canberra, with its "zero emissions" target, yearns to be Australia's greenest address.
Good. Let's use them as a full-blown test of "zero emissions" before we all jump over that cliff.
Canberra passes thousands of laws for us. If their zero emissions dream is fair dinkum, they need to pass just three laws for themselves.
First, ban all petrol, diesel and gas-powered trucks, cars, boats, generators and aeroplanes from Canberra. That should remove emissions from their atmosphere, food from their supermarkets, and leave their roads free for pedestrians and bicycles. Idle airport runways would be ideal sites for solar panels and wind turbines.
Second, prohibit the importation of electricity generated by coal or gas – they can demonstrate how to survive on wind, solar, hydro, batteries and fire-wood. They should work at home using bees-wax candles on cloudy windless days.
Third, introduce a CCT (Canberra-carbon-tax) whereby all carbon dioxide emitted elsewhere in the production and transport of imported cement, steel, aluminium, bitumen, timber, vehicles, bicycles, solar panels, wind turbines, fire wood and food is charged to ACT end users.
If people flock into emissions-free Canberra we know that this is the way for Australia. But if there is a mass exodus, it will signal that the policy is a failure.
Let's test the convictions of Canberrans.
If you would like to comment, or read comments, on this article go here:
http://www.americanthinker.com/blog/2017/11/zero_emissions_will_test_the_convictions_of_canberrans_.html
Canberra's Zero Emissions Target:
http://www.smh.com.au/environment/canberras-zero-emissions-target-brought-forward-10-years-20160503-gokqnd.html
http://www.smh.com.au/act-news/act-commits-to-100-per-cent-renewable-energy-target-by-2020-simon-corbell-20160428-goh1l9.html
The Ideal Car for Canberra:
https://www.youtube.com/watch?v=vUKolh8Q9hA
Queensland will have to close perfectly good power stations to meet a 50% target:
https://aip.asn.au/wp-content/uploads/2017/11/Report_50_percent_renewables_Queensland_11_11_20.pdf
https://aip.asn.au/2017/11/implications-of-a-50-renewable-energy-policy-on-queenslands-energy-sector/
Author clexit-adminPosted on November 29, 2017 Categories UncategorisedLeave a comment on "Zero Emissions" will Test the Convictions of Canberrans
Back to Bolted-Down Industries
Once upon a time Australia was attractive to processing, refining and manufacturing industries using our abundant mineral and food resources, our reliable low-cost coal-fired electricity and a workforce trained in technical skills.
No longer.
Australia used to have 11 oil refineries, spread around the country. There are just 4 left, all over fifty years old, and all in danger of closing down. Green barriers to oil exploration have forced most of them to rely on costly imported crude oil.
We buy our jet fuel from North Asia and have just 19 days supply of aviation fuel in the country. Australia's diesel supplies sometimes fall to just 13 days of consumption.
Now, for the first time in at least 60 years Australia no longer produces motor vehicles.
China and India have about 430 coal power plants under construction but Australia has not built a single coal-fired power station for seven years – some politicians even rejoice when they manage to close and demolish one.
Brisbane's new trains are being made in India, Victa mowers are made in China and most coastal shipping died decades ago. Steel works and refineries producing aluminium, copper and zinc are under stress. All these industries are being pushed overseas by costly unreliable electricity and other government barriers and burdens.
Red-green policies being pushed by all major parties are making Australia more dependent on bolted-down industries such as mining and farming that can't be sent overseas because their basic resources are here. And green opposition to nuclear power increases Aussie reliance on coal.
A century ago Australians relied on wool, wheat, gold, silver, copper, lead-zinc, butter, beef and timber – all products of bolted-down industries.
Red-green policies are pushing us back to those days. Politicians need to remember Newton's Law of Bureaucracy – whenever the government tries to use the force of law to achieve economic goals the long term results will be equal and opposite to those intended.
So in the long run, red-green energy and environmental policies will make us more dependent on the bolted-down industries they now attack – mining, farming, forestry and fishing.
If you would like to comment on this article, or see other comments go to:
http://www.pickeringpost.com/glance/back-to-bolted-down-industries/7781
Construction of new coal-fired power plants is increasing in at least 35 countries:
https://climatism.wordpress.com/2017/09/13/world-building-new-coal-plants-faster-than-it-shuts-them/
Asia is returning to Coal:
https://thediplomat.com/2017/02/why-is-asia-returning-to-coal/
Greens Disappointed by Economic Growth:
https://wattsupwiththat.com/2017/11/14/co2-emissions-surge-greens-disappointed-by-economic-growth/
Australia's Aging oil refineries are closing:
http://theconversation.com/security-in-doubt-as-australias-aging-oil-refineries-shut-down-5553
Author clexit-adminPosted on November 29, 2017 Categories UncategorisedLeave a comment on Back to Bolted-Down Industries
Open Letter to Honorable Prime Minister of Fiji and President of COP23, Frank Bainimarama
Nils-Axel Mörner and Pamela Matlack-Klein
The community assembled at the COP23 meeting in Bonn badly wants temperature to rise according to models proposed (but never verified, rather seriously contradicted) and sea level changes that may pose serious flooding threats to low lying coasts provided sea level would suddenly start to rise at rates never recorded before (which would violate physical laws as well as accumulated scientific knowledge over centuries).
We have been in your lovely country and undertaken a detailed sea level analysis, which beyond doubts indicates that sea level is not at all in a rising mode, but has remained perfectly stable over the last 50-70 years. Hence all threats of an approaching general sea level flooding is totally unfounded.
Whatever economy, politics and project agendas may want to put in the centre, the true scientific community must insist that only facts as revealed in nature itself and in laboratory experiments can provide trustworthy results.
These are the facts:
Sea level has remained virtually at the present level over the last 200 years
In the last 50-70 years sea level has remained perfectly stable in Fiji
This stability is indicated by the growth of corals (stopped to grow vertically, and forced to grow laterally into microatolls) – and corals do not lie
Full letter, including images and chart: http://clexit.net/wp-content/uploads/2017/11/open-letter-to-frank-bainimarama-president-of-cop23.pdf [PDF, 5 MB]
Author clexit-adminPosted on November 14, 2017 Categories COP23, fiji, sea levelLeave a comment on Open Letter to Honorable Prime Minister of Fiji and President of COP23, Frank Bainimarama
Watch an Aussie Politician Squirm as Malcolm Roberts demands Evidence Climate Change is a Problem
Book: Clexit for a Brighter Future
HOW CLIMATE ALARMISTS USE RCP8.5 TO EXAGGERATE AND DECEIVE
HARNESSING THE UN'S TROJAN HORSE TO THE GREEN ZEALOT'S BANDWAGON
The Intergovernmental Panel on Climate Change: The United Nation's Trojan Horse at Work
Allen Horrell on The Battle for our Grasslands and Livestock
Neville Wright on The Virus Slowdown was Successful – but the Depressed Patient Died in Poverty
dave on The Virus Slowdown was Successful – but the Depressed Patient Died in Poverty
Dave on Open Letter from CLINTEL to World Leaders: "Fight Virus not Carbon"
Daniel Johnson on Extremes Go Down as the Deception Goes Up
Climate Extremes
Naomi Seibt
Net-zero Proposals
No Climate Emergency
CLEXIT on Facebook
Carbon Sense
The Australian Climate Sceptics
John Leal
CLEXIT – Climate Exit Proudly powered by WordPress


text:
Clemson vs Virginia (Mar 19, 2006)
Box score (NCAA)
#2 Clemson at Virginia
Mar 19, 2006 at Charlottesville, VA (UVa Baseball Stadium)
Clemson 4 (11-6,0-3 ACC)
Herman Demmink 3b........  5  0  0  0   0  2  0  1   4
Brad Chalk cf............  2  1  0  0   2  1  3  0   0
Taylor Harbin 2b.........  4  0  0  0   0  0  3  3   0
Tyler Colvin lf..........  4  1  2  2   0  1  4  0   1
Travis Storrer rf........  4  0  1  0   0  2  0  0   1
D.J. Mitchell pr/rf.....  0  0  0  0   0  0  1  0   0
Ben Hall dh..............  3  1  0  0   1  1  0  0   0
Andy D'Alessio 1b........  4  0  0  0   0  1  6  0   0
Stan Widmann ss..........  3  1  2  0   0  0  1  2   0
Marquez Smith ph........  1  0  0  0   0  1  0  0   0
Adrian Casanova c........  2  0  1  2   1  0  5  0   0
Alex Burg ph............  1  0  0  0   0  0  0  0   0
Stephen Faris p..........  0  0  0  0   0  0  0  3   0
Daniel Moskos p.........  0  0  0  0   0  0  1  0   0
Steve Richard p.........  0  0  0  0   0  0  0  0   0
Totals................... 33  4  6  4   4  9 24  9   6
Virginia 7 (19-4,4-2 ACC)
Tim Henry cf.............  5  1  2  1   0  1  1  0   0
Brandon Marsh rf.........  5  3  4  1   0  0  1  0   0
Sean Doolittle 1b........  2  0  1  0   2  1  8  1   1
David Adams 2b...........  4  1  2  1   0  0  2  1   1
Brandon Guyer lf.........  4  0  2  2   0  1  2  0   2
Tom Hagan dh.............  4  0  2  0   0  0  0  0   4
Jeremy Farrell 3b........  3  0  1  1   0  0  1  1   0
Beau Seabury c...........  3  1  0  0   0  1  9  1   2
Greg Miclat ss...........  2  1  0  0   1  1  2  4   0
Mike Ballard p...........  0  0  0  0   0  0  0  0   0
Michael Schwimer p......  0  0  0  0   0  0  1  1   0
Casey Lambert p.........  0  0  0  0   0  0  0  0   0
Clemson............. 022 000 000 -  4  6  1
Virginia............ 100 001 23X -  7 14  1
E - MITCHELL(1); FARRELL(5). DP - Clemson 3; Virginia 1. LOB - Clemson 6;
Virginia 10. 2B - WIDMANN(1); DOOLITTLE(3). 3B - MARSH(2). HR - COLVIN(5).
HBP - DOOLITTLE; GUYER; SEABURY. SH - ADAMS(2); MICLAT(2). SF - FARRELL(3).
SB - WIDMANN(4). CS - MITCHELL(1).
Stephen Faris.......  6.1  9  4  4  2  5 23 29
Daniel Moskos.......  1.1  2  2  2  1  0  5  8
Steve Richard.......  0.1  3  1  1  0  0  4  4
Virginia               IP  H  R ER BB SO AB BF
Mike Ballard........  5.2  5  4  4  3  6 23 26
Michael Schwimer....  2.0  1  0  0  1  1  6  7
Casey Lambert.......  1.1  0  0  0  0  2  4  4
Win - LAMBERT (2-1).  Loss - MOSKOS (1-3).  Save - None.
WP - FARIS 2(4). HBP - by FARIS (GUYER); by FARIS (DOOLITTLE); by MOSKOS
(SEABURY). PB - SEABURY(3).
Umpires - HP: Rick Darby  1B: Tony Maners  3B: Junior Creech
Start: 1:04   Time: 2:44   Attendance: 1879
#2 Clemson at Virginia - Play-by-Play
Clemson starters: 3/3b DEMMINK; 8/cf CHALK; 4/2b HARBIN; 21/lf COLVIN; 5/rf
STORRER; 16/dh HALL; 24/1b D'ALESSIO; 6/ss WIDMANN; 29/c CASANOVA; 20/p FARIS;
Virginia starters: 6/cf HENRY; 9/rf MARSH; 21/1b DOOLITTLE; 23/2b ADAMS; 20/lf
GUYER; 15/dh HAGAN; 17/3b FARRELL; 16/c SEABURY; 2/ss MICLAT; 18/p BALLARD;
Clemson 1st - DEMMINK struck out swinging. CHALK walked. HARBIN grounded
out to ss; CHALK advanced to second. COLVIN struck out swinging. 0 runs, 0
Virginia 1st - HENRY struck out looking. MARSH tripled to right field.
DOOLITTLE walked. ADAMS grounded out to p, SAC, bunt, RBI; DOOLITTLE advanced
to second; MARSH scored. GUYER hit by pitch. HAGAN flied out to lf. 1 run, 1
Clemson 2nd - STORRER struck out looking. HALL walked. D'ALESSIO flied
out to lf. WIDMANN singled to center field; HALL advanced to third. WIDMANN
stole second. CASANOVA singled to left center, 2 RBI; WIDMANN scored; HALL
scored. DEMMINK popped up to ss to center field. 2 runs, 2 hits, 0 errors, 1
Virginia 2nd - FARRELL singled to third base. SEABURY grounded into
double play p to 2b to 1b; FARRELL out on the play. MICLAT struck out looking.
Clemson 3rd - CHALK walked. HARBIN popped up to 2b to right field.
COLVIN homered to center field, 2 RBI; CHALK scored. STORRER grounded out to 1b
unassisted. HALL popped up to 2b to right center. 2 runs, 1 hit, 0 errors, 0
Virginia 3rd - HENRY flied out to cf. MARSH singled to center field.
MARSH advanced to second on a wild pitch. DOOLITTLE hit by pitch. ADAMS
grounded into double play ss to 2b to 1b; DOOLITTLE out on the play. 0 runs,
1 hit, 0 errors, 1 LOB.
Clemson 4th - D'ALESSIO grounded out to 2b. WIDMANN grounded out to ss.
CASANOVA reached on a fielding error by 3b. DEMMINK flied out to cf to left
center. 0 runs, 0 hits, 1 error, 1 LOB.
Virginia 4th - GUYER singled to pitcher. HAGAN singled to center field;
GUYER advanced to second. FARRELL lined out to lf to left center. SEABURY
grounded into double play 3b to 2b to 1b; HAGAN out on the play. 0 runs, 2
Clemson 5th - CHALK struck out swinging. HARBIN grounded out to ss.
COLVIN singled to center field. COLVIN advanced to second on a passed ball.
STORRER struck out swinging. 0 runs, 1 hit, 0 errors, 1 LOB.
Virginia 5th - MICLAT flied out to lf. HENRY singled to left field.
MARSH flied out to cf to right center. DOOLITTLE struck out swinging. 0
runs, 1 hit, 0 errors, 1 LOB.
Clemson 6th - HALL flied out to lf to left center. D'ALESSIO struck out
looking. WIDMANN doubled down the lf line. SCHWIMER to p for BALLARD. CASANOVA
walked. DEMMINK reached on a fielder's choice to third base; CASANOVA advanced
to second; WIDMANN out at third 3b unassisted. 0 runs, 1 hit, 0 errors, 2
Virginia 6th - ADAMS singled up the middle. GUYER struck out swinging.
HAGAN singled to left center; ADAMS advanced to third. FARRELL flied out to cf,
SF, RBI; ADAMS scored. SEABURY struck out looking. 1 run, 2 hits, 0 errors,
Clemson 7th - CHALK grounded out to 3b. HARBIN grounded out to p, bunt.
COLVIN out at first 1b to p. 0 runs, 0 hits, 0 errors, 0 LOB.
Virginia 7th - MICLAT walked. MICLAT advanced to second on a wild pitch.
HENRY grounded out to p. MARSH singled to right field, advanced to second on
the throw; MICLAT advanced to third. MOSKOS to p for FARIS. DOOLITTLE walked.
ADAMS popped up to lf. GUYER singled to right center, 2 RBI; DOOLITTLE advanced
to third; MARSH scored; MICLAT scored. HAGAN lined out to ss. 2 runs, 2
Clemson 8th - STORRER singled to left field. MITCHELL pinch ran for
STORRER. HALL struck out looking; MITCHELL out at second c to ss, caught
stealing. LAMBERT to p for SCHWIMER. D'ALESSIO grounded out to ss. 0 runs, 1
Virginia 8th - MITCHELL to rf. FARRELL flied out to rf. SEABURY hit by
pitch. MICLAT grounded out to p unassisted, SAC, bunt; SEABURY advanced to
second. HENRY singled up the middle, RBI, advanced to second on the throw;
SEABURY scored. RICHARD to p for MOSKOS. MARSH singled, RBI, scored on a
fielding error by rf; HENRY scored. DOOLITTLE doubled to center field. ADAMS
singled to shortstop; DOOLITTLE advanced to third. GUYER grounded out to ss.
3 runs, 4 hits, 1 error, 2 LOB.
Clemson 9th - M. SMITH pinch hit for WIDMANN. M. SMITH struck out
swinging. BURG pinch hit for CASANOVA. BURG flied out to rf. DEMMINK struck out
looking. 0 runs, 0 hits, 0 errors, 0 LOB.

redpajama_set_name: RedPajamaCommonCrawl


最喜爱的 scene where Felicity defends herself, while Oliver watches stunned but proud?
Who fell in 爱情 with the other first?
In my head Oliver & Felicity have a daughter, William adores his baby sister. He was actually the one to name her. These are my 最佳, 返回页首 3 name choices: William chose?
Who wants to 加入 the Stephen Amell & Emily Bett Rickards Spot?
"Felicity, before I met you, I had a plan. I had a way that I was gonna be. But then 你 walked into my life, 或者 I…showed up at your cubicle. And 你 changed everything.
I was in darkness. But with your kindness, your generosity, your compassion, your intelligence, your wit, and your trust, 你 brought me into the light. 你 let me know that I deserved it. 你 were that light.
In light of the Emmy nominations being recently announced, we here at TeamTSD decided to create our own awards celebrating sci-fi/fantasy TV. It's time to let your fandom flag fly! Place your 得票数 for the 2015 Fangs Out Awards and share with your fandom using #FangsOutAwards. May the best fandom/man/woman/vampire/werewolf/time-traveler win.
Felicity: A Fern. It thrives on the light. I thought since 你 were living here now, the place could do with a little sprucing.
Oliver: I let 你 buy me a bed.
Felicity: 你 were sleeping on the floor.
Felicity: I'm going to head out, too. I have to pull an early shift at work today, which may 或者 may not be the most depressing thing I've ever said.


Master of Evil is the groundbreaking debut EP from 1983 by Swedish H.M. legends Mindless Sinner. This official re-release includes six rare bonus demo tracks (also recorded in 1983)! These tracks are previously only available on the 2003 CD re-release by Metal For Muthas.
Limited to 100 copies on yellow tape and 200 copies on red tape. This tape version of this legendary masterpiece of Swedish heavy metal is the first time EVER that ANYTHING by Mindless Sinner is officially released on cassette!
This release has been made possible due to a collaboration with Night Crawler, who has contributed an awesome design for the release. Horns up!
Never released on tape before.


text:
Ride 24 Fans
Cédric Gracia on Building A Bike Brand in 'Getting Personal'
From a Young Kid to a Racer, a Tester and Developer.
Cédric Gracia is an MTB legend. Now, at the age of forty one and facing a completely different stage in his professional career, he looks back and talks with us from a deep-personal perspective whilst sitting on his couch.
Sit down, relax and enjoy this long interview with him. Not many times we have the chance to know a legend so personally.
His adventure on two wheels started at the age of five when he first jumped on a BMX and decided to race it.
From that precise moment and onwards, he's been living a romance with cycling, from BMX, to Road and MTB. One of his main arguments has been to always try to have fun, which has led him to where he is now – being one of the most recognized and experienced riders out there.
He could have gone the easy way and look for an easy retirement with a great contract. However, CG is not that kind of person, he's a real entrepreneur and truly believed he could still bring much more to the industry, so he accepted to join Forestal to be an active part of the project.
The knowledge he has is crucial to help develop new products that can fit in a place in the market that is yet to cover and that will unify many different riders; based on technology, weight and true essence.
His feedback on riding sensations and feelings are key, and has proven to be that kind of test rider that can work hard both on and off the bike.
Joining Forestal has been a great step and risk in his life, but for him, this step is also a privilege and an opportunity that happens once in a lifetime. In his own words he talks about how special it is to be able to be part of this, creating what may be "the thing" in the MTB industry.
sazdovski2019-11-17T12:26:32+00:00
© Copyright 2017 - 2020 Ride24mtb | Privacy Policy | About | Contact


text:
ARCHIVE You're viewing everything posted during February 2006
Bob Herbert: Rendition Program
Three cheers for torture, the new American way!
By BOB HERBERT
If you talk to Maher Arar long enough, even on the telephone, you'll get the disturbing sense that you are speaking with someone whose life has been shattered like a pane of glass.
"Sometimes I have the feeling that I want to go and live on another planet," he told me. "A completely different planet than planet Earth. You know?"
David Brooks: Port Hysteria
I tend to agree with Brooks. The hysteria is nutty. But there's no denying Bush handled this atrociously. Refreshing to see him getting battered by the right-wing harpies like Michelle and Rottweiler and their goons, who see every brown person as a terrorist.
Kicking Arabs in the Teeth
By DAVID BROOKS
It's come to my attention that many of the foreign goods we import into our country are made by foreigners who speak foreign languages and are foreign. It's come to my attention that many varieties of hummus and other vital bread schmears are made by Arabs, the group responsible for 9/11. Furthermore, it's come to my attention that the Chinese have a menacing death grip on America's pacifier, blankie, bunny and rattle supplies, and have thus established crushing domination of the entire non-pharmaceutical child sedative industry.
And so, civil war it is
There's no denying it: Iraq is on the cusp of civil war. It seems to have started already, and there's probably no way to stop it. Even the most optimistic Iraqi bloggers concede the situation is desperate, thanks to the bombing of the golden-domed Shiite shrine.
The quality of the target and the timing of the attack were chosen in a way that can possibly bring very serious consequences over the country.
The situation in Baghdad is so tense now, it wasn't like this in the early hours of the morning as it took a few hours for the news to spread but on my way back from clinic I saw pickup vehicles with loudspeakers roaming the streets calling on people to shut their stores in the name of the Hawza and join the protests after the noon prayer to condemn the attack on the holy shrine.
Remember all the promises of beacons of democracy, of peace and liberty? Remember the jubilation over the purple fingered voters? The assurances that the insurgency was "in its last throes"? Well, say goodbye to all that.
"This is as 9/11 in the United States," said Adel Abdul Mahdi, a Shiite and one of Iraq's two vice presidents.
In Baghdad, Shiite boys and men abruptly abandoned classrooms, homes and jobs to muster outside the headquarters of the influential Shiite cleric Moqtada al-Sadr in the heart of Sadr City, the slum named for the cleric's father.
"This is a day we will never forget," said Naseer Sabah, 24, who had left his job at a pastry factory without changing clothes to join the black-clad Shiite militia fighters clutching pistols, Kalashnikov assault rifles and grenade launchers outside Sadr's headquarters. Thousands converged on the Sadr offices, on foot or in buses and pickup trucks packed with armed men hanging out the windows.
"We await the orders of our preachers," teenagers around Sabah cried.
"We are the soldiers of the clerics," Shiite protesters chanted in Karrada, another of Baghdad's Shiite neighborhoods. Demonstrators there shouted a warning to their enemies: "If they are up to it, let them face us."
Other protests were reported in the predominantly Shiite cities of Najaf, Karbala, Basra and elsewhere.
Sunni political leaders said retaliatory attacks hit more than 20 Sunni mosques across Iraq with bombs, gunfire or arson. Authorities reported at least 18 people killed in the aftermath, including two Sunni clerics. In one incident, in Basra in southern Iraq, police said gunmen in police uniforms broke into a jail, seized 12 Sunni men and later killed them, according to the Reuters news agency.
Many of Baghdad's millions shuttered shops and left work early, rushing home to tense neighborhoods where gunfire rang out overnight. In one neighborhood, families lay on the floors of their houses to evade bullets as militiamen loyal to Sadr confronted Iraqi troops backed by U.S. military helicopters outside a Sunni site.
Wednesday's attack hit Samarra's Askariya shrine, also known as the Golden Mosque. The mosque holds the tombs of two revered 9th-century imams of the Shiite branch of Islam, including Hassan al-Askari, father of the "hidden imam," al-Mahdi. Many Shiites believe that Mahdi is still alive and that his reemergence one day will signal the beginning of the end of the world.
The Sunni insurgents' determined efforts to push the Shiites into an all-out civil war appear to have been sucessful. And the Shiites place equal blame for the attack on the Americans. Al Sadr's militias are mobilized, and we are the enemy, too. Sorry to sound apocalyptic, but there is nothing happy to report at the moment. The momentum has begun, it can't be turned the other way. Imagine, after 911, trying to placate Americans with words alone. This is Iraq's 911, and just as we had to invade Afghanistan, so too must the Shiites now go to war against the Sunnis. And anyone who stands in their way. Like Americans seeking to keep the peace.
Is anyone still thinking we achieved any sort of victory in Iraq? If so, what would defeat in Iraq look like? One by one, every worst-case scenario has materialized. Mission Accomplished, indeed.
48% of S. Korean youth would support NK if US attacks
This would have surprised me, if I hadn't seen a BBC special on Korea while living in Singapore on how supportive many young South Koreans are of North Korea and Dear Leader. Here's what I wrote at the time:
I just watched in astonishment a piece on the BBC on how many in South Korea believe they were brainwashed with anti-Communist propaganda, and that North Korea is a better, more fair model of government than that of the repressive Americans. They interviewed college students who, with a straight face, praise their northern divided half.
This reflects an apparently growing mindset that the American troops should leave the peninsula so reunification can be achieved.
I don't have to go into the surreal brutalities and psychoses of the DPRK. All I can say is, Be careful what you wish for — it just might come true. I can understand wanting to get foreign troops off your soil. I can't understand anyone seeing any redeeming qualities in the living, breathing hell created by Dear Leader and his goons.
Based on this new alarming article, I'd have to sadly conclude that most young South Koreans missed my earlier post.
Almost half of juniors surveyed, who will get their first voting rights in the 2007 presidential election, said in a recent poll that South Korea should side with North Korea if Washington attacks nuclear facilities in the North without Seoul's consent.
In the survey of 1,000 youngsters aged between 18 and 23, conducted by The Korea Times and its sister paper the Hankook Ilbo on Feb. 16-19, nearly 48 percent of respondents said that if the U.S. attacked nuclear facilities in North Korea, Seoul should act on Pyongyang's behalf and demand Washington stop the attack.
But 40.7 percent of them said Seoul should keep a neutral stance in the event of such attacks, while 11.6 percent said South Korea needs to act in concert with the United States.
A political expert in Seoul said that the poll results should not be interpreted as meaning young South Koreans are anti-American.
Yeah, whatever. Then again, this is the Age of Bush, and just about everybody is anti-American, and it's not very hard to understand why. Still, to think that so many in a country that's supposed to be one of our strongest allies would harbor such thoughts…. You'd think if anyone on the planet would be cognizant of the evils of Kim Jong Il it would be the South Koreans. I wondered about it when I wrote my original post, and I wonder about it now.
A complete and utter failure
No, I'm not referring to this blog, but to what our codpiece in chief refers to as our "War on Terror." This excellent article drives home just how vast our failure on the terror front actually is, and how Bush continues to lie about it, making grandiose claims of success when the reality on the ground is altogether different. One by one, it picks apart the "success stories" so loudly touted by the government's noise machine and exposes the myths. For all the noise, there are no convictions to speak of, no proof of Al Qaeda cells in America, no evidence of any benefits derived from the "War on terror."
[T]he only criminal convicted for a terrorist act since September 11 is the shoe bomber Richard Reid, captured not through any preventive initiative of the government but because an alert flight attendant noticed a strange-looking man trying to set fire to his shoe. Three people have been convicted of conspiracy to engage in terrorist conduct. Zacarias Moussaoui pleaded guilty in April 2005 to six counts of conspiracy to attack the United States—but of course he was captured not through any post–September 11 "preventive paradigm," but one month before those attacks occurred. Iyman Faris, an Ohio truck driver, allegedly an associate of Khalid Sheikh Mohammed, pleaded guilty to conspiring to bring down the Brooklyn Bridge with a single acetylene torch, a plot that raises more questions about Faris's sanity than about US national security. And Ahmed Abu Ali was convicted in November 2005 of conspiring to kill President Bush while Abu Ali was studying abroad in Saudi Arabia. The only person with whom he allegedly discussed the plot was killed by the Saudis, and Abu Ali's conviction rested solely on a confession that he claims was extracted from him by Saudi security services through torture, a practice for which they are well known….
What can be known is that the administration's tactics—a curious amalgam of outmoded thinking and dangerous new ideas—have created unprecedented levels of distrust toward US law enforcement within the Arab and Muslim communities here as well as intense anti-Americanism abroad. The administration is accurately perceived as unfairly targeting innocent Arabs and Muslims, using coercion against them preemptively and without a solid case, and disregarding fundamental principles of the rule of law and human rights. In the long run the resentment provoked by these measures is the greatest threat to our national security, and the most likely source of the next attack.
Lots of details about stories that were announced with much fanfare only to disintegrate later on. And oh, that government web site. A sea of talking points and vacuous slogans, with some slippery half-truths thrown in for good measure. Thank you very much, Karen Hughes.
Pressure on Hong Kong's Middle Class
Memories of those glorious, heady pre-1997-crash days must seem awfully sweet to many of HK's increasignly pinched middle classes. Just like memories of America before the crash of 2000 and the election of Bush shortly afterwards seem to me. It was a way of life that, in a flash, was gone with the wind, and I don't think we'll ever see anything like it again in our lifetimes. Hong Kong's middle class is still hurting, and it's not getting better anytime soon.
Hong Kong's economy might have grown by an estimated 7 percent last year and outshone many others in the region, but for insurance agent Ngai Wai-wang, that is immaterial.
Ever since the Asian economic crisis of 1997, his earnings have fallen sharply and he can only afford to eat out with his wife and two sons once a week. Exotic vacations are now just a memory in their photograph albums.
"We choose cheaper destinations in Asia now, like Thailand. My mortgage eats away half my salary, and my two sons, 12 and 14, are growing up and they need more money," said Ngai, 51.
Ngai takes home around HK$50,000 (US$6,400) a month and is a middle-income earner in Hong Kong. Unlike 40 percent of wage earners in this city who pay no income tax, he pays taxes but has not seen his wages rise appreciably since the late 1990s.
"I don't see any improvement in our lives. We have few benefits and we are taxed very heavily. The recovery is superficial and due to more Chinese tourists arriving. That's good for the retail sector. But no one else benefits," he said.
"If the economy was benefiting us, we would spend lavishly like before, but we count every penny now. The government should cut taxes. That way we consume more and that's good for society."
Hong Kong is set to announce a second straight budget surplus for the 2005/06 fiscal year on Wednesday, thanks to strong economic growth and higher asset prices.
I think about how different my own life is compared to those days in the late 1990s, when flying economy class would have been just too humiliating. The good side to the story is that after the fall, we all grew up fast, adapted to our new reality and realized we could still have our dignity and value, even if we had to sit in the back of the plane. Life may be harder, but there's still plenty to savor.
Thomas Friedman: Poor and Angry
Something "excessive" about the way Moslems reacted to the Danish cartoons? Oh, really?
Look carefully for analogies to Chinese rage against Japan. The parallels jump out at you.
Empty Pockets, Angry Minds
By THOMAS L. FRIEDMAN
I have no doubt that the Danish cartoons mocking the Prophet Muhammad have caused real offense to many Muslims. I'm glad my newspaper didn't publish them. But there is something in the worldwide Muslim reaction to these cartoons that is excessive, and suggests that something else is at work in this story. It's time we talked about it.
To understand this Danish affair, you can't just read Samuel Huntington's classic, "The Clash of Civilizations." You also need to read Karl Marx, because this explosion of Muslim rage is not just about some Western insult. It's also about an Eastern failure. It is about the failure of many Muslim countries to build economies that prepare young people for modernity — and all the insult, humiliation and frustration that has produced.
Maureen Dowd: GOP to W. – You're Nuts!
You go, girl.
G.O.P. to W.: You're Nuts!
By MAUREEN DOWD
It's enough to make you nostalgic for those gnarly union stevedores in "On the Waterfront," the ones who hung up rats on hooks and took away Marlon Brando's chance to be a contend-ah.
Maybe it's corporate racial profiling, but I don't want foreign companies, particularly ones with links to 9/11, running American ports.
What kind of empire are we if we have to outsource our coastline to a group of sheiks who don't recognize Israel, in a country where money was laundered for the 9/11 attacks? And that let A. Q. Kahn, the Pakistani nuclear scientist, smuggle nuclear components through its port to Libya, North Korea and Iran?
Google CN to replace Google.com?
Very distrubing, if true. The availability of google.com in China has been a major selling point for bloggers who say the Google arrangement with the CCP will have little to no effect on users in China. That's been a key argument Google itself has been using (see the link above) to justify its policy.
Another blogger in China writes (via CDT):
But the google.cn thing really sucks. I have noticed increasing instances in which my searches turn up dead using google.com, news.google.com, and images.google.com. It would be a total nightmare if one cannot access google.com in China, especially for journalists. True, we have Factiva and LexisNexis as a last resort, but those things cost…
I only wish Google's latest ass-kissing is only about google.cn itself — I never use it anyway, but set my IE Google Toolbar to search via Google.com. But if they reroute all China traffic to Google.cn, then I am screwed.
Any comment, Google?
Update: Rebecca looks at this issue and observes that Google is facing increasing pressure over its China Policy. Noting all the looming questions about what exactly is going on with Gogle in China, Rebecca concludes "the plot thickens."
Another look at bloggers in China
Philip Pan has done it again, offering us a mammoth overview of blogging in China and the obstacles popular bloggers face, including obstacles put up by US internet companies. It looks in detail at the story of how Anti's blog was deleted by Microsoft, and other alleged sins committed by Bill Gates' juggernaut as it sought to capture the world's most coveted market. You won't feel very warm and fuzzy toward MS after reading Pan's article. Perhaps most interesting is the reaction Pan describes of some Chinese bloggers who gushed vitriol over Anti's pleas for openness and freedom, branding him as a traitor and the greatest threat to China's future. I'm sure these same angry bloggers were in the front lines of the marches last April attacking all things Japanese.
This is a true must-read article and one you'll want to keep on hand for reference.


As a result of the recent election of Donald J. Trump to the Presidency, the area around Trump Tower in New York City has been subject to greatly increased security, including closures of streets, as well as guards and other restrictions on pedestrian access to the shopping areas around Trump Tower. Of course, this additional security has had a detrimental effect on businesses located in and around Trump Tower.
What legal recourse do these businesses have regarding their leases? This post will discuss the legal issues related to businesses and their leases in situations when access to their properties may be limited.
New York Courts have interpreted commercial leases to incorporate a warranty of habitability for the premises. The warranty of habitability means that the landlord warrants that the property is fit to be used for its intended purpose. For example, if the ceiling collapses at a store, causing the store to be closed, then the landlord is generally responsible for making the necessary repairs. Should access to a portion of the store be limited by damage caused by a fire, or other such event, the tenant may be entitled to a partial rent abatement until full access is restored.
Legally, this concept is known as partial constructive eviction. If a portion of the property being rented becomes unusable, due to physical conditions such as excessive noise, dust, flooding, or similar situations, the tenant may be entitled to a rent reduction for the period of time that the property is unusable. Of course, this may only apply to part of the property, so the rent abatement may be partial rather than total.
The tenants in and around Trump Tower may be entitled to such a rent reduction, depending on the provisions contained in their leases. They may argue that that their rental stores are unusable due to the additional extra security, that they are not able to conduct their businesses in a commercially reasonable manner, and that they may be unable to receive deliveries and other services, such as garbage collection, causing harm to their businesses. In such situations, the parties may negotiate prior to litigation to modify the lease in question through a written amendment, so that the rent reflects the new conditions. If the parties cannot agree, a court would have to determine whether the conditions being complained of caused their rental properties to be unusable for the purpose intended, and, if so, the amount of rent to be reduced.
Commercial renters may consider breaking their leases in this situation. This means that they close their stores and go out of business, or move to another location. Whether they are allowed to do this legally also depends on the specific language in their leases. Future rent may be due even if the tenant vacates the premises. A landlord may bring an action for unpaid rent if they are unable to re-rent the premises within a reasonable amount of time. Any entity considering this course of action should have legal counsel review their lease to determine their rights and responsibilities. In some situations, the landlord may have required that an individual personally guarantee the lease obligations. This means that if a lawsuit is brought for unpaid rent, that the individual may be legally liable.
Whether your store is located near Trump Tower or elsewhere in the New York area, our firm has extensive experience representing parties with commercial leases and welcomes all inquiries in this area.


text:
Q: Select query in spring hibernate in spring mvc Hi i am writing an spring mvc, employee application using mysql database,hibernate annotations and jsp . The database contains one table "Empdata" where empid is primary key.And there is a column "team" in "Empdata".I want to select employees in a specific team, example all the details of employees in "Team1".Here i can perform delete and edit operations in the application. For delete operation i am using

sessionfactory.getCurrentSession().createQuery("DELETE FROM Resource WHERE empid=" +resource.getEmpId()).executeUpdate();

query.I know the command line query for select is

SELECT * FROM  EmpData WHERE EMPLTEAM ="Team1"

I want to know how to convert this query into hibernate?
please help,thanks in advance..

A: Query query = session.createQuery("from Resource where emplteam = :team");
query.setParameter("team", "Team1");
List list = query.list();

emplteam should be the property of your class Resource , not your database column's name.

A: I guess it is simple using HQL .
String hql = "FROM Resource E WHERE E.emplteam = team1";
Query query = session.createQuery(hql);
List results = query.list();

Hope this helps
Note: Keywords like SELECT , FROM and WHERE etc. are not case sensitive but properties like table and column names are case sensitive in HQL.

A: have you tried using criteria api?
Criteria crit = sessionFactory.getCurrentSession()
   .createCriteria(EmpData.class).add(Restrictions.eq("EMPLTEAM", "teamxxx");

List<EmpData> result = crit.list();

A: For example
Query query = session.createQuery("from Student where name=:name");
query.setParameter("name", "Raj");

In your case i guess the Entity name is Empdata(The object that represent the table)
And the field in the object is team(That has getter and setter in object)
Query query = session.createQuery("from Empdata where team=:teamParam");
query.setParameter("teamParam", "team1");

redpajama_set_name: RedPajamaStackExchange


text:
Q: Syntax: Using case or if-then-else for t-SQL alias setting? I'm using t-SQL for reporting and had a question regarding syntax. I just started learning some of the more intermediate SQL stuff, like joins, aliases, case statements, order by, etc.
I have a table that I need to pull person data from. When pulling data I need to pull every person associated and sort through the list of people based on attributes. Then I want to store the person data in two variables (aliases). One person has attribute 'Applicant' and their information should be aliased and stored separately from everyone else's. Everyone else should be stored in a single list. Is there a good way to do this in SQL? Here's what I was thinking in pseudocode
select * from persontable
if persontable.TYPE = 'Applicant' then persontable.name as applName, persontable.otherAtt as applOtherAtt --etc
else persontable.name --add to a list and alias as otherNames

or something like this
case when persontable.TYPE = 'Applicant'then persontable.name as applName, persontable.otherAtt as applOtherAtt --etc
else persontable.name --add to a list and alias as otherNames

A: Marking as answered, looked up the difference between variables and aliases and was provided with a link to some easily followable if-then-else logic.


Those are the guiding principles of the hub. Inherently curious about the world around us, and by nature collaborative, sharing what we know is second nature to us. It's just how we roll. We've always been generous with our contacts too; we love connecting people to make something positive happen. And along the way we've met others who think like us, and are generous with who and what they know too.
Joining the Dots, our latest hub lab project, is based on two premises: firstly, that we need new models if we are all going to make a living out of the music we love, and secondly, that we'd all be a bit smarter if we shared with each other what we know.
We all – each and every one of us – know something someone else would find useful – so how much cleverer would we all be if we shared a bit more?
That's got us thinking about how great it would be to help kickstart 'a community of the curious and the generous', a gang of like-minded people in the creative sector who commit to sharing what they know. A knowledge and experience bank if you like, where all the shareholders are community members, and the capital being traded is collective knowledge and experience, shared for our own individual benefit and for the greater good.
Follow our lead, join the community, share what you know and find useful.
We've made a start. Through Joining the Dots we're producing events, webinars and online content that we're sharing via our website. We've built a new community resources section on our the site too, that's open to all. And we're busy calling in favours, asking friends and colleagues to contribute things they've written or podcasts or presentations they've made, or to put something new together. Meanwhile, we're doing all we can to share this content as widely as possible – via our own social media and community email list, community members and other colleagues.
We'd love you to get involved too – share something that you think other would find useful. Maybe you want to recommend a brilliant TED talk, podcast or book? Or maybe you've done some audience research you think other people could learn from? In either case, drop us a line at hello@thehubuk.com if you want to chat.
Or simply join up now, and share later!
Finally, there is one other thing you could do if you like the sound of all this. We'd absolutely love it if you would tell your friends about it! Especially if they're curious and generous too.


text:
Q: Hierarchy query based on two tables, In my oracle 11g database, I have two tables. The first, accitem, holds item information and the second, acchart holds chart information. Every row in table accitem is unique. There are no repetitions. In the other table, acchart item_type refers to a foreign key in the acchart table. It looks like so:
Accitem
ID         Details
BS         Balance sheet
PL         Profit & loss

acchart

item_code    item_description       item_type
INC          Income                  PL
EXP          Expenses                PL
Ass          Assets                  BS
Eqt          Equity                  BS

What I want to achieve is as follows:
Balance Sheet
    + Assets
    + Equity

Profit & Loss
   + Income
   + Expenses

How would you achieve that?

A: You can indeed use connect by:
select decode(level, 2, ' + ', '')||q.name from
(
select ID, Details name, null parent_id
from accitem
UNION ALL
select null ID, item_description name, item_type parent_id
from acchart
) q
start with parent_id is null
connect by prior id = parent_id

Its performance is questionable on larger datasets though.


Many of you have been asking the question: why is the cast of CSI Cyber taking the stage this year? Why are they keynoting over someone more ingrained in the industry?
As we celebrate our 25-year anniversary, the melding of cybersecurity and pop culture has never been more prevalent. Movies, television and books focus on online activity ranging from credit theft to cyber espionage, and few things are more in the public eye than the CSI family of television shows. With a cybercrime edition now on a top-rated network, RSA Conference saw the opportunity to bring two audiences together: Hollywood and the security industry.
While the show may not be technically accurate, it does introduce our profession to new league of people—and more importantly to a new generation of potential cybersecurity professionals. The number of cybersecurity job openings continues to outpace those entering the industry, and if pop culture can help bring awareness to the industry and spark interest in the next generation to learn more, we welcome that discussion and recognize its value.
Now, let's clear something up—no member of the cast is giving a keynote presentation. This is an unconventional group of speakers, and as such it will have a less conventional format. On Thursday March 3, I am hosting a Q&A with two stars of the show and one of its producers to find out how they research and determine the show's plot and cybersecurity's role in it, how they feel about any industry criticism and what they hope to accomplish for the average viewer who may not be familiar with the nuts and bolts of infosecurity.
As you know, over the years we've had several keynote speakers who are not cyber experts—Malcolm Gladwell, Doris Kearns Goodwin, Diana Nyad and Zak Ebrahim, for example. While not security experts, their talks have provided inspiration to our audiences. And furthermore, the talks have challenged us all to think differently, persevere despite adversity or change our perspectives. That is intentional.
One of the great things about RSA Conference is that it brings together a diverse group of people who are all connected through their interest in cybersecurity. We hope to provide all conference attendees the opportunity to learn through the robust programming schedule and insightful dialogue it creates.
This document was retrieved from http://www.rsaconference.com/blogs/expanding-the-reach-of-rsa-conference	on Sun, 21 Apr 2019 08:16:36 -0400.


Imaging USA: Do it, and do it right.
Over 10,000 photographers will be heading to Atlanta in couple weeks for Imaging USA, the annual convention and trade show for the Professional Photographers of America. The core event is Sunday through Tuesday, with several pre-convention workshops and meetings happening in advance.
Use this opportunity to connect with people. Interested in meeting someone you've only "known" online? Reach out ahead of time and make plans to meet for a chat, a coffee, or a drink. Remember that not all connections have to be directly related to photography. A couple times I've organized a craft beer meetup for folks at Imaging. We chatted about beer. And photography.
Introverts can do the big conference thing too! I've previously written an article about being an introvert at conferences. Check it out.
I'm always interested in meeting Tech Photo Guy readers or other photographers. I'd love to say hi at Imaging this year. drop me an email and let's connect.
Do you have other Imaging USA tips? Leave a comment below!


text:
Students Given Opportunity to Pay Rent Through Facebook
By Jessica Fiur
NationalNewsOperations & TechnologyStudent Housing
Campus Apartments now allows residents to pay rent on its online account portal SmartClick via Facebook Connect.
By Jessica Fiur, News Editor
Philadelphia—Now students have another reason to be on social media: Campus Apartments, a privately held student housing company, now allows residents to pay rent on its online account portal SmartClick via Facebook Connect.
According to John Ailor, senior director of Web technology, Campus Apartments, all Campus Apartments residents have access to SmartClick when they sign their lease, and they can then connect it to their Facebook accounts, making it easier to pay rent and make service requests.
In addition, residents can set up their accounts so that multiple people have access, so whoever is responsible for paying rent can do it from their own computer.
"The minute you're set up, you can set up other people who will have access to that account," Ailor tells MHN. "They'll have their own user name and password. So if your parent is paying your rent, you can set them up right away, so that they can pay your rent for you."
The accounts can be paid every month by credit card or by direct deposit.
"We get a pretty good percentage of people using the direct debit, but we still get a lot of people who take a check into the office," Ailor says. "As a company, the less of that, the better."
Though some people still use the old fashioned method to pay their rent, Ailor predicts that more and more residents will start to pay via social media.
"It's a whole lot better for everybody," he says. "We see in our population, Facebook is everywhere—everybody has it. We also do a lot with Twitter, but frankly it's nothing compared to Facebook. But we will soon make it so you can connect with your Smartclick account to Twitter, Facebook and Google+, and any other social media that comes around. But we started with Facebook because it's just universal."


Adam Dixon will be the new captain of the Great Britain and England hockey teams with David Ames selected as vice captain by Danny Kerry.
They will be joined in the team's leadership group by George Pinner, Phil Roper and Jack Waller.
Head Coach Danny Kerry commented, "Following the great work post-Rio by the captaincy group of Phil Roper, George Pinner and Ian Sloan we have worked with the athlete and staff group to think about what leadership we need moving forward.
Dixon said of the honour: "I'm obviously delighted to be given the opportunity to captain my country. With it there obviously comes a huge amount of responsibility and I feel that at I am at the stage in my career where I can give my all to the captaincy and continue to try give my best performances on the field.
"I don't take this challenge lightly and there's certainly going to be times when the team and myself are tested to our limits over the coming months. However, I feel the squad is in a good position to tackle these challenges head on.
Vice Captain Ames, 29, hails from Cookstown, Northern Ireland, and has been part of the GB programme since 2015, having previously played for Ireland. In that time he has played in the Olympics, European Championships and World Cup.


Searching for a new loan for home remodeling, debt consolidation or a future vacation. You can quickly apply for a new loan in Minnesota using our easy to use loan platform. We have been connecting borrowers with signature loans (no collateral personal loans) for over seven years. We make it easy to find and compare new personal loans. Borrowers in St Paul, Minneapolis, Duluth, Rochester can review loans from $1000 to $50,000 or more online. Lenders work with borrowers from every credit background, from excellent credit, to bruised and poor credit backgrounds. You can typically find lenders offering loans from a few months up to five years for repayment. Count on Signature Loans Network for your next online loan today.
Lenders in Minnesota can help you find the right loan for your unique situation. Whether you live in the Twin Cities area or your a medical student doing your first internship at the Mayo Clinic in Rochester, our team has a single focus, helping bring you the best options to compare and review for your unique situation. Finding the right loan offer can feel overwhelming. Our goal is to help streamline the process and make it easier to find and review options from local and national lenders to help you get the money you need. If you are just getting started, it's a great idea to make sure you have a budget in mind and understand that additional debt, if not constructed in a positive way could have a negative impact on your credit profile.
We found your website online and it was super easy to get a new loan. Our credit score was super low and even with bad credit we were able to find a lender to offer us a new loan for over $5000. Thank you for helping us to consolidate some bills.
Finding a new loan was easy. I never imagined that comparing personal loans would be so simple or we would have refinanced our credit card bills many years ago. Thank you for posting great tips and making the process super easy!
Your credit history is a factor in almost all of your life and financial decisions. Shopping for a new car, home or personal loan is no different. The good thing sis that for borrowers with bruised histories, there are now options when you may need an online short-term loan to get the quick cash to cover these expenses. If you are unable to use a credit card or borrow money from another source, then sometimes an online short-term loan is the only option. Whether the loan you need is a quick unsecured loan, installment loan or personal loan, including peer to peer offers then we have the right options for your finance needs. Our nationwide network of top lenders helps consumers who need to borrow between $500 and $40,000 online.
Whatever your needs for finance are, count on the team of editors from the Minnesota signature loan network are committed to helping to bring you the latest offers and options, from Signature loan lenders, installment loans and social lending, we will be covering a variety of short term lending topics and sometimes will even try to discover credit card and other relevant finance topics of interest for your benefit. Finding the right loan can mean the difference in making your life less stress free. Borrowers who have time and great credit are encouraged to work with banks or credit unions when possible, for the lowest rates and fees. Everyone who works at SLN and our lending partners recognize that every borrowers qualifications will be unique to them, we often recommend borrowers with less than ideal credit histories, take proactive measures including credit counseling, debt counselors, financial planners, retirement advisors in order to make sure that they are continuing to make good financial decisions, and have a plan in place to repay their loans in a timely fashion.


text:
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/offline_pages/background_loader_offliner.h"

#include <memory>
#include <utility>
#include <vector>

#include "base/bind.h"
#include "base/command_line.h"
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/scoped_mock_time_message_loop_task_runner.h"
#include "base/threading/thread_task_runner_handle.h"
#include "chrome/browser/offline_pages/offliner_helper.h"
#include "chrome/browser/prefetch/prefetch_prefs.h"
#include "chrome/common/pref_names.h"
#include "chrome/test/base/testing_profile.h"
#include "components/content_settings/core/browser/cookie_settings.h"
#include "components/content_settings/core/common/pref_names.h"
#include "components/offline_pages/content/background_loader/background_loader_contents_stub.h"
#include "components/offline_pages/core/background/load_termination_listener.h"
#include "components/offline_pages/core/background/offliner.h"
#include "components/offline_pages/core/background/offliner_policy.h"
#include "components/offline_pages/core/background/save_page_request.h"
#include "components/offline_pages/core/offline_page_feature.h"
#include "components/offline_pages/core/stub_offline_page_model.h"
#include "components/prefs/pref_service.h"
#include "components/security_state/core/security_state.h"
#include "content/public/browser/mhtml_extra_parts.h"
#include "content/public/browser/web_contents.h"
#include "content/public/test/browser_task_environment.h"
#include "content/public/test/mock_navigation_handle.h"
#include "content/public/test/test_renderer_host.h"
#include "content/public/test/web_contents_tester.h"
#include "net/base/net_errors.h"
#include "net/http/http_response_headers.h"
#include "net/test/cert_test_util.h"
#include "net/test/test_data_directory.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace {
char kShortSnapshotDelayForTest[] =
    "short-offline-page-snapshot-delay-for-test";
}  // namespace

namespace offline_pages {

namespace {

using security_state::VisibleSecurityState;

constexpr int64_t kRequestId = 7;
const ClientId kClientId("async_loading", "88");
constexpr bool kUserRequested = true;
constexpr char kRequestOrigin[] = "abc.xyz";
constexpr char kHttpUrl[] = "http://www.tunafish.com";

class TestLoadTerminationListener : public LoadTerminationListener {
 public:
  TestLoadTerminationListener() = default;

  TestLoadTerminationListener(const TestLoadTerminationListener&) = delete;
  TestLoadTerminationListener& operator=(const TestLoadTerminationListener&) =
      delete;

  ~TestLoadTerminationListener() override = default;

  void TerminateLoad() { offliner()->TerminateLoadIfInProgress(); }

  Offliner* offliner() { return offliner_; }
};

// Mock OfflinePageModel for testing the SavePage calls
class MockOfflinePageModel : public StubOfflinePageModel {
 public:
  MockOfflinePageModel() : mock_saving_(false), mock_deleting_(false) {}

  MockOfflinePageModel(const MockOfflinePageModel&) = delete;
  MockOfflinePageModel& operator=(const MockOfflinePageModel&) = delete;

  ~MockOfflinePageModel() override {}

  void SavePage(const SavePageParams& save_page_params,
                std::unique_ptr<OfflinePageArchiver> archiver,
                content::WebContents* web_contents,
                SavePageCallback callback) override {
    mock_saving_ = true;
    save_page_callback_ = std::move(callback);
    save_page_params_ = save_page_params;
  }

  void CompleteSavingAsArchiveCreationFailed() {
    DCHECK(mock_saving_);
    mock_saving_ = false;
    base::ThreadTaskRunnerHandle::Get()->PostTask(
        FROM_HERE, base::BindOnce(std::move(save_page_callback_),
                                  SavePageResult::ARCHIVE_CREATION_FAILED, 0));
  }

  void CompleteSavingAsSuccess() {
    DCHECK(mock_saving_);
    mock_saving_ = false;
    base::ThreadTaskRunnerHandle::Get()->PostTask(
        FROM_HERE, base::BindOnce(std::move(save_page_callback_),
                                  SavePageResult::SUCCESS, 123456));
  }

  void CompleteSavingAsAlreadyExists() {
    DCHECK(mock_saving_);
    mock_saving_ = false;
    base::ThreadTaskRunnerHandle::Get()->PostTask(
        FROM_HERE, base::BindOnce(std::move(save_page_callback_),
                                  SavePageResult::ALREADY_EXISTS, 123456));
  }

  void DeletePagesWithCriteria(const PageCriteria& criteria,
                               DeletePageCallback callback) override {
    mock_deleting_ = true;
    std::move(callback).Run(DeletePageResult::SUCCESS);
  }

  bool mock_saving() const { return mock_saving_; }
  bool mock_deleting() const { return mock_deleting_; }
  SavePageParams& save_page_params() { return save_page_params_; }

 private:
  bool mock_saving_;
  bool mock_deleting_;
  SavePageCallback save_page_callback_;
  SavePageParams save_page_params_;
};

}  // namespace

// A BackgroundLoader that we can run tests on.
// Overrides the ResetState so we don't actually try to create any web contents.
// This is a temporary solution to test core BackgroundLoaderOffliner
// functionality until we straighten out assumptions made by RequestCoordinator
// so that the ResetState method is no longer needed.
class TestBackgroundLoaderOffliner : public BackgroundLoaderOffliner {
 public:
  explicit TestBackgroundLoaderOffliner(
      content::BrowserContext* browser_context,
      const OfflinerPolicy* policy,
      OfflinePageModel* offline_page_model,
      std::unique_ptr<LoadTerminationListener> load_termination_listener);
  ~TestBackgroundLoaderOffliner() override;
  content::WebContentsTester* web_contents_tester() {
    return content::WebContentsTester::For(stub_->web_contents());
  }

  content::WebContents* web_contents() { return stub_->web_contents(); }
  background_loader::BackgroundLoaderContents* stub() { return stub_; }

  bool is_loading() { return loader_ && stub_->is_loading(); }

  void set_custom_visible_security_state(
      std::unique_ptr<VisibleSecurityState> visible_security_state) {
    custom_visible_security_state_ = std::move(visible_security_state);
  }
  void set_page_type(content::PageType page_type) { page_type_ = page_type; }

 private:
  // BackgroundLoaderOffliner overrides.
  void ResetLoader() override;
  std::unique_ptr<VisibleSecurityState> GetVisibleSecurityState(
      content::WebContents* web_contents) override;
  content::PageType GetPageType(content::WebContents* web_contents) override;

  raw_ptr<background_loader::BackgroundLoaderContentsStub> stub_;
  std::unique_ptr<VisibleSecurityState> custom_visible_security_state_;
  content::PageType page_type_ = content::PageType::PAGE_TYPE_NORMAL;
};

TestBackgroundLoaderOffliner::TestBackgroundLoaderOffliner(
    content::BrowserContext* browser_context,
    const OfflinerPolicy* policy,
    OfflinePageModel* offline_page_model,
    std::unique_ptr<LoadTerminationListener> load_termination_listener)
    : BackgroundLoaderOffliner(browser_context,
                               policy,
                               offline_page_model,
                               std::move(load_termination_listener)) {}

TestBackgroundLoaderOffliner::~TestBackgroundLoaderOffliner() {}

void TestBackgroundLoaderOffliner::ResetLoader() {
  stub_ = new background_loader::BackgroundLoaderContentsStub(browser_context_);
  loader_.reset(stub_);
  loader_->SetDelegate(this);
}

std::unique_ptr<VisibleSecurityState>
TestBackgroundLoaderOffliner::GetVisibleSecurityState(
    content::WebContents* web_contents) {
  if (custom_visible_security_state_)
    return std::move(custom_visible_security_state_);
  return BackgroundLoaderOffliner::GetVisibleSecurityState(web_contents);
}

content::PageType TestBackgroundLoaderOffliner::GetPageType(
    content::WebContents* web_contents) {
  return page_type_;
}

class BackgroundLoaderOfflinerTest : public testing::Test {
 public:
  BackgroundLoaderOfflinerTest();

  BackgroundLoaderOfflinerTest(const BackgroundLoaderOfflinerTest&) = delete;
  BackgroundLoaderOfflinerTest& operator=(const BackgroundLoaderOfflinerTest&) =
      delete;

  ~BackgroundLoaderOfflinerTest() override;

  void SetUp() override;

  TestBackgroundLoaderOffliner* offliner() const { return offliner_.get(); }
  Offliner::CompletionCallback completion_callback() {
    return base::BindOnce(&BackgroundLoaderOfflinerTest::OnCompletion,
                          base::Unretained(this));
  }
  Offliner::ProgressCallback const progress_callback() {
    return base::BindRepeating(&BackgroundLoaderOfflinerTest::OnProgress,
                               base::Unretained(this));
  }
  Offliner::CancelCallback cancel_callback() {
    return base::BindOnce(&BackgroundLoaderOfflinerTest::OnCancel,
                          base::Unretained(this));
  }
  base::OnceCallback<void(bool)> can_download_callback() {
    return base::BindOnce(&BackgroundLoaderOfflinerTest::OnCanDownload,
                          base::Unretained(this));
  }
  Profile* profile() { return &profile_; }
  bool completion_callback_called() { return completion_callback_called_; }
  Offliner::RequestStatus request_status() { return request_status_; }
  bool cancel_callback_called() { return cancel_callback_called_; }
  bool can_download_callback_called() { return can_download_callback_called_; }
  bool can_download() { return can_download_; }
  bool SaveInProgress() const { return model_->mock_saving(); }
  bool DeleteCalled() const { return model_->mock_deleting(); }
  MockOfflinePageModel* model() const { return model_; }
  const base::HistogramTester& histograms() const { return histogram_tester_; }
  int64_t progress() { return progress_; }
  OfflinerPolicy* policy() const { return policy_.get(); }
  TestLoadTerminationListener* load_termination_listener() {
    return load_termination_listener_;
  }

  void PumpLoop() { base::RunLoop().RunUntilIdle(); }

  void CompleteLoading() {
    // Reset snapshot controller.
    auto snapshot_controller = std::make_unique<BackgroundSnapshotController>(
        base::ThreadTaskRunnerHandle::Get(), offliner_.get(),
        false /* RenovationsEnabled */);
    offliner_->SetBackgroundSnapshotControllerForTest(
        std::move(snapshot_controller));
    // Call complete loading.
    auto* main_frame = offliner()->web_contents()->GetMainFrame();
    offliner()->DocumentAvailableInMainFrame(main_frame);
    offliner()->DocumentOnLoadCompletedInMainFrame(main_frame);
    PumpLoop();
  }

  offline_pages::RequestStats* GetRequestStats() {
    return offliner_->GetRequestStatsForTest();
  }

  std::unique_ptr<VisibleSecurityState> BaseVisibleSecurityState() {
    auto visible_security_state = std::make_unique<VisibleSecurityState>();
    visible_security_state->connection_info_initialized = true;
    visible_security_state->url = GURL("https://www.yellowtail.com");
    visible_security_state->certificate =
        net::ImportCertFromFile(net::GetTestCertsDirectory(), "sha1_2016.pem");
    visible_security_state->cert_status =
        net::CERT_STATUS_SHA1_SIGNATURE_PRESENT;
    return visible_security_state;
  }

 private:
  void OnCompletion(const SavePageRequest& request,
                    Offliner::RequestStatus status);
  void OnProgress(const SavePageRequest& request, int64_t bytes);
  void OnCancel(const SavePageRequest& request);
  void OnCanDownload(bool allowed);
  content::BrowserTaskEnvironment task_environment_;
  content::RenderViewHostTestEnabler rvhte_;
  TestingProfile profile_;
  std::unique_ptr<OfflinerPolicy> policy_;
  raw_ptr<TestLoadTerminationListener> load_termination_listener_;
  std::unique_ptr<TestBackgroundLoaderOffliner> offliner_;
  raw_ptr<MockOfflinePageModel> model_;
  bool completion_callback_called_;
  bool cancel_callback_called_;
  bool can_download_callback_called_;
  bool can_download_;
  int64_t progress_;
  Offliner::RequestStatus request_status_;
  base::HistogramTester histogram_tester_;
};

BackgroundLoaderOfflinerTest::BackgroundLoaderOfflinerTest()
    : task_environment_(content::BrowserTaskEnvironment::IO_MAINLOOP),
      load_termination_listener_(nullptr),
      model_(nullptr),
      completion_callback_called_(false),
      cancel_callback_called_(false),
      can_download_callback_called_(false),
      can_download_(false),
      progress_(0LL),
      request_status_(Offliner::RequestStatus::UNKNOWN) {}

BackgroundLoaderOfflinerTest::~BackgroundLoaderOfflinerTest() {}

void BackgroundLoaderOfflinerTest::SetUp() {
  // Set the snapshot controller delay command line switch to short delays.
  base::CommandLine* cl = base::CommandLine::ForCurrentProcess();
  cl->AppendSwitch(kShortSnapshotDelayForTest);

  std::unique_ptr<TestLoadTerminationListener> listener =
      std::make_unique<TestLoadTerminationListener>();
  load_termination_listener_ = listener.get();
  model_ = new MockOfflinePageModel();
  policy_ = std::make_unique<OfflinerPolicy>();
  offliner_ = std::make_unique<TestBackgroundLoaderOffliner>(
      profile(), policy_.get(), model_, std::move(listener));
}

void BackgroundLoaderOfflinerTest::OnCompletion(
    const SavePageRequest& request,
    Offliner::RequestStatus status) {
  DCHECK(!completion_callback_called_);  // Expect 1 callback per request.
  completion_callback_called_ = true;
  request_status_ = status;
}

void BackgroundLoaderOfflinerTest::OnProgress(const SavePageRequest& request,
                                              int64_t bytes) {
  progress_ = bytes;
}

void BackgroundLoaderOfflinerTest::OnCancel(const SavePageRequest& request) {
  DCHECK(!cancel_callback_called_);
  cancel_callback_called_ = true;
}

void BackgroundLoaderOfflinerTest::OnCanDownload(bool allowed) {
  can_download_callback_called_ = true;
  can_download_ = allowed;
}

TEST_F(BackgroundLoaderOfflinerTest, LoadTerminationListenerSetup) {
  // Verify that back pointer to offliner is set up in the listener.
  Offliner* base_offliner = offliner();
  EXPECT_NE(base_offliner, nullptr);
  EXPECT_EQ(base_offliner, load_termination_listener()->offliner());
}

TEST_F(BackgroundLoaderOfflinerTest,
       LoadAndSaveBlockThirdPartyCookiesForCustomTabs) {
  base::Time creation_time = base::Time::Now();
  ClientId custom_tabs_client_id("custom_tabs", "88");
  SavePageRequest request(kRequestId, GURL(kHttpUrl), custom_tabs_client_id,
                          creation_time, kUserRequested);

  profile()->GetPrefs()->SetInteger(
      prefs::kCookieControlsMode,
      static_cast<int>(content_settings::CookieControlsMode::kBlockThirdParty));
  EXPECT_FALSE(offliner()->LoadAndSave(request, completion_callback(),
                                       progress_callback()));
}

TEST_F(BackgroundLoaderOfflinerTest,
       LoadAndSaveNetworkPredictionDisabledForCustomTabs) {
  base::Time creation_time = base::Time::Now();
  ClientId custom_tabs_client_id("custom_tabs", "88");
  SavePageRequest request(kRequestId, GURL(kHttpUrl), custom_tabs_client_id,
                          creation_time, kUserRequested);

  prefetch::SetPreloadPagesState(profile()->GetPrefs(),
                                 prefetch::PreloadPagesState::kNoPreloading);
  EXPECT_FALSE(offliner()->LoadAndSave(request, completion_callback(),
                                       progress_callback()));
}

TEST_F(BackgroundLoaderOfflinerTest, LoadAndSaveStartsLoading) {
  base::Time creation_time = base::Time::Now();
  SavePageRequest request(kRequestId, GURL(kHttpUrl), kClientId, creation_time,
                          kUserRequested);
  EXPECT_TRUE(offliner()->LoadAndSave(request, completion_callback(),
                                      progress_callback()));
  EXPECT_TRUE(offliner()->is_loading());
  EXPECT_FALSE(SaveInProgress());
  EXPECT_FALSE(completion_callback_called());
  EXPECT_EQ(Offliner::RequestStatus::UNKNOWN, request_status());
}

TEST_F(BackgroundLoaderOfflinerTest, BytesReportedWillUpdateProgress) {
  base::Time creation_time = base::Time::Now();
  SavePageRequest request(kRequestId, GURL(kHttpUrl), kClientId, creation_time,
                          kUserRequested);
  EXPECT_TRUE(offliner()->LoadAndSave(request, completion_callback(),
                                      progress_callback()));
  offliner()->OnNetworkBytesChanged(5LL);
  EXPECT_EQ(progress(), 5LL);
  offliner()->OnNetworkBytesChanged(10LL);
  EXPECT_EQ(progress(), 15LL);
}

TEST_F(BackgroundLoaderOfflinerTest, CompleteLoadingInitiatesSave) {
  base::Time creation_time = base::Time::Now();
  SavePageRequest request(kRequestId, GURL(kHttpUrl), kClientId, creation_time,
                          kUserRequested);
  request.set_request_origin(kRequestOrigin);
  EXPECT_TRUE(offliner()->LoadAndSave(request, completion_callback(),
                                      progress_callback()));
  CompleteLoading();
  PumpLoop();
  // Verify that request origin is propagated.
  EXPECT_EQ(kRequestOrigin, model()->save_page_params().request_origin);
  EXPECT_FALSE(completion_callback_called());
  EXPECT_TRUE(SaveInProgress());
  EXPECT_EQ(Offliner::RequestStatus::UNKNOWN, request_status());
}

TEST_F(BackgroundLoaderOfflinerTest, CancelWhenLoading) {
  base::Time creation_time = base::Time::Now();
  SavePageRequest request(kRequestId, GURL(kHttpUrl), kClientId, creation_time,
                          kUserRequested);
  EXPECT_TRUE(offliner()->LoadAndSave(request, completion_callback(),
                                      progress_callback()));
  offliner()->Cancel(cancel_callback());
  PumpLoop();
  offliner()->OnNetworkBytesChanged(15LL);
  EXPECT_TRUE(cancel_callback_called());
  EXPECT_FALSE(completion_callback_called());
  EXPECT_FALSE(offliner()->is_loading());  // Offliner reset.
  EXPECT_EQ(progress(), 0LL);  // network bytes not recorded when not busy.
}

TEST_F(BackgroundLoaderOfflinerTest, CancelWhenLoadTerminated) {
  base::Time creation_time = base::Time::Now();
  SavePageRequest request(kRequestId, GURL(kHttpUrl), kClientId, creation_time,
                          kUserRequested);
  EXPECT_TRUE(offliner()->LoadAndSave(request, completion_callback(),
                                      progress_callback()));
  load_termination_listener()->TerminateLoad();
  PumpLoop();
  EXPECT_TRUE(completion_callback_called());
  EXPECT_FALSE(offliner()->is_loading());  // Offliner reset.
  EXPECT_EQ(Offliner::RequestStatus::FOREGROUND_CANCELED, request_status());
}

TEST_F(BackgroundLoaderOfflinerTest, CancelWhenLoaded) {
  base::Time creation_time = base::Time::Now();
  SavePageRequest request(kRequestId, GURL(kHttpUrl), kClientId, creation_time,
                          kUserRequested);
  EXPECT_TRUE(offliner()->LoadAndSave(request, completion_callback(),
                                      progress_callback()));
  CompleteLoading();
  PumpLoop();
  offliner()->Cancel(cancel_callback());
  PumpLoop();

  // Subsequent save callback cause no crash.
  model()->CompleteSavingAsArchiveCreationFailed();
  PumpLoop();
  EXPECT_TRUE(cancel_callback_called());
  EXPECT_TRUE(DeleteCalled());
  EXPECT_FALSE(completion_callback_called());
  EXPECT_FALSE(SaveInProgress());
  EXPECT_FALSE(offliner()->is_loading());  // Offliner reset.
}

TEST_F(BackgroundLoaderOfflinerTest, LoadedButSaveFails) {
  base::Time creation_time = base::Time::Now();
  SavePageRequest request(kRequestId, GURL(kHttpUrl), kClientId, creation_time,
                          kUserRequested);
  EXPECT_TRUE(offliner()->LoadAndSave(request, completion_callback(),
                                      progress_callback()));

  CompleteLoading();
  PumpLoop();
  model()->CompleteSavingAsArchiveCreationFailed();
  PumpLoop();

  EXPECT_TRUE(completion_callback_called());
  EXPECT_EQ(Offliner::RequestStatus::SAVE_FAILED, request_status());
  EXPECT_FALSE(offliner()->is_loading());
  EXPECT_FALSE(SaveInProgress());
}

TEST_F(BackgroundLoaderOfflinerTest, ProgressDoesNotUpdateDuringSave) {
  base::Time creation_time = base::Time::Now();
  SavePageRequest request(kRequestId, GURL(kHttpUrl), kClientId, creation_time,
                          kUserRequested);
  EXPECT_TRUE(offliner()->LoadAndSave(request, completion_callback(),
                                      progress_callback()));
  offliner()->OnNetworkBytesChanged(10LL);
  CompleteLoading();
  PumpLoop();
  offliner()->OnNetworkBytesChanged(15LL);
  EXPECT_EQ(progress(), 10LL);
}

TEST_F(BackgroundLoaderOfflinerTest, LoadAndSaveSuccess) {
  base::Time creation_time = base::Time::Now();
  SavePageRequest request(kRequestId, GURL(kHttpUrl), kClientId, creation_time,
                          kUserRequested);
  EXPECT_TRUE(offliner()->LoadAndSave(request, completion_callback(),
                                      progress_callback()));

  CompleteLoading();
  PumpLoop();
  model()->CompleteSavingAsSuccess();
  PumpLoop();

  EXPECT_TRUE(completion_callback_called());
  EXPECT_EQ(Offliner::RequestStatus::SAVED, request_status());
  EXPECT_FALSE(offliner()->is_loading());
  EXPECT_FALSE(can_download_callback_called());
  EXPECT_FALSE(SaveInProgress());
}

TEST_F(BackgroundLoaderOfflinerTest, LoadAndSaveAlreadyExists) {
  base::Time creation_time = base::Time::Now();
  SavePageRequest request(kRequestId, GURL(kHttpUrl), kClientId, creation_time,
                          kUserRequested);
  EXPECT_TRUE(offliner()->LoadAndSave(request, completion_callback(),
                                      progress_callback()));

  CompleteLoading();
  PumpLoop();
  model()->CompleteSavingAsAlreadyExists();
  PumpLoop();

  EXPECT_TRUE(completion_callback_called());
  EXPECT_EQ(Offliner::RequestStatus::SAVED, request_status());
  EXPECT_FALSE(offliner()->is_loading());
  EXPECT_FALSE(SaveInProgress());
}

TEST_F(BackgroundLoaderOfflinerTest, ResetsWhenDownloadStarts) {
  base::Time creation_time = base::Time::Now();
  ClientId browser_actions("browser_actions", "123");
  SavePageRequest request(kRequestId, GURL(kHttpUrl), browser_actions,
                          creation_time, kUserRequested);
  EXPECT_TRUE(offliner()->LoadAndSave(request, completion_callback(),
                                      progress_callback()));
  offliner()->stub()->CanDownload(GURL(kHttpUrl), "foo",
                                  can_download_callback());
  PumpLoop();
  EXPECT_TRUE(can_download_callback_called());
  EXPECT_TRUE(can_download());
  EXPECT_TRUE(completion_callback_called());
  EXPECT_EQ(Offliner::RequestStatus::DOWNLOAD_THROTTLED, request_status());
}

TEST_F(BackgroundLoaderOfflinerTest, ResetsWhenDownloadEncountered) {
  base::Time creation_time = base::Time::Now();
  ClientId prefetching("suggested_articles", "123");
  SavePageRequest request(kRequestId, GURL(kHttpUrl), prefetching,
                          creation_time, kUserRequested);
  EXPECT_TRUE(offliner()->LoadAndSave(request, completion_callback(),
                                      progress_callback()));
  offliner()->stub()->CanDownload(GURL(kHttpUrl), "foo",
                                  can_download_callback());
  PumpLoop();
  EXPECT_TRUE(can_download_callback_called());
  EXPECT_FALSE(can_download());
  EXPECT_TRUE(completion_callback_called());
  EXPECT_EQ(Offliner::RequestStatus::LOADING_FAILED_DOWNLOAD, request_status());
}

TEST_F(BackgroundLoaderOfflinerTest, CanDownloadReturnsIfNoPendingRequest) {
  offliner()->CanDownload(can_download_callback());
  PumpLoop();
  EXPECT_TRUE(can_download_callback_called());
  EXPECT_FALSE(can_download());
}

TEST_F(BackgroundLoaderOfflinerTest, FailsOnInvalidURL) {
  base::Time creation_time = base::Time::Now();
  SavePageRequest request(kRequestId, GURL("file://salmon.png"), kClientId,
                          creation_time, kUserRequested);
  EXPECT_FALSE(offliner()->LoadAndSave(request, completion_callback(),
                                       progress_callback()));
}

TEST_F(BackgroundLoaderOfflinerTest, ReturnsOnRenderCrash) {
  base::Time creation_time = base::Time::Now();
  SavePageRequest request(kRequestId, GURL(kHttpUrl), kClientId, creation_time,
                          kUserRequested);
  EXPECT_TRUE(offliner()->LoadAndSave(request, completion_callback(),
                                      progress_callback()));
  offliner()->PrimaryMainFrameRenderProcessGone(
      base::TerminationStatus::TERMINATION_STATUS_PROCESS_CRASHED);

  EXPECT_TRUE(completion_callback_called());
  EXPECT_EQ(Offliner::RequestStatus::LOADING_FAILED_NO_NEXT, request_status());
}

TEST_F(BackgroundLoaderOfflinerTest, ReturnsOnRenderKilled) {
  base::Time creation_time = base::Time::Now();
  SavePageRequest request(kRequestId, GURL(kHttpUrl), kClientId, creation_time,
                          kUserRequested);
  EXPECT_TRUE(offliner()->LoadAndSave(request, completion_callback(),
                                      progress_callback()));
  offliner()->PrimaryMainFrameRenderProcessGone(
      base::TerminationStatus::TERMINATION_STATUS_PROCESS_WAS_KILLED);

  EXPECT_TRUE(completion_callback_called());
  EXPECT_EQ(Offliner::RequestStatus::LOADING_FAILED, request_status());
}

TEST_F(BackgroundLoaderOfflinerTest, ReturnsOnWebContentsDestroyed) {
  base::Time creation_time = base::Time::Now();
  SavePageRequest request(kRequestId, GURL(kHttpUrl), kClientId, creation_time,
                          kUserRequested);
  EXPECT_TRUE(offliner()->LoadAndSave(request, completion_callback(),
                                      progress_callback()));
  offliner()->WebContentsDestroyed();

  EXPECT_TRUE(completion_callback_called());
  EXPECT_EQ(Offliner::RequestStatus::LOADING_FAILED, request_status());
}

TEST_F(BackgroundLoaderOfflinerTest, FailsOnErrorPage) {
  base::Time creation_time = base::Time::Now();
  SavePageRequest request(kRequestId, GURL(kHttpUrl), kClientId, creation_time,
                          kUserRequested);
  EXPECT_TRUE(offliner()->LoadAndSave(request, completion_callback(),
                                      progress_callback()));
  // Create handle with net error code.
  // Called after calling LoadAndSave so we have web_contents to work with.
  content::MockNavigationHandle handle(
      GURL(kHttpUrl), offliner()->web_contents()->GetMainFrame());
  handle.set_has_committed(true);
  handle.set_is_error_page(true);
  handle.set_net_error_code(net::Error::ERR_NAME_NOT_RESOLVED);
  offliner()->DidFinishNavigation(&handle);

  histograms().ExpectBucketCount(
      "OfflinePages.Background.LoadingErrorStatusCode.async_loading",
      -105,  // ERR_NAME_NOT_RESOLVED
      1);
  CompleteLoading();
  PumpLoop();

  EXPECT_TRUE(completion_callback_called());
  EXPECT_EQ(Offliner::RequestStatus::LOADING_FAILED_NET_ERROR,
            request_status());
}

TEST_F(BackgroundLoaderOfflinerTest, FailsOnCertificateError) {
  base::Time creation_time = base::Time::Now();
  SavePageRequest request(kRequestId, GURL(kHttpUrl), kClientId, creation_time,
                          kUserRequested);
  EXPECT_TRUE(offliner()->LoadAndSave(request, completion_callback(),
                                      progress_callback()));

  // Sets the certificate status as having been revoked.
  std::unique_ptr<VisibleSecurityState> visible_security_state =
      BaseVisibleSecurityState();
  visible_security_state->cert_status |= net::CERT_STATUS_REVOKED;
  offliner()->set_custom_visible_security_state(
      std::move(visible_security_state));

  // Called after calling LoadAndSave so we have web_contents to work with.
  content::MockNavigationHandle handle(
      GURL(kHttpUrl), offliner()->web_contents()->GetMainFrame());
  handle.set_has_committed(true);
  offliner()->DidFinishNavigation(&handle);

  CompleteLoading();
  PumpLoop();

  EXPECT_FALSE(SaveInProgress());
  EXPECT_TRUE(completion_callback_called());
  EXPECT_EQ(Offliner::RequestStatus::LOADED_PAGE_HAS_CERTIFICATE_ERROR,
            request_status());
}

TEST_F(BackgroundLoaderOfflinerTest, FailsOnRevocationCheckingFailure) {
  base::Time creation_time = base::Time::Now();
  SavePageRequest request(kRequestId, GURL(kHttpUrl), kClientId, creation_time,
                          kUserRequested);
  EXPECT_TRUE(offliner()->LoadAndSave(request, completion_callback(),
                                      progress_callback()));

  // Sets a revocation checking failure certificate error that should not be
  // allowed.
  std::unique_ptr<VisibleSecurityState> visible_security_state =
      BaseVisibleSecurityState();
  visible_security_state->cert_status |=
      net::CERT_STATUS_NO_REVOCATION_MECHANISM;
  offliner()->set_custom_visible_security_state(
      std::move(visible_security_state));

  // Called after calling LoadAndSave so we have web_contents to work with.
  content::MockNavigationHandle handle(
      GURL(kHttpUrl), offliner()->web_contents()->GetMainFrame());
  handle.set_has_committed(true);
  offliner()->DidFinishNavigation(&handle);

  CompleteLoading();
  PumpLoop();

  EXPECT_FALSE(SaveInProgress());
  EXPECT_TRUE(completion_callback_called());
  EXPECT_EQ(Offliner::RequestStatus::LOADED_PAGE_HAS_CERTIFICATE_ERROR,
            request_status());
}

TEST_F(BackgroundLoaderOfflinerTest, SucceedsOnHttp) {
  base::Time creation_time = base::Time::Now();
  SavePageRequest request(kRequestId, GURL(kHttpUrl), kClientId, creation_time,
                          kUserRequested);
  EXPECT_TRUE(offliner()->LoadAndSave(request, completion_callback(),
                                      progress_callback()));

  // Sets the URL to HTTP while still setting a major certificate error (should
  // be ignored).
  std::unique_ptr<VisibleSecurityState> visible_security_state =
      BaseVisibleSecurityState();
  visible_security_state->url = GURL(kHttpUrl);
  visible_security_state->cert_status |= net::CERT_STATUS_REVOKED;
  offliner()->set_custom_visible_security_state(
      std::move(visible_security_state));

  // Called after calling LoadAndSave so we have web_contents to work with.
  content::MockNavigationHandle handle(
      GURL(kHttpUrl), offliner()->web_contents()->GetMainFrame());
  handle.set_has_committed(true);
  offliner()->DidFinishNavigation(&handle);

  CompleteLoading();
  PumpLoop();

  EXPECT_TRUE(SaveInProgress());
  EXPECT_FALSE(completion_callback_called());
}

TEST_F(BackgroundLoaderOfflinerTest, FailsOnUnwantedContent) {
  base::Time creation_time = base::Time::Now();
  SavePageRequest request(kRequestId, GURL(kHttpUrl), kClientId, creation_time,
                          kUserRequested);
  EXPECT_TRUE(offliner()->LoadAndSave(request, completion_callback(),
                                      progress_callback()));

  // Sets the page as containing SafeBrowsing unwanted content.
  std::unique_ptr<VisibleSecurityState> visible_security_state =
      BaseVisibleSecurityState();
  visible_security_state->malicious_content_status = security_state::
      MaliciousContentStatus::MALICIOUS_CONTENT_STATUS_SOCIAL_ENGINEERING;
  offliner()->set_custom_visible_security_state(
      std::move(visible_security_state));
  // Called after calling LoadAndSave so we have web_contents to work with.
  content::MockNavigationHandle handle(
      GURL(kHttpUrl), offliner()->web_contents()->GetMainFrame());
  handle.set_has_committed(true);
  offliner()->DidFinishNavigation(&handle);

  CompleteLoading();
  PumpLoop();

  EXPECT_FALSE(SaveInProgress());
  EXPECT_TRUE(completion_callback_called());
  EXPECT_EQ(Offliner::RequestStatus::LOADED_PAGE_IS_BLOCKED, request_status());
}

TEST_F(BackgroundLoaderOfflinerTest, FailsOnInternetDisconnected) {
  base::Time creation_time = base::Time::Now();
  SavePageRequest request(kRequestId, GURL(kHttpUrl), kClientId, creation_time,
                          kUserRequested);
  EXPECT_TRUE(offliner()->LoadAndSave(request, completion_callback(),
                                      progress_callback()));

  // Create handle with net error code.
  // Called after calling LoadAndSave so we have web_contents to work with.
  content::MockNavigationHandle handle(
      GURL(kHttpUrl), offliner()->web_contents()->GetMainFrame());
  handle.set_has_committed(true);
  handle.set_is_error_page(true);
  handle.set_net_error_code(net::Error::ERR_INTERNET_DISCONNECTED);
  offliner()->DidFinishNavigation(&handle);

  CompleteLoading();
  PumpLoop();

  EXPECT_TRUE(completion_callback_called());
  EXPECT_EQ(Offliner::RequestStatus::LOADING_FAILED_NET_ERROR,
            request_status());
}

TEST_F(BackgroundLoaderOfflinerTest, DoesNotCrashWithNullResponseHeaders) {
  base::Time creation_time = base::Time::Now();
  SavePageRequest request(kRequestId, GURL(kHttpUrl), kClientId, creation_time,
                          kUserRequested);
  EXPECT_TRUE(offliner()->LoadAndSave(request, completion_callback(),
                                      progress_callback()));

  // Called after calling LoadAndSave so we have web_contents to work with.
  content::MockNavigationHandle handle(
      GURL(kHttpUrl), offliner()->web_contents()->GetMainFrame());
  handle.set_has_committed(true);
  offliner()->DidFinishNavigation(&handle);
}

TEST_F(BackgroundLoaderOfflinerTest, OnlySavesOnceOnMultipleLoads) {
  base::Time creation_time = base::Time::Now();
  SavePageRequest request(kRequestId, GURL(kHttpUrl), kClientId, creation_time,
                          kUserRequested);
  EXPECT_TRUE(offliner()->LoadAndSave(request, completion_callback(),
                                      progress_callback()));
  // First load
  CompleteLoading();
  // Second load
  CompleteLoading();
  PumpLoop();
  model()->CompleteSavingAsSuccess();
  PumpLoop();

  EXPECT_TRUE(completion_callback_called());
  EXPECT_EQ(Offliner::RequestStatus::SAVED, request_status());
  EXPECT_FALSE(offliner()->is_loading());
  EXPECT_FALSE(SaveInProgress());
}

TEST_F(BackgroundLoaderOfflinerTest, HandleTimeoutWithLowBarStartedTriesMet) {
  base::Time creation_time = base::Time::Now();
  SavePageRequest request(kRequestId, GURL(kHttpUrl), kClientId, creation_time,
                          kUserRequested);
  request.set_started_attempt_count(policy()->GetMaxStartedTries() - 1);
  EXPECT_TRUE(offliner()->LoadAndSave(request, completion_callback(),
                                      progress_callback()));
  // Guarantees low bar for saving is met.
  auto* main_frame = offliner()->web_contents()->GetMainFrame();
  offliner()->DocumentAvailableInMainFrame(main_frame);
  // Timeout
  EXPECT_TRUE(offliner()->HandleTimeout(kRequestId));
  EXPECT_TRUE(SaveInProgress());
  model()->CompleteSavingAsSuccess();
  PumpLoop();
  EXPECT_EQ(Offliner::RequestStatus::SAVED_ON_LAST_RETRY, request_status());
}

TEST_F(BackgroundLoaderOfflinerTest, HandleTimeoutWithLowBarCompletedTriesMet) {
  base::Time creation_time = base::Time::Now();
  SavePageRequest request(kRequestId, GURL(kHttpUrl), kClientId, creation_time,
                          kUserRequested);
  request.set_completed_attempt_count(policy()->GetMaxCompletedTries() - 1);
  EXPECT_TRUE(offliner()->LoadAndSave(request, completion_callback(),
                                      progress_callback()));
  // Guarantees low bar for saving is met.
  auto* main_frame = offliner()->web_contents()->GetMainFrame();
  offliner()->DocumentAvailableInMainFrame(main_frame);
  // Timeout
  EXPECT_TRUE(offliner()->HandleTimeout(kRequestId));
  EXPECT_TRUE(SaveInProgress());
  model()->CompleteSavingAsSuccess();
  PumpLoop();
  EXPECT_EQ(Offliner::RequestStatus::SAVED_ON_LAST_RETRY, request_status());
}

TEST_F(BackgroundLoaderOfflinerTest, HandleTimeoutWithNoLowBarStartedTriesMet) {
  base::Time creation_time = base::Time::Now();
  SavePageRequest request(kRequestId, GURL(kHttpUrl), kClientId, creation_time,
                          kUserRequested);
  EXPECT_TRUE(offliner()->LoadAndSave(request, completion_callback(),
                                      progress_callback()));
  request.set_started_attempt_count(policy()->GetMaxStartedTries() - 1);
  // Timeout
  EXPECT_FALSE(offliner()->HandleTimeout(kRequestId));
  EXPECT_FALSE(SaveInProgress());
}

TEST_F(BackgroundLoaderOfflinerTest,
       HandleTimeoutWithNoLowBarCompletedTriesMet) {
  base::Time creation_time = base::Time::Now();
  SavePageRequest request(kRequestId, GURL(kHttpUrl), kClientId, creation_time,
                          kUserRequested);
  EXPECT_TRUE(offliner()->LoadAndSave(request, completion_callback(),
                                      progress_callback()));
  request.set_completed_attempt_count(policy()->GetMaxCompletedTries() - 1);
  // Timeout
  EXPECT_FALSE(offliner()->HandleTimeout(kRequestId));
  EXPECT_FALSE(SaveInProgress());
}

TEST_F(BackgroundLoaderOfflinerTest, HandleTimeoutWithLowBarNoRetryLimit) {
  base::Time creation_time = base::Time::Now();
  SavePageRequest request(kRequestId, GURL(kHttpUrl), kClientId, creation_time,
                          kUserRequested);
  EXPECT_TRUE(offliner()->LoadAndSave(request, completion_callback(),
                                      progress_callback()));
  // Sets lowbar.
  auto* main_frame = offliner()->web_contents()->GetMainFrame();
  offliner()->DocumentAvailableInMainFrame(main_frame);
  // Timeout
  EXPECT_FALSE(offliner()->HandleTimeout(kRequestId));
  EXPECT_FALSE(SaveInProgress());
}

TEST_F(BackgroundLoaderOfflinerTest, SignalCollectionDisabled) {
  base::Time creation_time = base::Time::Now();
  SavePageRequest request(kRequestId, GURL(kHttpUrl), kClientId, creation_time,
                          kUserRequested);
  EXPECT_TRUE(offliner()->LoadAndSave(request, completion_callback(),
                                      progress_callback()));

  CompleteLoading();
  PumpLoop();

  // No extra parts should be added.
  content::MHTMLExtraParts* extra_parts =
      content::MHTMLExtraParts::FromWebContents(offliner()->web_contents());
  EXPECT_EQ(extra_parts->size(), 0);
}

}  // namespace offline_pages

redpajama_set_name: RedPajamaGithub