Say what you will about Red Faction: Armageddon, but Volition's third-person shooter packs some truly fantastic toys. Sure, it has all the usual shotguns, assault rifles and rocket launchers, but alongside them you'll find mighty hammers that can smash whole buildings apart, hulking, heavily-armed exoskeletons, nano-guns that disintegrate creatures and objects into their constituent atoms, and nano-units that can build them back up again.
We get grenades, remote grenades and energy beams, and - best of all - a magnet gun where you fire at point A, fire again at point B, and a beam of energy drags the two together. Allied with the series' signature Geo-Mod technology, which pioneered the idea of making all the scenery destructible, this armoury makes for a brilliant toolkit for creative destruction. Creature over there giving you trouble? Why not literally bring the house down on him? Or why not knock heads together by wiring two vicious critters together with the magnet gun, and watch them accelerate towards each other at deadly speed.
In theory, this should be great fun, but the thing about a brilliant toolkit is that it needs a brilliant world in which to work, or all that ingenuity gets pretty dull, pretty quickly. This, sadly, is where the latest Red Faction falls apart.
This is a shame. The previous effort, Red Faction: Guerilla, wasn't entirely successful, but its marriage of first-person-shooter, open-world and mega-destruction was reasonably innovative and enjoyable. Armageddon, by contrast, seems to settle for being a by-the-numbers action game with only its exotic weaponry to recommend it. It's an old story - space marine meets hostile inhabitants of planet - with the only real twist being that this marine is an engineer, the action takes place on a colonised Mars, and that it's sort-of his fault that those particular hostile inhabitants have been set loose. It's little more than a basic premise for a linear series of missions designed to put your hero in close proximity with horde after horde of insectoid Martian varmints.
There's nothing wrong with that if the game still works, but Armageddon starts off dull, steadily gets fun, then goes back to its default setting of, erm, dull. You've seen it. You've done it. You stopped wearing the T-Shirt several years ago and it's lurking at the bottom of your wardrobe. While Volition has made an effort to create a varied roster of baddies, each with their own moves, attacks and quirks, very few encounters are staged with much panache, and it's really only the weapon set that keeps the combat interesting. Soon one samey mission blends into another, whatever pretext there is to keep you moving from one place to another, and as the game progresses, the principal idea seems to be to up the numbers or just throw more of the more tricky Martian critters into the mix. Unless you think frustration is better than boredom, this isn't the way to go.
Armageddon also looks drab. Arguably, Volition's biggest mistake has been to set the whole game underground (a previous disaster, also caused by our hapless hero, has taken Mars's terraforming tech offline). You'd have to go back to the days of Quake II to see a game so uniformly brown, grey and unspectacular, packed with industrial decor and enlivened with only the occasional touch of scenic grandeur. The aliens themselves are spectacularly generic, as if the team had spent weeks researching what aliens look like in other games in order to come up with a collection that look just the same. Honestly, Armageddon couldn't be any less distinctive if it tried.
Of course there are good things to say, and we really should mention them. Obviously, all those cool weapons count for something, and the destructible scenery is fun. The music is consistently good, and some decent voice actors do their best to make the cinematic cutscenes dramatic (though there's only so much you can do with this stuff). We're also going to dish out a whole extra point - maybe two - for the Infection multiplayer mode. It might just be another spin on the classic "four-men against a mass of nasties" theme, as seen in Gears of War's Horde mode or Halo: Reach's Firefight, but it's a good spin, made frantic and hilarious by all those weapons and all the chunks of scenery flying around. The secondary Ruin mode, where you have a time limit to smash things up in, is a nice showcase for the game's destruction, but nothing more.
Look, it's 2011 now. Do you really need another unremarkable shooter in your collection? Have you exhausted all the other sci-fi action epics to the extent that you really must have something new? Well, Red Faction is a perfectly acceptable genre effort with a great set of weapons, but one that that still gets stale with time. While it has its moments and the multiplayer is fun, so many other games have done this so much better, and with so much more drama and excitement.


Recently I had the opportunity to try out the KISS InstaWave curler. I decided to not only do the review but a quick and easy hair tutorial as well.
So up first is the tutorial then the review below.
For a fast and feminine look for the holidays I think MilkMaid braids are the way to go! They're also great for any age.
1. Part the hair down the middle and detangle each section.
2. Starting on either side, make a low braid starting above the ear. Be sure to leave out pieces of hair for curling. Do this on both sides.
3. Now you should have one braid on each side.
4. Next you're going to take a bobby pin and secure each braid to the opposite side of the head. If you place the braids just right they will cover the bobby pins.
5. Time to curl! I used the Kiss InstaWave curler. I placed a small section of hair onto the curling rod.
6. Then I pressed the dialer on the front of the curler and let it do all of the work for me.
7. The first side is done. Now repeat the curl process on the next side.
8. Make sure you smooth down any fly aways and double check the pins are secure.
For those that don't know the Kiss InstaWave is supposed to be able to help anyone of any skill level achieve tangle free fabulous curls. It is easy to use and features a dial that will automatically curl your hair left or right. It's recommended to curl in both directions for a more natural effect. There are two heat settings, Low and high with a maximum of 420 degrees.
I really like this product. After a few tries I got the hang of it fairly quickly and it was really easy to use. The InstaWave heats up fast so there isn't a lot of waiting around. My favorite part is the dialer. You press the button down and it curls the hair for you. No more getting that awful crimp in the bottom of your curls! The only down side I found is the InstaWave does not work well on short hair. It only creates volume but no curl. This is a really great product for anyone with long hair.
If you're interested in the KISS InstaWave check out the website Here where you can also find helpful video tutorials.
Omg that is soo cool! I am going to have to get me one, ASAP.


text:
State of Schizophrenia
By Michael Flynn and Jim Lobe July 30, 2006
Over the past year and a half, the State Department has reemerged as the preeminent force in U.S. foreign relations, one that on the surface seems capable of challenging the aggressive, go-it-alone politics of both the Pentagon and of the office of the vice president. Viewed by many observers as a sign of President George W. Bush's second-term chastening, the revival of State has nonetheless been accompanied by a number of contradictory impulses, raising questions about the department's ability-or willingness-to champion diplomacy in the face of a loud campaign by neoconservatives and hawks for further intervention in the Middle East as the conflict between Hezbollah and Israel intensifies.
Although the tilt toward diplomacy began as early as late 2003, when it became clear that the invasion of Iraq had unleashed an implacable insurgency for which the administration was completely unprepared, it was not until Condoleezza Rice took over as Secretary of State that this shift gained steam. In the last 18 months, Rice and other "realists" have won praise for what is seen as a "strategic makeover" of the administration's foreign policy. (See the Time magazine cover by Mike Allen and Romesh Ratnesar, "The End of Cowboy Diplomacy," July 17, 2006.) In addition to intensified consultation with U.S. allies, the change has been most evident in a few major arenas: Bush's new willingness to offer concessions to both North Korea and Iran as part of multilateral negotiations to get them to freeze or abandon their nuclear programs; State's relaxation of pressure on Syria in exchange for Damascus's cooperation on Iraq; and its efforts to engage and co-opt Sunni insurgents and ex-Ba'athists in Iraq.
European leaders' enthusiasm for Washington's newly pragmatic orientation is evidence of the realist resurgence, as is the recent outcry of protest from the ranks of prominent neoconservatives-particularly with respect to the administration's openness to directly engaging Iran, which they see as the main sponsor of Syria, Hamas, and Hezbollah.
But if Dick Cheney and the hardliners have been down, they certainly have not been out. That the "cowboys" have been able to limit the freedom of Rice and the realists has been made clear in a number of ways. In May, for example, the State Department reportedly wanted to accept North Korea's invitation to Pyongyang for informal bilateral talks, but Cheney scuttled the idea. Some analysts believe that the rebuff was the proximate cause of North Korea's early July missile tests. In the Middle East, the State Department recommended a more forthcoming position on the provision of humanitarian and development assistance to the Palestinian Authority after Hamas's victory in the January elections but was unable to prevail at the White House. Similarly, State Department officials reportedly favored a more flexible U.S. position on negotiating security guarantees with Iran, as urged by Washington's European partners, if Tehran agreed to freeze its nuclear program, but hardliners succeeded in vetoing that, too.
A clear pattern has emerged: Each time the State Department tries to nudge the United States toward a more conciliatory position in hopes of engaging the "enemy" in a diplomatic process, Cheney and the hardliners succeed in limiting the diplomats' ability to do so. In the latest crisis over Lebanon, some observers have perceived a difference in the way the State Department and the White House have reacted to the dramatic escalation in the Middle East. Consistent with her interest in maintaining as unified a stance as possible with Washington's European allies, Rice, for example, has both publicly and privately urged restraint on Israel in Gaza, and especially now in Lebanon. Echoing Israel's stance, on the other hand, the White House, where prominent neoconservative Elliott Abrams holds the Middle East portfolio, has emphasized Syria and Iran's alleged responsibility for the situation.
The limitations on the ability of the State Department to push negotiations are not only external. Indeed, since Rice took over at State, the department has brought on a number of officials whose agendas seem diametrically opposed to diplomacy. This began when John Bolton, a Cheney favorite who is closely aligned with leading neoconservatives, was-in the face of congressional opposition-given a recess appointment to serve as the U.S. ambassador to the United Nations. U.S. allies, who view Bolton as a proxy for the Bush administration's take-it-or-leave-it posture, have heavily criticized Bolton's tenure, which is up for confirmation in the Senate later this year. As one unnamed UN ambassador "with close ties" to the administration told the New York Times recently, "My initial feeling was, let's see if we can work with [Bolton], and I have done some things to push for consensus on issues that were not easy for my country. But all he gives us in return is, 'It doesn't matter, whatever you do is insufficient'." Added the ambassador: "He's lost me as an ally now, and that's what many other ambassadors who consider themselves friends of the United States are saying."
The Bolton faction was apparently reinforced at State in early June 2006, when Randall Fort was nominated to serve as head of the State Department's Bureau of Intelligence and Research. A former executive at Goldman Sachs, Fort's ties to Bolton (he reportedly provided a letter of support for Bolton during his Senate confirmation hearings) has raised questions about whether State's intel office, one of the few intelligence outfits that challenged the administration's reasons for going to war in Iraq, would continue to provide an independent voice.
The February 2005 appointment of Elizabeth Cheney, daughter of the vice president, to serve as principal deputy assistant secretary of state for Near Eastern affairs was also viewed as a potential thorn in the side of diplomacy. With a mandate and an $85 million budget to advance regime change strategies in the Middle East, Liz Cheney's work was applauded by neoconservative pundits. In early April, Lawrence Kaplan, senior editor at The New Republic and coauthor with William Kristol of the 2003 book The War over Iraq: Saddam's Tyranny and America's Mission, reported on the creation of an interagency group headed by Cheney called the Iran Syria Operations Group (ISOG). Kaplan opined: "The simple fact of ISOG's existence suggests that, despite being burned so badly in Iraq for listening exclusively to like-minded advisers, the administration intends to keep its own counsel on Iran too. On the up side, the creation of ISOG offers further proof that government officials have finally gotten serious about the threat from Tehran."
Cheney has also been associated with a new State outfit called the Office of Iranian Affairs, an office that many critics view as a revival of the Pentagon's Office of Special Plans, the controversial intel outfit accused of manipulating intelligence during the run-up to the Iraq War. While there is little evidence to suggest that the office will dabble in intelligence issues, some observers see its creation as another example of the contradictory policies pushed by the administration recently. Said Richard Haass, president of the Council on Foreign Relations and a State Department official under Colin Powell, "We are telling Iran, 'We want regime change, but while you're still here, we'd like to nego
tiate with you to stop your nuclear program'."
Then there is Rice's failure to quickly choose a successor for her realist-inclined deputy, Robert Zoellick, who announced in June that he was resigning to take up a post at Goldman Sachs. This has raised concerns among some observers that a Dick Cheney favorite, like Abrams or Deputy National Security Adviser J.D. Crouch, may claim the spot.
And finally there is Rice herself, who seems to embody the contradictions in the State Department. Her historic announcement in May that the United States would be willing to negotiate with Tehran if the country suspended its uranium enrichment program appeared to solidify the administration's shift to diplomacy, drawing cries of protest from many neoconservatives. The Center for Security Policy typified the hardliners' reaction, opining on its website: "In the face of intensifying Iranian intransigence and provocations, President Bush has decided to adopt the recommendations of appeasement-prone subordinates . The decision announced by Secretary of State Condoleezza Rice today that the United States would be prepared to participate directly-as opposed to through European and United Nations proxies-in negotiations with the terrorist-sponsoring mullahocracy in Tehran, if only it will promise to suspend its nuclear weapons activities, will only reward and lead to more of such behavior."
Several weeks later, however, the tables seem to have turned. Despite her muted calls for restraint in response to the escalating violence between Israel and Hezbollah, Rice's refusal to step into the fray by visiting the region immediately after the conflict broke out was viewed by observers as a clear expression of support for Israel's bombing campaign. Rice has also trotted out the shopworn rhetoric of reshaping the Middle East and repeated the disingenuous claim that the problems in the region boil down to terrorist opposition to change. Two days after the outbreak of hostilities, Rice argued: "Obviously Iran is involved. Iran is financing Hezbollah. Iran is providing technology. Syria is harboring Hezbollah . So yes, what you have here [is] that extremist forces-Hamas, Hezbollah, the Iranians, and the Syrians-recognize that they are facing a different kind of Middle East, the emergence of a different kind of Middle East in which democratic and moderate forces will dominate . and they want to stop it."
The current Middle East crisis appears to have opened the way for a resurgence of the hardliners in the administration, much to the frustration of realists in and out of government. And European allies and "moderate" Arab states like Jordan and Egypt are increasingly worried that Washington's virtually unconditional backing for Israel in the conflict is inflaming public opinion.
Just like after 9/11, a Middle East-related crisis appears to be strengthening the hand of right-wing hawks. The question is, does Rice have the will-or wherewithal-to push back?
Michael Flynn is the Right Web project director. Jim Lobe is a Right Web contributing writer and the Washington bureau chief of the Inter Press Service.

redpajama_set_name: RedPajamaCommonCrawl


Within our RPA competence center, we're looking for RPA Developers with passion for automation. You will be responsible for creating a delivering components of our projects. You will work for both internal & client projects, from our office or from our clients location. You think out of the box and believe that there is always a way how to reach your goal. You see automation as a challenge but you are not afraid to use your innovative idea's. Automation and RPA should be in your blood and DNA.


Lauren Siess, viola (Portland, OR), is currently pursuing her BM at the Juilliard School under Carol Rodland. Lauren has participated in and soloed with ensembles in the Pacific Northwest, including the Portland Chamber Orchestra, Portland Youth Philharmonic, and Oregon Sinfonietta. Former teachers include Brian Quincey, Helen Callus, and Paul Neubauer. An alumni of the Colburn Music Academy, Lauren was featured as a soloist with the Colburn Academy Virtuosi Orchestra and Colburn Chamber Orchestra, and served as principal viola of both orchestras. She was a semifinalist in the Klein International String Competition in San Francisco. She is a participant of the Perlman Music Program, with residencies including Shelter Island, NY; Sarasota, Florida; and Tel Aviv, Israel. Lauren attended Banff Centre's Ensemble Evolution, and Chamber Music, programs, where she studied contemporary chamber music with the ICE, JACK Quartet, Imani Winds, and Miro Quartet. Lauren has premiered multiple works by Joel Phillip Friedman, and has worked with Joan Tower and Steve Reich. Lauren is a recipient of a Kovner Fellowship at the Juilliard School.


text:
How SNAP helps New Yorkers in poverty
Advocates are resisting federal efforts to scale back benefits.
Supplemental Nutrition Assistance Program helped lift 3.1 million Americans out of poverty in 2018, according to new data published Tuesday by the U.S. Census Bureau. The effects of SNAP were comparatively pronounced in New York state, which saw a 1.6 percentage point decrease according to one measure of poverty from 2016 to 2018 as a result of the federal program. SNAP also had the greatest impact on people over the age of 65 in New York compared with the rest of the county.
Other government programs that had a noteworthy effects on poverty include Supplemental Security Income, or federal assistance for people with disabilities, which helped 2.9 million people get out of poverty over the same two-year period, and housing subsidies, which helped 3 million, according to the new census data. This new data may understate the effects these programs have on poverty, according to the left-leaning Center on Budget and Policy Priorities, because survey respondents underreport the amount government assistance they receive, and it only measures people lifted above the poverty line specifically.
The latest data comes as President Donald Trump's administration has proposed cuts to many of these programs, including a $220 billion hit to SNAP. In July, the administration also proposed limiting the way states determine eligibility for food stamps, which would kick 3.1 million people out of the program. Measuring the exact impact of the proposal in New York is difficult, Jerome Nathaniel, senior program manager at City Harvest, told NYN Media.
"What we do know is a lot of times when these rules happen, New York and California do take a big brunt of the consequences," he said.
Nonprofits in New York have been mobilizing to support SNAP, most recently partnering with U.S. Rep. Carolyn Maloney to speak out against the proposal. The coalition includes FPWA, Catholic Charities Archdiocese of New York, UJA-Federation of New York and Fiscal Policy among other organizations.


It could be the difference between giving somebody a clean bill of health and discovering they have a serious medical condition.
All devices should be tested regularly and calibrated to ensure they are in line with current regulations.
Forest Medical hold the prestigious ISO 9001 award and can calibrate and test virtually any medical equipment to be found in a typical GP practice, care home, occupational health department, ambulance station etc.
Having your equipment checked annually can prevent costly downtime and repairs. It is also a requirement to be CQC compliant.
All of your equipment can be checked onsite by a fully qualified and trained engineer with enhanced DBS clearance. We will carry out small repairs onsite or if this is not possible we can take the damaged item away for repair in our workshop.
Below is a list of the most common items we check on a daily basis. If you cannot see the items you are interested in or if you have a query or question please feel free to contact us on 01773 788185 and we will do our best to help you.
All of the testing equipment used by Forest Medical is checked and certified to UKAS traceable standards.
"Forest Medical were cheaper than anybody else, I couldn't fault the service they provided"


[S65] Unknown subject, bapt., Ellen Fanny Streatfield, Seal Kent, father James, mother Eliza., England & Wales Christenings.
[S44] Extracted from the 1861 census, age 2.
[S17] England & Wales BMD indices, birth, Sevenoaks, Kent, Apr-Jun 1858, vol 2a 349. as Strutfield.


text:
Q: Why does rendering a pdf from rmarkdown require closing rstudio between renders? Background
I am trying to make a rmarkdown document that is rendered using render(). The render call has two elements that are parameterized:

*

*I would like the user to be able to specify pdf or html.
Straightforward using output_format().

*I also would like to pass a parameter to the document to specify if the tables (using the kableExtra package) are latex or html.

This is the rmarkdown file called test.Rmd
---
title: "Title"
author: "Zzz Zzzzzz"
params:
  table_format:
    value
---

```{r setup}
knitr::opts_chunk$set(echo = FALSE)
library(knitr)
library(kableExtra)

options(knitr.table.format = params$table_format)
```

## Test table

```{r cars}
if (params$table_format == "latex"){
kable(iris[1:100,], booktabs = T) %>%
  kable_styling(latex_options = c("scale_down"))
}

if (params$table_format == "html"){
kable(iris[1:100,]) %>%
  kable_styling(bootstrap_options = c("striped", "hover"))  %>%
  scroll_box(width = "500px", height = "600px")
}

params$table_format
```

Now here are the two calls to render the file:
rmarkdown::render("test.Rmd", output_format = "pdf_document", params = list(
  table_format = "latex"
))

rmarkdown::render("test.Rmd", output_format = "html_document", params = list(
  table_format = "html"
))

Problem
Now if I open up a fresh rstudio session I can run both render calls no problem. Either .pdf or an .html file is created. However if I then try to run the .pdf render again i get the following error:

"C:/Program Files/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS
  test.utf8.md --to latex --from
  markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash
  --output test.pdf --template "C:\Users\salbers\R\win-library\3.4\rmarkdown\rmd\latex\default-1.17.0.2.tex"
  --highlight-style tango --latex-engine pdflatex --variable graphics=yes --variable "geometry:margin=1in"  ! Undefined control
  sequence.  \begin {tabular}{rrrrl} \toprule
                                              Sepal.Length & Sepal.Width & Pet... l.267 \end{tabular}}
pandoc.exe: Error producing PDF Error: pandoc document conversion
  failed with error 43 In addition: Warning message: running command
  '"C:/Program Files/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS
  test.utf8.md --to latex --from
  markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash
  --output test.pdf --template "C:\Users\salbers\R\win-library\3.4\rmarkdown\rmd\latex\default-1.17.0.2.tex"
  --highlight-style tango --latex-engine pdflatex --variable graphics=yes --variable "geometry:margin=1in"' had status 43

The html render works fine over and over again. If I close rstudio, then ropen the project, the render for pdf work fine as well.
Question

*

*Can anyone tell me why my pdf rendered rmarkdown document can't be rendered twice in a single session of rstudio?

*Similarly, why does rstudio have to closed in between renderings?

A: In my case, @Hao answer didn't work...I finally managed unloading the kableExtra package after each render execution, as follows:
rmarkdown::render('torender.Rmd')
detach("package:kableExtra", unload=TRUE)

It should be possible also selecting the environment using something like
rmarkdown::render('torender.Rmd',envir=new.env(some parameters))

which is cleaner....but I didn't manage this way!

A: I had a similar problem: a loop to render PDF reports that contained a table. PDF would not render with booktabs = T. My solution was to manually load all of the latex packages in my setup chunk in the Rmd script that was being called from the loop.
So in the Rmd script that was being called multiple time I have:
usepackage_latex("booktabs")
usepackage_latex("longtable")
usepackage_latex("array")
usepackage_latex("multirow")
usepackage_latex("xcolor", "table")
usepackage_latex("wrapfig")
usepackage_latex("float")
usepackage_latex("colortbl")
usepackage_latex("pdflscape")
usepackage_latex("tabu")
usepackage_latex("threeparttable")
usepackage_latex("threeparttablex")
usepackage_latex("ulem", "normalem")
usepackage_latex("makecell")

This fixed the issue - the PDFs rendered with formatted tables.
Hopefully, this helps someone.

A: 2019-01-21 UPDATE:
One of the big difference between the knit button and the render function is that, the knit button always starts with a "new environment" (as we all can feel) while the render function by default starts in the parent.env().
render(input, ..., envir = parent.frame(), ...)

In the function documentation, we see
envir
The environment in which the code chunks are to be evaluated
during knitting (can use new.env() to guarantee an empty new
environment).

Therefore, we can simulate the behavior of clicking the knit button by putting envir = new.nev() in the render call.

Original Answer:
Hmm, let me post the solution first. To solve this behavior, you need to put the following stuff in your yaml section. I also added a function kableExtra_latex_packages() in the dev version earlier this week to bring up the following texts.
header-includes:
  - \usepackage{booktabs}
  - \usepackage{longtable}
  - \usepackage{array}
  - \usepackage{multirow}
  - \usepackage[table]{xcolor}
  - \usepackage{wrapfig}
  - \usepackage{float}
  - \usepackage{colortbl}
  - \usepackage{pdflscape}
  - \usepackage{tabu}
  - \usepackage{threeparttable}
  - \usepackage[normalem]{ulem}

If you are curious why there is such an odd behavior, here is a short explanation. When you first load kableExtra in a rmarkdown environement, it will try to put the LaTeX package information above into the rmarkdown metadata using the usepackage_latex() function that comes with this package. It works fine if you just hit the knit button because every "knit+rendering" process is supposed to be isolated. However, surprisingly (btw thanks for bringing it up), as we see it here, if you are trying to render from console, since (my assumption) knitr or rmarkdown is trying to reuse some cached results, this process failed to replicate. It turns out these LaTeX package dependencies were not put into the tex file being generated and ends up with an error. If you close RStudio and restart it, of course, the temporary memory it has will be gone and you should be able to load those packages again. I feel like it could be a global-variable-related bug in rmarkdown. I guess we can fix it by adding a "forget the meta" part at the end of the render function but I need to look it that.
Part of it was my bad for not providing enough documentations on LaTeX packages that were used in past releases. Now, I added a new section about this issue at the very beginning of the package vignette of kableExtra 0.5.0, which was released earlier this week. Feel free to check it out. Also, as I said earlier, in current dev version, you can bring up the list using the function kableExtra_latex_packages().

A: I found an easy way to do this for multiple .Rmd files was to make a "headers.tex" file with the list of these kableExtra-added \usepackage{} commands. Then in the YAML header of the .Rmd file:
output:
  pdf_document:
    includes:
      in_header: headers.tex

Here's what I put in the header.tex file -- I'd copied it from one that worked, and it's also the output of kableExtra_latex_packages() stripping off the "header-includes:" line and the dashes.
\usepackage{booktabs}
\usepackage{longtable}
\usepackage{array}
\usepackage{multirow}
\usepackage{wrapfig}
\usepackage{float}
\usepackage{colortbl}
\usepackage{pdflscape}
\usepackage{tabu}
\usepackage{threeparttable}
\usepackage{threeparttablex}
\usepackage[normalem]{ulem}
\usepackage{makecell}
\usepackage{xcolor}

redpajama_set_name: RedPajamaStackExchange


The economical beam dyeing process (patented) introduces a new concept in fabric dyeing. To-day, dyeing industry demands versatility and minimum cost of production. This objective has been well achieved in this process. has designed this unique energy saving process with the aforesaid objective. The help of man made fiber textile research association (Mantra) and Sardar Vallabhbhai Patel Regional Engineering College, Surat is gratefully acknowledged. We provide the entire plant beam dye machines and dye machinery.
Reduction in heat-energy consumption upto 35%.
Reduction in water consumption upto 80% per batch.
Reduction in electric consumption upto 20%.
Reduction in liquor ratio. 1:5.
Elimination of the trouble giving injector pump.
Pay-back period of 3 to 4 months.


Infiniti Q50 and Q60 Flex Fuel Kits - FUEL-IT!
* Add and inline filter?
If you are running E85 or ethanol mixes in your Q50 or Q60, you need this kit!
All fittings and fuel lines to make this plug and play.
Hose clamp to secure assembly in the engine bay.
Harness extension to relocate your ECA (Ethanol Content Analyzer) to one the battery compartment.
Click the button below to add the Infiniti Q50 and Q60 Flex Fuel Kits to your wish list.


Nominations for Forbes' 2019 30 Under 30 list are open.
For the eighth year straight, Forbes is looking for the best and boldest young leaders, creators and thinkers to join our dynamic Under 30 community. Founders, funders, philanthropists, foodies, filmmakers, fashionistas—they're all here. It's an impressive club. Past honorees include Spotify's Daniel Ek, musician Kendrick Lamar, Nobel Peace Prize winner Malala Yousafzai, Glossier's Emily Weiss, Instagram's Kevin Systrom, model Karlie Kloss, and Black Panther director Ryan Coogler. This December, we'll welcome to this dynamic group 600 new trailblazers from across 20 diverse fields. With an acceptance rate below 4%, competition is intense.
Think you or someone you know should join the ranks of the Under 30? Please complete this online nomination form for our 2019 U.S. and Europe lists.
Here's some helpful information about the process.
What's the age cut off?
To be eligible for the 2019 Under 30 List, a nominee must be 29 or younger on December 31, 2018 (Born in 1989 or later).
Which countries and regions are eligible. Forbes creates three Under 30 Lists (U.S., Asia, Europe). We are currently opening nominations for both our U.S. and Europe Lists. Citizenship does not matter, instead please apply to the region where the nominees (and their business) are most prominent.
How does Forbes create the Under 30 list?
It's a three-step process. Through open nominations, recommendations by respected investors, executives, entrepreneurs, and the reporting by the Forbes edit team, we assemble thousands of candidates across 20 categories. Next, Forbes staff picks around 60 finalists for each field. Finally, independent industry legends (think Mark Benioff, Aileen Lee, David Chang, Jennifer Hyman, Steve Balmer, Phil Knight) select the final 30 in each category.
What are the 20 categories?
What if a company or organization has more than one founder?
You and your cofounders/business partners can be jointly named 30 Under 30s. When nominating, be sure to include all names of your cofounders or partners who are under 30 years old. If you don't, we may not consider them. Note, if they've aged out, they won't be eligible, but you still are.
Where and when are the Forbes 30 Under 30 Summits?
We hold four major international summits open to the Under 30 community, mentors and peers.
Under 30 Summit Asia – Hong Kong, July 16 – 18.
Once you click submit, the nomination becomes the property of FORBES. We may choose to use the contents of your nomination for the purpose of advertising, marketing, promotion and publicizing the 30 Under 30 list. Some numbers will remain internal if specified on the form.


Buenos Aires, Argentina, October 11, 2018 - Beach volleyball pairs from China, Germany, Hungary, Indonesia, Italy, Russia, Spain and the United States each won their third pool play match here Wednesday to clinch pool titles to earn first-round byes when elimination bracket competition starts Saturday at the Buenos Aires 2018 Youth Olympic Games.
Headlining the winners on Wednesday were the men's teams of second-seeded Denis Shekunov/Dmitrii Veretiuk of Russia (Pool B) and 30th-seeded Filip John/Lukas Pfretzschner of Germany (Pool C) and the women's tandems of ninth-seeded Daniela Alvarez/Tania Moreno of Spain (Pool H) and 16th-seeded Devon Newberry/Lindsey Sparks of the United States (Pool A).
Shekunov and Veretiuk are the reigning FIVB under-19 world champions after the Russians defeated John and Pfretzschner 2-0 (21-19, 21-18) in the 35-minute finale on July 15 in Nanjing, China. Earlier in the U19 worlds, the Germans defeated Shekunov and Veretiuk in a pool play match.
Alvarez and Moreno placed third at the FIVB U19 World Championships in Nanjing after defeating Newberry and Sparks 2-1 (10-21, 21-18, 15-12) in the 41-minute bronze medal match July 15.
Other men's teams clinching group crowns and advancing to the second-round of elimination with a bye were the men's duos of sixth-seeded Bintang Akbar/Danang Herlambang of Indonesia (Pool F) and Artur Hajos/Bence Streli of Hungary (Pool G). Akbar and Herlambang placed ninth at the U19 worlds with the Hungarians finished ninth.
Joining the American and Spanish women as pool winners on Wednesday were fifth-seeded Nicol Bertozzi/Claudia Scampoli of Italy (Pool D) and 29th-seeded Shuting Cao/Jinjin Zeng of China (Pool D). The Chinese women placed ninth at the U19 World Championships while Bertozzi and Scampoli were ousted in the first-round of elimination by Newberry and Sparks to place 17th.
Highlighting Friday's final day of pool play are matches for the second-seeded Russian women's pair of Mariia Bocharova/Maria Voronina of Russia and the 32nd-seeded men's pair of Nathan Broch/Timon Gysin of Switzerland.
The reigning U19 women's world champions, Bocharova and Voronina meet 15th-seeded Thamela Coradelli/Ana Carolina Dos Santos of Brazil with the winner capturing the Pool B title and earning the bye for the first-round of elimination.
With upset wins over Argentina and Thailand tandems, Broch and Gysin secured the men's Pool A title by defeating 17th-seeded Patrik Manas/Jiri Sedlak of the Czech Republic on Friday. The Swiss pair open play with a three-set win Monday over Bautista Amieva/Mauro Zelayeta of Argentina, who placed fourth at the Nanjing U19 World Championships in July.
With one day of pool play remaining before the start of the men's and women's elimination rounds, teams from the European confederation have won 34 of the 80 contests after five days of group action, including 15 wins for women and 19 for men. The South American confederation has netted 16 victories (10 women, six men) followed by 14 for NORCECA (eight women, six men), 12 for the Asian confederation (six women, six men) and four for pairs from the African continent (one woman, three men).
The Buenos Aires 2018 Youth Olympic elimination rounds begin on Saturday for both men and women as the top three teams from each pool advance to single-elimination bracket play. Both the men's and women's quarterfinals will be played on Monday followed by the semifinals on Tuesday and the medal matches on Wednesday.


Sometimes before I go to bed, I get an urge to pick up a pen and write. Often the words that come, are scribbled down onto the page in a semi conscious state, as my body is just about getting ready to drift to sleep.
When the morning comes, I read what I have written the night before, and quite often the words are a gift. Offering insight and guidance to me, as if from a place elsewhere than my own consciousness.
"Open your heart. Your eyes. Your mind.
Focus less on the ever present sense of 'I want to be there and don't want to be here'. Gently quieten the agitated fears that lurk in the background about not having enough time or needing to hurry along. Redirect your mind and focus, gently, on the present moment instead. To your inner strength and faith. To the beauty that is always around you, despite circumstance, if you are present enough to look openly enough.
Let go of the many story's of the past that cling to you or the thoughts that dwell on how long you've been sick. They won't ever soothe you, or serve you.
Sink fully into the Now instead. Today. Just as it is.
Breathe. More deeply. More slowly. Notice your breath. Connect to it. Often. Become aware of the moments when you hold your breath or breathe shallowly. Spend time each day, throughout the day, just stopping and taking a few slow, grounding breaths. In… and out. Place your hand on your heart. Or your belly. Reconnect to your breath, and yourself, often.
Go outside. Spend time in nature as much as you can. Sit in your garden. Listen to the birds and the sounds. Open the windows. Let the light stream into the room or if you can, get outside. Let the sunlight into your eyes and onto your skin. Spend time near the ocean or in forests as often as you can. Relax in Salt baths. Let go. Float.
Read. At your own pace and without straining your eyes. But read. Gently. Realise that if you can look at a phone screen or social media each day, you can sit quietly with a book and read a page or two. Prioritise this beautiful gift to yourself over screens. Each day. Use books, as you have before, to connect back to your inner power. To encourage you. To educate you. To help guide you and lead you forwards in your quest. Enjoy reading. Allow time for reading. Each day.
Embrace your spirituality. Don't underestimate the importance of your daily meditation or yoga practise. They reconnect you back to this moment, to stillness and to your true self. To the universal energy that is ever present inside you regardless of how much physical 'energy' you may (or may not) feel in your human body.
Commit to your practise. Roll out your yoga mat daily. Even if to just sit on in lotus and connect back to your heart. Do it regardless. Move your body, gently. Feel each movement fully. Be present on the mat. Allow it to support you.
Let go of the urgency to be 'like everyone else' and the suffocating pressure and rush to be far enough on in your recovery to be able to 'go to work or have children'. Try to embrace the beauty that is possible for you in your life right now, despite the pain and discomfort. For this life is all you have. Support your healing in all ways you can, but also find a way to bloom fully where you are planted too. Trust the future will unfold as it should. In time.
Tell your self 'I love you, I am listening' regularly. Connect to your heart and listen to your body and soul. Respect yourself. Treat yourself kindly.
Recognise that you are worthy, as you are, right now. No matter what you can or cannot do physically.
Believe in yourself. Your future. In possibilities. But don't let the gift of the present moment pass you buy in your quest for other destinations.
Life isn't perfect. Sometimes it's tough. Sometimes it challenges us deeply.
But your life… is yours. The light, the dark and everything in between.
To be gently embraced and cherished.
If you would like to receive future blog post notifications straight to your inbox, just pop your email address in the subscription box.
Some readers have noticed that their initial welcome email has gone into their Junk email folder. If you are a new subscriber please look out for your first Consciously Healthy email and mark as 'safe' if it has accidentally ended up in your Junk folder so you can continue to receive future emails.
Thank you, I REALLY needed this today. It's been a tough week.
So so beautiful! Thank you so much for sharing your wisdom. It's this balance between striving for wellness and that deep desire (and pressure) to be well enough to work again vs. the need to rest and surrender to the present moment that I still find so hard. This is a beautiful reminder. Thank you lovely.
Your words Emma are so filled with a wisdom and a gentleness. They always seem to be appropriate for me at any given time. Bless you for reaching out to us despite the limitations of your health. I hope you realise that it is very much appreciated.


The Internet can't get enough of the bizarre state.
This week, the Internet is celebrating (if you want to call it that) how bizarre the state of Florida is with the hilarious Florida Man Challenge.
The trend, which has gone viral on social media, is similar to the Rihanna challenge from February in that it involves Googling your birthday (e.g. January 21, November 11).
However, instead of putting Rihanna's name beside your birth date, you would put your birth date beside the word Florida Man. Whatever wild Florida story comes up would be the equivalent of your zodiac sign.
People have been sharing their results on Twitter and to call them hilarious would be an understatement.
Then, there were those really weird stories where you didn't know whether to laugh or be horrified.
Interestingly enough, the "Florida man" isn't a new phenomenon.
The titles featured on the page make blockbuster movies seem like amateur screenwriting.
Florida man even became sort of a folklore or a single individual who goes around doing bizarre and/or violent things.
The FX show Atlanta covered the Florida man's profile in a season two episode.
Florida man's popularity is no coincidence. According to the Miami New Times, part of the reason wild Florida stories are so accessible is because of a state law called the Government in the Sunshine Act.
Since 1909, Florida has continued a tradition that makes all government business available to the public. Thus, all records, including videos and photos, produced by a public agency can easily be pulled with the exception of certain confidential info.
With such easily available public records, journalists are able to quickly uncover the most bizarre stories as soon as someone gets arrested or booked.
It's the reason mugshots appear online only days after someone's arrest. After that, all a journalist has to do is call the police department and ask for an arrest report, and the police are required to give it to them.
Other states don't have such transparent government agencies, so even though a wild arrest might have happened in Alabama or some other state, it might not make it to the news so easily.
Florida man, on the other hand, has a shocking story every day. Just Google your birth date and "Florida man" for proof.
You most likely won't be disappointed.


I'm having a hard time finding solid information on writing views with CB lite. I know there's documentation for native, but there's very little for Cordova. Instead, I've been using the documentation from CB Server, even though I know that CB lite only has subset of the Server view features.
I need to write a view where I'm joining two documents, like a blog post document and comment documents, so the output is a list of post documents with an array of comments embedded.
I think you can not query info cross documents by View.
You can't directly do joins the way you would in a relational database, but you can use a combination of compound keys and reducing to do some of the same work. I gave an example of this in a Couchbase Connect presentation from 2014.
Thanks @jens. I see the pseudo-join example on slide 21. I'll get back to you on how it goes on my end.
BTW - Is groupLevel available in REST design documents?
Yes, but it's not part of the design doc, it's part of the query. See the REST API docs for view queries.
I didn't see any info for groupLevel. Shouldn't it be on this page, http://developer.couchbase.com/documentation/mobile/1.2/develop/references/couchbase-lite/rest-api/design-document/get—db–design–design-doc–view–view-name-/index.html?
You're right; there are several parameters missing from that page. I've filed an internal bug report. Until then you can use the CouchDB docs for reference.
The page that describes creating a design doc mentions the "by_location" view that has a reduce function. But the code example is missing that view. Someone add that to the documentation?


A collection of light-filled quotations about peace from teachers of all traditions.
A Note from Frederic and Mary Ann: We put together this collection of inspiration quotations about peace on October 8, 2001, just 27 days after we wrote "Rest in Peace," a prayer in the form of a poem to express our empathy with all those affected by the terrorist attacks in our city and to emphasize the unity of all in our world community.
The day before we made this collection, we learned that the United States had started bombing Afghanistan while we were attending an Interfaith Service at Union Square Park in New York. Protestant and Catholic Christians, Jews, Buddhists, Muslims, and Hindus united their voices and spirits in a call for peace. We came together as New Yorkers to assert that "Our Grief Is Not a Cry for War." At the end of the service, candles were lit and passed around as symbols of our resolve to keep this feeling of unity aglow in our hearts and to bring it to others.
We offer you these light-filled quotations on peace. May your own little light shine.


text:
from itertools import chain

from spodernet.utils.global_config import Config, Backends

from spodernet.utils.logger import Logger
log = Logger('frontend.py.txt')

class Model(object):

    def __init__(self, input_module=None):
        self.modules = []
        self.input_module = input_module
        self.module = self

    def add(self, module):
        self.modules.append(module)

    def forward(self, str2var, *inputs):
        outputs = inputs
        if inputs == None:
            outputs = []
        for module in self.modules:
            outputs = module.forward(str2var, *outputs)
        return outputs

class Trainer(object):
    def __init__(self, model):
        self.model = model

        self.trainer_backend = None
        self.train_func = None
        self.eval_func = None
        if Config.backend == Backends.TENSORFLOW:
            from spodernet.backends.tfbackend import TFTrainer
            self.trainer_backend = TFTrainer(model)
            self.train_func = lambda _, batch, epochs, iterations: self.trainer_backend.train_model(batch, epochs, iterations)
            self.eval_func = lambda _, batch, iterations: self.trainer_backend.eval_model(batch, iterations)
        elif Config.backend == Backends.TORCH:
            from spodernet.backends.torchbackend import train_model, eval_model
            self.train_func = train_model
            self.eval_func = eval_model

    def train(self, batcher, epochs=1, iterations=None):
        self.train_func(self.model, batcher, epochs, iterations)

    def evaluate(self, batcher, iterations=None):
        self.eval_func(self.model, batcher, iterations)

class AbstractModel(object):

    def __init__(self):
        super(AbstractModel, self).__init__()
        self.input_str_args = None
        self.output_str_args = None
        self.used_keys = None

    def forward(self, str2var, *args):
        raise NotImplementedError("Classes that inherit from AbstractModel need to implement the forward method.")

    @property
    def modules(self):
        raise NotImplementedError("Classes that inherit from AbstractModel need to overrite the modules property.")

    def expected_str2var_keys(self, str2var, keys):
        self.used_keys = keys
        for key in keys:
            if key not in str2var:
                log.error('Variable with name {0} expected, but not found in str2variable dict with keys {1}'.format(key, str2var.keys()))

    def expected_str2var_keys_oneof(self, str2var, keys):
        self.used_keys = keys
        one_exists = False
        for key in keys:
            if key in str2var:
                one_exists = True
        if not one_exists:
            log.error('At least one of these variable was expected: {0}. But str2var only has these variables: {1}.', keys, str2var.keys())

    def expected_args(self, str_arg_names, str_arg_description):
        log.debug_once('Expected args {0}'.format(str_arg_names))
        log.debug_once('Info for the expected arguments: {0}'.format(str_arg_description))
        self.input_str_args = str_arg_names

    def generated_outputs(self, str_output_names, str_output_description):
        log.debug_once('Generated outputs: {0}'.format(str_output_names))
        log.debug_once('Info for the provided outputs: {0}'.format(str_output_description))
        self.output_str_args = str_output_names
        self.used_keys
        self.input_str_args
        self.output_str_args
        message = '{0} + {1} -> {2}'.format(self.used_keys, self.input_str_args, self.output_str_args)
        log.info_once(message)

class Embedding(object):
    def __init__(self, embedding_size, num_embeddings, scope=None):
        self.embedding_size = embedding_size
        self.scope = scope
        self.num_embeddings = num_embeddings

        self.module = None
        if Config.backend == Backends.TENSORFLOW:
            from spodernet.backends.tfmodels import TFEmbedding
            self.module = TFEmbedding(embedding_size, num_embeddings, scope)
        elif Config.backend == Backends.TORCH:
            from spodernet.backends.torchmodels import TorchEmbedding
            self.module = TorchEmbedding(embedding_size, num_embeddings)
            self.modules = [self.module]

    def forward(self, str2var, *args):
        return self.module.forward(str2var, *args)

class PairedBiDirectionalLSTM(object):

    def __init__(self, input_size, hidden_size, scope=None, conditional_encoding=True):
        super(PairedBiDirectionalLSTM, self).__init__()
        self.hidden_size = hidden_size
        self.scope = scope

        self.module = None
        if Config.backend == Backends.TENSORFLOW:
            from spodernet.backends.tfmodels import TFPairedBiDirectionalLSTM
            self.module = TFPairedBiDirectionalLSTM(hidden_size, scope, conditional_encoding)
        elif Config.backend == Backends.TORCH:
            from spodernet.backends.torchmodels import TorchPairedBiDirectionalLSTM, TorchVariableLengthOutputSelection
            model = Model()
            model.add(TorchPairedBiDirectionalLSTM(input_size, hidden_size, conditional_encoding=conditional_encoding))
            model.add(TorchVariableLengthOutputSelection())

            self.module = model
            self.modules = model.modules

    def forward(self, str2var, *args):
        return self.module.forward(str2var, *args)

class SoftmaxCrossEntropy(object):
    def __init__(self, input_size, num_labels):
        super(SoftmaxCrossEntropy, self).__init__()
        self.num_labels = num_labels

        self.module = None
        if Config.backend == Backends.TENSORFLOW:
            from spodernet.backends.tfmodels import TFSoftmaxCrossEntropy
            self.module = TFSoftmaxCrossEntropy(num_labels)
        elif Config.backend == Backends.TORCH:
            from spodernet.backends.torchmodels import TorchSoftmaxCrossEntropy
            self.module = TorchSoftmaxCrossEntropy(input_size, num_labels)
            self.modules  = [self.module]

    def forward(self, str2var, *args):
        return self.module.forward(str2var, *args)

redpajama_set_name: RedPajamaGithub


In September we are going to Koh Samui, Thailand for some much needed sun, warmth and relaxation. To be honest, we can't really afford such a luxury but we committed ourselves back when I was feeling quite optimistic about our financial situation and savings capability. Of course life doesn't always turn out how we think. It doesn't matter anyway as I'm destined to win Tattslotto this evening so it will all pan out.
But which day do I choose?? Too many for a person that hates making decisions to handle!! And I want to know it is authentic and not a western adaption of the Thai curries we have here. I might go the red curry option though as that is what we all seem to enjoy the most here at home when I make it.
I can't wait to walk past the street stalls and try bits and pieces. We've been to Thailand before (six years ago now) but not to Koh Samui. It is the street vendors that give you the real Thai food experience. Ohh and they're cheap too!
For me, food is one of the most important aspects of travelling somewhere new and exciting. I'm free from the kitchen and the responsibility for satifsying the masses here and I want my food experience to be a memorable one....hence why something like a cruise with a buffet three times a day just does not cut it for me! My ultimate though? Going on a self guided tour through country Italy experiencing food. I can give Rome the flick (although of course would still love to go there) if I could do that.
I am embarrassed to say the last time we went to Thailand the Aus. dollar was very strong and we gorged ourselves on Magnums that cost the equivalent of 30 cents. Bargain ice confection: not so very authentic!
Ooohhh yes cheap icecream! Yay. Tara will be in heaven!
Where abouts have you been in Thailand? We have been there before too but not to Koh Samui. Haven't stayed on an island like that for two weeks before, so it will be interesting how I go.


text:
Corus plurifasciculatus is a species of beetle in the family Cerambycidae. It was described by Breuning in 1950.

References

plurifasciculatus
Beetles described in 1950

redpajama_set_name: RedPajamaWikipedia


text:
La Puebla de los Infantes település Spanyolországban, Sevilla tartományban.

Népesség
A település népessége az elmúlt években az alábbi módon változott:

Jegyzetek

További információk

Sevilla tartomány települései
Bottal létrehozott spanyol település cikkek


text:
package category;

import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.ResultSet;
import java.sql.SQLException;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

import net.miginfocom.swing.MigLayout;

public class CategoryFrame extends JFrame {

	private static final long serialVersionUID = -1463729941742096638L;

	JLabel labelCategory = new JLabel("Име на категорията:");
	JTextField categoryField = new JTextField(15);

	JButton buttonEdit = new JButton("Редактирай");

	public CategoryFrame(int cat_id) {
		super();

		ResultSet category = CategoryModel.getCategoryById(cat_id);

		String cat_name = "";
		try {
			cat_name = category.getString("cat_name");
		} catch (SQLException e) {
			e.printStackTrace();
		}

		categoryField.setText(cat_name);

		setLayout(new FlowLayout(FlowLayout.CENTER));

		JPanel newPanel = new JPanel();
		newPanel.setLayout(new MigLayout());

		newPanel.add(new JLabel("Редакция на Категория #" + cat_id ), "span");

		newPanel.add(labelCategory);
		newPanel.add(categoryField, "wrap");

		newPanel.add(buttonEdit, "wrap 30");
		buttonEdit.addActionListener(new EditCatAction(cat_id));

		this.add(newPanel);

		categoryField.requestFocusInWindow();
	}

	class EditCatAction implements ActionListener{

		int cat_id;

		public EditCatAction( int cat_id ) {
			this.cat_id = cat_id;
		}

		@Override
		public void actionPerformed(ActionEvent e) {
			String newCat_name = categoryField.getText();
			CategoryModel.updateCategory(this.cat_id, newCat_name);
			dispose(); // from the Category Frame so that the windows Closes and Refresh table
		}

	}

}


text:
"""The tests for the Google Calendar component."""
import logging
import unittest
from unittest.mock import patch

import homeassistant.components.google as google
from homeassistant.setup import setup_component
from tests.common import get_test_home_assistant

_LOGGER = logging.getLogger(__name__)

class TestGoogle(unittest.TestCase):
    """Test the Google component."""

    def setUp(self):  # pylint: disable=invalid-name
        """Set up things to be run when tests are started."""
        self.hass = get_test_home_assistant()

    def tearDown(self):  # pylint: disable=invalid-name
        """Stop everything that was started."""
        self.hass.stop()

    @patch('homeassistant.components.google.do_authentication')
    def test_setup_component(self, mock_do_auth):
        """Test setup component."""
        config = {
            'google': {
                'client_id': 'id',
                'client_secret': 'secret',
            }
        }

        assert setup_component(self.hass, 'google', config)

    def test_get_calendar_info(self):
        """Test getting the calendar info."""
        calendar = {
            'id': 'qwertyuiopasdfghjklzxcvbnm@import.calendar.google.com',
            'etag': '"3584134138943410"',
            'timeZone': 'UTC',
            'accessRole': 'reader',
            'foregroundColor': '#000000',
            'selected': True,
            'kind': 'calendar#calendarListEntry',
            'backgroundColor': '#16a765',
            'description': 'Test Calendar',
            'summary': 'We are, we are, a... Test Calendar',
            'colorId': '8',
            'defaultReminders': [],
            'track': True
        }

        calendar_info = google.get_calendar_info(self.hass, calendar)
        assert calendar_info == {
            'cal_id': 'qwertyuiopasdfghjklzxcvbnm@import.calendar.google.com',
            'entities': [{
                'device_id': 'we_are_we_are_a_test_calendar',
                'name': 'We are, we are, a... Test Calendar',
                'track': True,
                'ignore_availability': True,
            }]
        }

    def test_found_calendar(self):
        """Test when a calendar is found."""
        # calendar = {
        #     'id': 'qwertyuiopasdfghjklzxcvbnm@import.calendar.google.com',
        #     'etag': '"3584134138943410"',
        #     'timeZone': 'UTC',
        #     'accessRole': 'reader',
        #     'foregroundColor': '#000000',
        #     'selected': True,
        #     'kind': 'calendar#calendarListEntry',
        #     'backgroundColor': '#16a765',
        #     'description': 'Test Calendar',
        #     'summary': 'We are, we are, a... Test Calendar',
        #     'colorId': '8',
        #     'defaultReminders': [],
        #     'track': True
        # }

        # self.assertIsInstance(self.hass.data[google.DATA_INDEX], dict)
        # self.assertEqual(self.hass.data[google.DATA_INDEX], {})

        calendar_service = google.GoogleCalendarService(
            self.hass.config.path(google.TOKEN_FILE))
        assert google.setup_services(
            self.hass, {'google': {}}, True, calendar_service)
        # self.hass.services.call('google', 'found_calendar', calendar,
        #                         blocking=True)

        # TODO: Fix this
        # self.assertTrue(self.hass.data[google.DATA_INDEX]
        #   # .get(calendar['id'], None) is not None)


text:
/* See license.txt for terms of usage */

define([
    "firebug/lib/dom",
    "firebug/lib/css",
    "firebug/lib/object",
    "firebug/lib/trace",
    "firebug/lib/locale",
    "firebug/lib/search",
    "firebug/lib/domplate",
    "firebug/lib/xpcom",
    "firebug/html/htmlLib",
    "firebug/chrome/searchBox",
    "firestorm/lib/utils",
    "firestorm/lib/tablesort",
    "firestorm/core/scriptanalyser",
    "firestorm/core/moduleIndexer",
    "firestorm/core/modelHandler",
    "firestorm/fuzzingSidePanel"

],
function(Dom, Css, Obj, FBTrace, Locale, Search, Domplate, Xpcom, HTMLLib, SearchBox, Utils, TableSort,
    ScriptAnalyser, ModuleIndexer, ModelHandler, FuzzingSidePanel) {

// ********************************************************************************************* //
// Script Panel Implementation

const panelName = "FireStormPanel";
const DBG_FIRESTORMPANEL = true;

Firebug.FireStormPanel = function FireStormPanel() {};
Firebug.FireStormPanel.prototype = Obj.extend(Firebug.Panel,
{
    name: panelName,
    title: "FireStorm",
    searchable: true,
    objectPathAsyncUpdate: true,

    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
    // Initialization

    initialize: function()
    {

        // Panel initialization (there is one panel instance per browser tab)
        Firebug.Panel.initialize.apply(this, arguments);

        var page = this.context.window.document;

        if (FBTrace.DBG_FIRESTORM)
            FBTrace.sysout("fireStorm; FireStormPanel.initialize", {
                "this": this,
                "context": this.context,
                "Current Page": page
            });

        ModelHandler.suscribePanel(this);

        this.refresh();
    },

    destroy: function(state)
    {
        if (FBTrace.DBG_FIRESTORM)
            FBTrace.sysout("fireStorm; FireStormPanel.destroy");

        Firebug.Panel.destroy.apply(this, arguments);
    },

    show: function(state)
    {
        Firebug.Panel.show.apply(this, arguments);

        if (FBTrace.DBG_FIRESTORM)
            FBTrace.sysout("fireStorm; FireStormPanel.show",{
                "state": state
            });
        if (!this.context.Firestorm.Analysisfinished) {

            var scripts = Utils.mapToList(this.context.sourceFileMap);

            // filter the scripts if we are on the firestorm-test plateform
            if (this.context.window.document.title === "Firestorm-Tests")
              scripts = scripts.filter(function(script){
                return script.href.indexOf("/js/") === -1 && script.href.indexOf(".js") !== -1;
              });

            this.context.Firestorm.Analysisfinished = false;
            ScriptAnalyser.populateAnalysisStack(scripts);
            this.Analysing.render(this.panelNode);

            this.context.Firestorm.checkProgressIntervalId = Utils.setInterval.call(this, this.checkProgress, 500);

            if (FBTrace.DBG_FIRESTORM)
                FBTrace.sysout("fireStorm; FireStormPanel.show.analyse", {
                    "Scripts": scripts,
                    "Context": this.context
                });
        }
    },

    refresh: function()
    {
        // Render panel content. The HTML result of the template corresponds to:
        //this.panelNode.innerHTML = "<span>" + Locale.$STR("hellobootamd.panel.label") + "</span>";
        this.Welcome.render(this.panelNode);

        if (FBTrace.DBG_FIRESTORM)
            FBTrace.sysout("fireStorm; FireStormPanel.refresh", this);
    },

    shutdown: function()
    {
        Firebug.unregisterModule(ScriptAnalyser);
        if (FBTrace.DBG_FIRESTORM)
            FBTrace.sysout("fireStorm; FireStorm Panel shutdown");
    },

    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
    // Toolbar

    /**
     * Extends toolbar for this panel.
     */
    getPanelToolbarButtons: function()
    {
        var buttons = [];

        if (FBTrace.DBG_FIRESTORM)
            buttons.push({
                label: "firestorm.toolbar.button.label",
                tooltiptext: "firestorm.toolbar.button.tooltip",
                command: FBL.bindFixed(this.onHello, this)
            });

        buttons.push({
            id: "toggleFuzzingSidePanelButton",
            label: "Fuzzer",
            tooltiptext: "firestorm.toolbar.fuzzer.tooltip",
            command: FBL.bindFixed(this.ToogleSidePanel, this),
            disabled: this.isSelectedFunction()
        });

        return buttons;
    },

    /**
     * Checks wether or not a function is selected
     *
     * @return {Boolean}
     */
    isSelectedFunction: function(){
        return this.context.Firestorm.selectedFunction ? false : true;
    },

    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
    // Search
    //

    /**
     * Search Functionnality, greatly inspired from the DOM panel search method
     *
     * @param  {String}     text    text to search from
     * @param  {boolean}    reverse Indicates, if search is reversed
     * @return {boolean}             True if search returned result, false otherwise
     */
    search: function(text, reverse){
        if (!text) {
            delete this.currentSearch;
            this.highlightNode(null);
            this.document.defaultView.getSelection().removeAllRanges();
            return false;
        }

        var row;
        if (this.currentSearch && text === this.currentSearch.text){
            row = this.currentSearch.findNext(true, undefined, reverse,
                SearchBox.isCaseSensitive(text));
        }
        else {
            var findRow = function(node)
            {
                return Dom.getAncestorByClass(node, "searchableRow");
            };

            this.currentSearch = new Search.TextSearch(this.panelNode, findRow);

            row = this.currentSearch.find(text, reverse, SearchBox.isCaseSensitive(text));
        }

        if (row) {
            var sel = this.document.defaultView.getSelection();
            sel.removeAllRanges();
            sel.addRange(this.currentSearch.range);

            Dom.scrollIntoCenterView(row, this.panelNode);

            this.highlightNode(row);
            return true;
        }
        else {
            this.document.defaultView.getSelection().removeAllRanges();
            return false;
        }
    },

    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
    // SidePanel

    /**
     * Open and close side panel
     */
    ToogleSidePanel: function()
    {
        var registered = Firebug.getPanelType("FuzzingSidePanel");

        if (FBTrace.DBG_FIRESTORM)
            FBTrace.sysout("fireStorm; FireStormPanel.ToogleSidePanel",{
                "registered": registered
            });

        if (!registered)
            this.onAppendFuzzingSidePanel();
        else
            this.onRemoveFuzzingSidePanel();
    },

    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
    // Options Menu

    getOptionsMenuItems: function()
    {
        return [];
    },

    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
    // Context Menu

    /**
     * Right Click menu configuration
     *
     * @param  {Object} object clicked target object
     * @param  {Object} target clicked target Object
     * @return {Array}         List of all the context menu options
     */
    getContextMenuItems: function(object, target)
    {

        var items = [];

        if(object && this.context.Firestorm.functionTree.hasChildren())
            items.push({
                label: "firestorm.contextMenu.showSource",
                command: FBL.bindFixed(this.showSource, this, object.value)
            });

        return items;
    },

    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
    // Commands

    /**
     * Debug method to show current context
     *
     * @return {void}
     */
    onHello: function()
    {
        if (FBTrace.DBG_FIRESTORM)
        FBTrace.sysout("fireStorm; FireStormPanel.onHello",{
            "Context": this.context
        });
    },

    /**
     * Called to fold the side panel
     *
     * @return {void}
     */
    onRemoveFuzzingSidePanel: function()
    {
        Firebug.unregisterPanel(FuzzingSidePanel);
    },

    /**
     * Called to show the side Panel
     *
     * @return {void}
     */
    onAppendFuzzingSidePanel: function()
    {
        Firebug.registerPanel(FuzzingSidePanel);
    },

    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
    // Utils
    //

    /**
     * Called to open the script panel and get to the source location of the selected function.
     * Called from the context menu
     *
     * @param  {functionLeaf} functionLeaf Right clicked function leaf.
     * @return {void}
     */
    showSource: function(functionLeaf)
    {

        Firebug.chrome.selectPanel("script");

        var scriptPanel = Firebug.chrome.getSelectedPanel(),
            compil =this.getCompilationUnit(functionLeaf) ;

        scriptPanel.updateSelection(compil);
        scriptPanel.scrollToLine(functionLeaf.range.startLine, {highlight: true});

        if (FBTrace.DBG_FIRESTORM)
        FBTrace.sysout("fireStorm; FireStormPanel.showSource",{
            "this":this,
            "Firebug": Firebug,
            "functionLeaf":functionLeaf,
            "compil":compil
        });

    },

    /**
     * Retrives the Script of the selected function leaf as a compilationUnit
     *
     * @param  {FunctionLeaf}       functionLeaf Selected function
     * @return {CompilationUnit}                 Compilation Unit of teh selected function
     */
    getCompilationUnit: function(functionLeaf)
    {
        var locationList = Utils.mapToList(this.context.compilationUnits),
            compilationUnitName = "";

        compilationUnitName = functionLeaf.path[0].substring(1);
        compilationUnitName = compilationUnitName.substring(0,compilationUnitName.indexOf('/'));

        for (var i = 0; i< locationList.length ; i++){

            if(Utils.getFileName(locationList[i].href) === compilationUnitName)
                return locationList[i];
        }
    },

    /**
     * Checks if the current page includes scripts
     *
     * @return {Boolean}
     */
    hasScripts: function()
    {
        return Utils.mapToList(this.context.sourceFileMap).length > 0;
    },

    /**
     * Retrieves the tooltip Script menu text
     *
     * @return {String}
     */
    getScriptMenuToolTipText: function()
    {
        if(this.hasScripts())
            return "firestorm.toolbar.scripts.tooltip";
        return "firestorm.toolbar.scripts.noScript";
    },

    /**
     * Checks the progress made in the analysis
     *
     * @return {void}
     */
    checkProgress: function() {

        if (this.context.Firestorm.Analysisfinished){
            this.FunctionTree.render(this.context.Firestorm.functionTree,this.panelNode);
            clearInterval(this.context.Firestorm.checkProgressIntervalId)
        }

        if (FBTrace.DBG_FIRESTORM)
            FBTrace.sysout("fireStorm; FireStormPanel.checkProgress",{
                "analysisStack": this.context.Firestorm.analysisStack
        });
    },

    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
    // Model Change
    //

    /**
     * Method called when the context is modified through the modelHandler module
     *
     * @param  {Object} message message describing the modification
     * @return {void}
     */
    updateNotification: function(message)
    {
        if (message.update === "selectedFunction"){

            if(Firebug.currentContext.Firestorm.selectedFunction)
                Firebug.chrome.$("toggleFuzzingSidePanelButton").setAttribute("disabled", "false");

        } else if (message.update === "fuzzingInProgress"){

            var panel = Firebug.getPanelType("FuzzingSidePanel");
            if (panel)
                this.onRemoveFuzzingSidePanel();

            Firebug.chrome.$("toggleFuzzingSidePanelButton").setAttribute("disabled", "true");

            this.Fuzzing.render(this.panelNode, message.progress);

        } else if (message.update === "fuzzingFinished") {

            if (FBTrace.DBG_FIRESTORM)
                FBTrace.sysout("fireStorm; FireStormPanel.updateNotification.fuzzingFinished",{
                    "this": this,
                    "functionLeaf": this.context.Firestorm.selectedFunction.repObject.value,
                    "resultData": this.context.Firestorm.fuzzingData
                });

            this.FuzzingResults.render(
                this.panelNode,
                this.context.Firestorm.selectedFunction.repObject.value,
                this.context.Firestorm.fuzzingData
            );
        }
    }
});

// ********************************************************************************************* //
// Panel UI (Domplate)

// Register locales before the following template definition.
Firebug.registerStringBundle("chrome://FireStorm/locale/firestorm.properties");

/**
 * Domplate template used to render panel's content. Note that the template uses
 * localized strings and so, Firebug.registerStringBundle for the appropriate
 * locale file must be already executed at this moment.
 */
with (Domplate) {
    Firebug.FireStormPanel.prototype.Welcome = domplate(
    {
        tag:
            DIV({
                    class: "center"
                },
                H1(Locale.$STR("firestorm.panel.label")),
                BR(),
                SPAN(Locale.$STR("firestorm.panel.subtitle"))
            ),

        render: function(parentNode)
        {
            this.tag.replace({}, parentNode);
        }
    }),

    Firebug.FireStormPanel.prototype.Analysing = domplate(
    {
        tag:
            DIV({
                    class: "center"
                },
                IMG({
                    src: "chrome://FireStorm/skin/images/loader.gif",
                    alt: "Analysing"
                }),
                BR(),
                SPAN(Locale.$STR("firestorm.panel.analyzing"))
            ),

        render: function(parentNode)
        {
            this.tag.replace({}, parentNode);
        }
    }),

    Firebug.FireStormPanel.prototype.FunctionTree = domplate(
    {
        tag:
            TABLE({
                    class:"functionTreeTable",
                    onclick: "$onClick"
                },
                TBODY({
                        class:"tableRoot"
                    },
                    FOR("member", "$tree|memberIterator",
                        TAG("$row", {member: "$member"}))
                )
            ),

        row:
            TR({
                    id: "$member.id",
                    class: "treeRow searchableRow",
                    $hasChildren: "$member.hasChildren",
                    $isUsedFunction: "$member.usedFunction",
                    _repObject: "$member",
                    level: "$member.level"
                },
                TD({
                        style: "padding-left: $member.indent\\px"
                    },
                    DIV({
                            class: "treeLabel",
                            $isUsedFunction: "$member.usedFunction"
                        },
                        "$member.name"
                    )
                ),
                TD(
                    DIV("$member.label")
                )
            ),
        loop:
            FOR("member", "$members",
                TAG("$row", {member: "$member"})
            ),

        memberIterator: function(tree)
        {
            return this.getMembers(tree);
        },

        /**
         * Method called on a function Leaf click
         *
         * @param  {Event} event
         * @return {void}
         */
        onClick: function(event)
        {
            if (event.button != 0)
                return;

            var row = Dom.getAncestorByClass(event.target, "treeRow");
            var label = Dom.getAncestorByClass(event.target, "treeLabel");

            if (label && Css.hasClass(row, "hasChildren")){
                if (parseInt(row.getAttribute("level")) != 0)
                    this.selectfunctionDeclaration(row);
                this.toggleRow(row);
            } else if(Css.hasClass(event.target, "isUsedFunction")){
                this.toggleClickedFunctionDeclaration(row);
            } else {
                this.selectfunctionDeclaration(row);
            }
        },

        /**
         * Method used to select a function leaf as the current selected function and display it in
         * the user interface
         *
         * @param  {Row}    row selected function Leaf row
         * @return {void}
         */
        selectfunctionDeclaration: function(row)
        {
            Css.removeClass(this.selectedFunctionRow, "selected");
            this.selectedFunctionRow = row;
            Css.setClass(row,"selected");
            ModelHandler.updateSelectedFunction(row);
        },

        /**
         * Opens a row
         *
         * @param  {Row} row row to be opened
         * @return {void}
         */
        toggleRow: function(row)
        {
            var level = parseInt(row.getAttribute("level"));

            if (Css.hasClass(row, "opened")){
                Css.removeClass(row, "opened");

                var tbody = row.parentNode;
                for (var firstRow = row.nextSibling; firstRow ; firstRow = row.nextSibling){

                    if (parseInt(firstRow.getAttribute("level")) <= level)
                        break;
                    tbody.removeChild(firstRow);
                }
            } else {
                this.openRow(row);
            }
        },

        /**
         * Open all the rows on the path of the function declaration of the clicked used function
         *
         * @param  {Row} row used function Row
         * @return {void}
         */
        toggleClickedFunctionDeclaration: function(row)
        {
            var path = row.repObject.value.path.split("/"),
                currentRow = Dom.getAncestorByClass(row, "tableRoot");

            for (var j = 0 ; j<path.length ; j++){
                var toInspect = Array.prototype.slice.call(currentRow.children);
                for(var i = 0 ; i<toInspect.length ; i++){

                    if (toInspect[i].repObject &&
                        !toInspect[i].repObject.usedFunction &&
                         toInspect[i].repObject.value.getName() === path[j]){

                        currentRow = toInspect[i];
                        this.openRow(currentRow);
                    }
                }
            }
            Dom.scrollTo(currentRow, Dom.getAncestorByClass("panelNode-firestorm"));
        },

        /**
         * Makes the dom changes to open a Row in the user interface
         *
         * @param  {Row} row
         * @return {void}
         */
        openRow: function(row)
        {
            var level = parseInt(row.getAttribute("level"));

            if (!Css.hasClass(row, "opened")){
                Css.setClass(row, "opened");

                var repObject = row.repObject;
                if (repObject) {
                    var members = this.getMembers(repObject.value, level+1);
                    if (repObject.value.usedFunctions.length > 0){
                        this.loop.insertRows(
                            {
                                members: this.getUsedMember(repObject.value.usedFunctions, level+1)
                            },
                            row
                        );
                    }
                    if (members)
                        this.loop.insertRows({members: members}, row);
                }
            }
        },

        /**
         * Retrives all memebers of a Leaf
         *
         * @param  {functionTree}   tree  [description]
         * @param  {Integer}        level nested Level
         * @return {Array}                List of all Tree memebers
         */
        getMembers: function(tree, level)
        {

            if (!level)
                level = 0;

            var members = [],
                children = tree.getChildren();

            for (var i = 0 ; i<children.length ; i++)
                members.push(this.createMember(children[i].getName(), children[i], level));

            return members;
        },

        /**
         * Creates a Memeber for the current leaf
         *
         * @param  {String}         name    Name of the memeber
         * @param  {FunctionLeaf}   leaf    leaf of the member
         * @param  {Integer}        level   nested level of the member
         * @return {Object}                 Memeber object
         */
        createMember: function(name, leaf, level)
        {

            return {
                name: name,
                id: leaf.path,
                label: (level == 0) ? "" : "Function level "+level,
                value: leaf,
                level: level,
                indent: level*16,
                hasChildren: leaf.hasChildren(),
                usedFunction: false
            };
        },

        /**
         * Get used used functions in the current function declaration
         *
         * @param  {Array}      usedFunctions used functions list
         * @param  {Integer}    level         nested level
         * @return {Array}                    Array of displayable used functions
         */
        getUsedMember: function(usedFunctions, level)
        {
            var usedMembers = [];

            for (var i = 0 ; i<usedFunctions.length ; i++){
                usedMembers.push({
                    name: usedFunctions[i].name,
                    id: "",
                    label: "",
                    value: usedFunctions[i],
                    level: level,
                    indent: level*16,
                    hasChildren: false,
                    usedFunction: true
                });
            }

            return usedMembers;
        },

        /**
         * Renders the main Panel
         *
         * @param  {FunctionTree}   functionTree function tree to display
         * @param  {Node}           parentNode   DOm node to overide
         * @return {void}
         */
        render: function(functionTree, parentNode)
        {
            this.tag.replace({tree: functionTree}, parentNode);
        }
    }),

    Firebug.FireStormPanel.prototype.Fuzzing = domplate(
    {
        tag:
            DIV({
                    class: "center"
                },
                IMG({
                    src: "chrome://FireStorm/skin/images/loader.gif",
                    alt: "Fuzzing"
                }),
                BR(),
                SPAN(Locale.$STR("firestorm.panel.fuzzing")),
                SPAN(Locale.$STR("firestorm.progress")+" "+"$progress %")
            ),

        render: function(parentNode, progress)
        {
            this.tag.replace({"progress": Math.round(progress)}, parentNode);
        }
    }),

    Firebug.FireStormPanel.prototype.FuzzingResults = domplate(
    {
        tag:
            DIV({
                    class: "fuzzingReport",
                    id:"fuzzingReport"
                },
                H1(
                    {
                        class: "center"
                    },
                    Locale.$STR("firestorm.panel.fuzzingResults.title")
                ),
                DIV(
                    {},
                    H2(Locale.$STR("firestorm.panel.function")+": $functionLeaf.name"+'('+"$functionLeaf.concatArgs"+')'),
                    P(Locale.$STR("frestorm.panel.fuzzingResults.numbers")+
                        ": $positiveResults / $fuzzingSessionsNumber"),
                    BR(),
                    H3(Locale.$STR("firestorm.panel.fuzzingResults.reference")),
                    TABLE({
                            class:"referenceTable"
                        },
                        TBODY({
                                class:"referenceTableRoot"
                            },
                            TR({
                                class: "rowTitles"
                            },
                                TH(
                                    Locale.$STR("firestorm.panel.fuzzingResults.HTML")
                                ),
                                TH(
                                    Locale.$STR("firestorm.panel.fuzzingResults.context")
                                )
                            ),
                            TR({
                                class: "rowElements"
                            },
                                TD(
                                    {
                                        _repObject: "$reference.response.HTML",
                                        class: "HTMLSnipet",
                                        onclick: "$HTMLClick"
                                    },
                                    "$reference.response.HTML|generateExerpt"
                                ),
                                TD(
                                    "$reference.response.context"
                                )
                            )
                        )
                    ),
                    BR(),
                    H3(Locale.$STR("firestorm.panel.fuzzingResults.Details")),
                    TABLE({
                            class:"fuzzingResultsTable table-autosort",
                            id: "fuzzingResultsTable"
                        },
                        TBODY({
                                class:"fuzzingResultsBody"
                            },
                            TR({
                                class: "rowTitles no-sort"
                            },
                                TH({
                                    class:"no-sort"
                                },
                                    ""
                                ),

                                TH(
                                    Locale.$STR("firestorm.panel.fuzzingResults.args")
                                ),
                                TH(
                                    Locale.$STR("firestorm.panel.fuzzingResults.returnedValue")
                                ),
                                TH(
                                    Locale.$STR("firestorm.panel.fuzzingResults.HTML")
                                ),
                                TH(
                                    Locale.$STR("firestorm.panel.fuzzingResults.context")
                                ),
                                TH(
                                    Locale.$STR("firestorm.panel.fuzzingResults.callStack")
                                ),
                                TH(
                                    Locale.$STR("firestorm.panel.fuzzingResults.result")
                                )
                            ),
                            FOR("fuzzingResult", "$resultData",
                                TAG("$fuzzingSession", {fuzzingResult: "$fuzzingResult"})
                            )
                        )
                    )
                )
            ),

        fuzzingSession:
            TR({
                class: "rowElements searchableRow",
                _repObject: "$fuzzingResult"
            },
                TD(
                    {
                        class: "fs-closed",
                        onclick: "$expandRowDetails"
                    },
                    ""
                ),
                TD(
                    {},
                    "($fuzzingResult.args)"
                ),
                TD(
                    {
                        _repObject: "$fuzzingResult.response.value",
                        class: "returnedValue"
                    },
                    "$fuzzingResult.response.value"
                ),
                TD(
                    {
                        _repObject: "$fuzzingResult.response.HTML",
                        class: "HTMLSnipet",
                        onclick: "$HTMLClick"
                    },
                    "$fuzzingResult.response.HTML|generateExerpt"
                ),
                TD(
                    {
                        _repObject: "$fuzzingResult.response.context",
                        class: "ContextSnipet",
                        onclick: ""
                    },
                    "$fuzzingResult.response.context"
                ),
                TD(
                    {
                        _repObject: "$fuzzingResult.response.callStack",
                        class: "CallStackSnipet",
                        onclick: ""
                    },
                    "$fuzzingResult.response.callStack"
                ),
                TD(
                    {
                        $anomaly: "$fuzzingResult.detection.result"
                    },
                    "$fuzzingResult.detection.result"
                )
            ),

        render: function(parentNode, functionLeaf, resultData)
        {
            parentNode.innerHTML ="";

            if (FBTrace.DBG_FIRESTORM && DBG_FIRESTORMPANEL)
                FBTrace.sysout("fireStorm; fireStormPanel.render",{
                    "resultData": resultData.filter(function(element, index){
                        return element.args != undefined;
                    })
                });

            this.tag.replace(
                {
                    "functionLeaf":
                        {
                            "name": functionLeaf.getName(),
                            "args": functionLeaf.args,
                            "concatArgs": functionLeaf.args.join(',')
                        },
                    "positiveResults": resultData.reduce(function(previousValue,currentValue){
                        if (currentValue.detection.result)
                            return previousValue+1;
                        else
                            return previousValue;
                    },0),
                    "fuzzingSessionsNumber": resultData.length -1,
                    "reference": resultData.find(function(element, index){
                        return element.args == undefined;
                    }),
                    "resultData": resultData.filter(function(element, index){
                        return element.args != undefined;
                    }).map(function(element){
                        return {                                                                        // Here we manually overide all the possible undefined
                           "uuid": element.uuid ? element.uuid : "undefined",                           // results that could alter the rendering
                           "args": element.args ? element.args : "undefined",
                           "response": {
                                "HTML": element.response.HTML ? element.response.HTML : "undefined",
                                "context": element.response.context ?
                                    element.response.context : "undefined",
                                "callStack": element.response.callStack ?
                                    element.response.callStack : "undefined",
                                "value": element.response.value ? element.response.value : "undefined",
                                "error": element.response.error
                           },
                           "detection": {
                               "result": element.detection.result,
                               "info": element.detection.info
                           }
                       }
                    })
                },
                parentNode
            );

            new TableSort(parentNode.ownerDocument.getElementById('fuzzingResultsTable'));

        },

        /**
         * Method called when clicking on the html exerpt in the report
         *
         * @param {Event} event Event when clicking on the html exerpt
         */
        HTMLClick: function(event){
            if (event.button != 0)
                return;

            if (FBTrace.DBG_FIRESTORM && DBG_FIRESTORMPANEL)
                FBTrace.sysout("fireStorm; fireStormPanel.HTMLClick",{
                    "event": event
                });

            Firebug.chrome.selectPanel("html");

            this.insertHTML(Firebug.chrome.getSelectedPanel(), event.target.repObject);

        },

        /**
         * Method called when asking for expanding the detail on a fuzzing session
         *
         * @param  {Event} event Event triggered when clicking on the expanding button
         * @return {void}
         */
        expandRowDetails: function(event){
            if (event.button != 0)
                return;

            var table = Dom.getAncestorByClass(event.target, "fuzzingResultsTable");
            var row = Dom.getAncestorByClass(event.target, "rowElements");

            if (Css.hasClass(event.target, "fs-closed")){

                //Fuzzing Info

                var infoRow = table.insertRow(row.rowIndex+1);

                var td = infoRow.insertCell(0);

                td.setAttribute("colspan","0");
                td.setAttribute("style", "padding-left: 15px;");
                td.appendChild(document.createTextNode(row.repObject.detection.info))

                //Fuzzing errors
                if (row.repObject.response.error){
                    var errorRow = table.insertRow(row.rowIndex+2);

                    var td = errorRow.insertCell(0);

                    td.setAttribute("colspan","0");
                    td.setAttribute("style", "padding-left: 15px; color: red;");
                    td.appendChild(document.createTextNode(row.repObject.response.error))

                    event.target.setAttribute("class", "fs-opened error");
                } else {
                    event.target.setAttribute("class", "fs-opened");
                }

            } else if (Css.hasClass(event.target, "fs-opened")){

                table.deleteRow(row.rowIndex+1)
                Css.removeClass(event.target, "fs-opened");

                if(Css.hasClass(event.target,"error")){
                    Css.removeClass(event.target, "error");
                    table.deleteRow(row.rowIndex+1)
                }

                event.target.setAttribute("class", "fs-closed");
            }

        },

        /**
         * Method to truncate the HTML and present an exerpt in the report
         *
         * @param  {String}     text    String to truncate
         * @param  {Integer}    maxchar Number of maximum character to use
         * @return {String}             Truncated string
         */
        generateExerpt: function(text, maxchar)
        {
            if (!maxchar)
                var maxchar = 30;

            if (text.length > maxchar)
                return text.substring(0,maxchar-3)+"...";
            else
                return text;
        },

        /**
         * Method to parse and open HTML from the page worker and show it in the HTML pad.
         * Taken from firebug/net/xmlviewer
         *
         * @param  {HTMLPanel}  HTMLPanel  HTMl panel
         * @param  {String}     text       HTML String to parse and show
         * @return {void}
         */
        insertHTML: function(HTMLPanel, text)
        {
            var parser = Xpcom.CCIN("@mozilla.org/xmlextras/domparser;1", "nsIDOMParser");
            var doc = parser.parseFromString(text, "text/html");
            var root = doc.documentElement;

            // Error handling
            var nsURI = "http://www.mozilla.org/newlayout/xml/parsererror.xml";
            if (root.namespaceURI == nsURI && root.nodeName == "parsererror")
            {
                this.ParseError.tag.replace({error: {
                    message: root.firstChild.nodeValue,
                    source: root.lastChild.textContent
                }}, parentNode);
                return;
            }

            HTMLPanel.select(doc.documentElement)

            //Firebug.HTMLPanel.CompleteElement.tag.replace({object: doc.documentElement}, parentNode);

        }
    })
}

// ********************************************************************************************* //
// Registration

Firebug.registerPanel(Firebug.FireStormPanel);

Firebug.registerStylesheet("chrome://firestorm/skin/firestorm.css");

if (FBTrace.DBG_FIRESTORM)
    FBTrace.sysout("fireStorm; fireStormPanel.js, stylesheet registered");

return Firebug.FireStormPanel;

// ********************************************************************************************* //
});