text:
#CutforZayn trending hashtag is indicative of a larger mental health problem
By Amy Judd	Online Supervisor BC	Global News
VANCOUVER – Teens and young people are taking to social media to express their outrage and disappointment over the news Zayn Malik has left One Direction.
However, it seems some fans are taking more extreme measures. The hashtag #cutforzayn started trending worldwide following the news.
Jesse Miller with Mediated Reality says this is not shocking. "We saw the same thing with Justin Bieber a couple of years ago," he said. "This is attached to fandom and the use of social media and really getting people to talk about what their passion is. Unfortunately it's taking a turn towards mental health issues that we see in kids cutting."
Miller said once the announcement was made about Zayn leaving the band, the terminology and hashtag #cutforzayn was mentioned 4,600 times a minute on Twitter. "That should be a focus point for most of us in thinking how much passion these fans have to jump online and share."
"Any individual, whether it be a youth or an adult, who's going through emotional upheaval, who's going to choose to cut and then broadcast online, that's very much attached to mental health," added Miller. "The organizations, locally and nationally, that address these issues have to step in and dialogue where they use their official social media channels to talk to their fan base and group."
He said if anyone does have a family member or loved one who might be exhibiting this kind of behaviour, whether documenting it online or not, they must get some help.
"We see a bunch of youth across Canada who have a tendency to go on social websites, like Twitter, Instagram, and document their self-harm, but they also get coached online by people saying 'don't cut your wrist, cut your leg because your parents never look there," said Miller.
He said this is a good chance for parents to talk to their kids about managing their emotions and sharing those thoughts and feelings online.
#CutforZayn


Lottery Wins and Unexpected Fortunes is a article about unexpected lump sum investing written by Sav Savva Independent Financial Adviser.
Paying off debts early can save you a significant amount in interest payments over the long term. Credit cards and overdrafts are normally the first to be paid off as they have the highest interest rates attached to them. You may then wish to consider personal loans, car loans and mortgages. A word of caution though: remember to take into consideration early-repayment charges before deciding to clear debts before they are due.
It is prudent to have access to funds in the event of emergencies. We generally suggest the equivalent of 3-6 months' income for this purpose.
Your pension is what will help to look after you financially in later life. Early contributions can help grow your final balance. There can also be beneficial tax opportunities to pension contributions of which you can take advantage. There are some restrictions to pensions and you will not be able to access them until you are over the age of 55: this rises to 57 in 2028.
When investing, make sure you are making use of your tax allowances by using tax wrappers such as ISAs. However, ensure you are comfortable with the investment risks associated with the potential return offered. An adviser should always assess your attitude to risk, capacity for loss and help select investments that match it. Many investments are designed to be long term in nature and cashing them in early can reduce the potential growth and value paid out. You should always remember that the value of investments (including property) and the income derived from them may go down as well as up.
For many, helping family and friends (with houses, debts and education costs) is something they wish to do when coming into large sums of money. Just be aware that there can be inheritance tax implications for many types of large gifts to friends and family so make sure you discuss this with your financial adviser.
1st Financial Group Ltd are financial experts and can help you.
Call us to make an appointment to discuss your personal needs or Get Started today.
Sav is a real people person with great experience in interacting with people, which he has developed over the course of his career. He moved to Somerset from London and is a family man with a passion for health. You can find him often playing tennis with his daughter, running at local races or watching the latest healthy eating TV programme.


Want to spend your holiday in the beautiful surroundings of Kullu? How about a place much like a heaven itself? Well, the Kullu Valley Hotel is one such abode, which is enveloped by lush green mountains, gushing rivers, and streams and it can make your stay comfortable as well as peaceful. The hotel is centrally located in Akhara Bazar, on the Kullu-Manali National Highway and offers 23 well furnished and spacious rooms with a large window that give a view of the valley. The guests can enjoy the calming surroundings of this hotel and munch on their favorite delegacies, cooked with fresh herbs by expert cooks, who never fails to impress.
The refreshing drinks offered at the lounge are way too amazing and can leave guests in a world of serenity and luxury throughout their stay. Hotel Kullu Valley believes in offering quality service and comfort and the same can be felt once you enter the fascinating ambience of this place.
The Hotel Kullu Valley has 23 well-furnished rooms with all the essential fittings and furniture for a person to stay comfortably. These rooms are categorized Super Deluxe 4—Bedded, Super Deluxe, Standard Deluxe, Deluxe DBR, Standard DBR, and Ordinary DBR. Some of the rooms have very large windows to offer a panoramic view of the lush green Kullu Valley, which looks specifically beautiful during winter.


What are the benefits of MEC?
What role does MEC play in reducing the latency?
IHS Markit, a global research organisation, defines edge compute as being within 20 milliseconds of the end user or device. MEC is able to achieve such low latencies, by hosting applications and services near to the end user / device.
Verizon recently announced that they were able to reduce application latency by half, by deploying MEC infrastructure.
How does MEC help Service Providers to differentiate themselves over Over the Top (OTT) vendors?
Telcos are at a great advantage of supporting low latencies with their infrastructure presence in central offices and cell towers, when compared to OTT service providers.
OTT service providers have partial coverage for edge compute with distributed data centers that are within the 20 milliseconds to 50 milliseconds range, while telcos can hit 5 milliseconds to 20 milliseconds.
A few service providers with an "engineering DNA" would build a home grown infrastructure for MEC. However, many service providers would end up deploying the MEC infrastructure from off-the-shelf MEC vendor products or by partnering with existing Cloud Service Providers.
What are some of the use cases supported by MEC?
How does MEC benefit autonomous cars?
If a network has a 100 milliseconds delay and a car is running at 120 km/hr, if the car detects danger, it would travel over 3 meters further before taking any action. This would potentially mean an accident or a car crash. In order to avoid such crashes or accidents with the current network, the cars need to have larger gaps. With 5G, its single digit millisecond latency will make self driving scenarios safer, while improving road throughput (number of cars/vehicles handled by the road) at the same time.
Is MEC specific to 5G deployments?
What are some communities trying to standardize the MEC stack?
Open Edge Computing Initiative, Cloud Native Compute Foundation and ETSI are communities that are involved in standardizing the MEC stack.
Who are the vendors creating an edge computing stack?
What are the open source communities for edge computing stack?


text:
Macquarie Matters
MQ MATTERS
ALUMNI FOCUS
FROM THE VC'S DESK
Home » Research News (Page 4)
Blood test discovered for MS
An international study, led by Macquarie University researchers Dr Edwin Lim and Professor Gilles Guillemin, has discovered the first blood biomarker – a chemical identifier in the blood – for multiple sclerosis (MS), a debilitating disorder of the central nervous system that affects more than 23,000 Australians and 2.3 million people worldwide. The findings, which took 12 years to di...
How ethnicity and religion can influence financial habit
New research has found that people with a religious or ethnic background are more likely to save money, quelling the long-held belief that income and financial proficiency are the main determinates of an individual's ability to save. Alongside a team of international researchers, Associate Professor Chris Baumann of Macquarie University's Department of Marketing and Management studied low, ...
Creating stepping stones to healthier habitats
More than half of Australia's threatened species occur within the urban fringe: Sydney alone is home to 68 threatened birds, 28 threatened mammals and five threatened frogs. For residents concerned about disappearing wildlife the scale of the issue can be overwhelming, but a new online tool is helping to create wildlife-friendly stopovers between existing corridors. The team at Macquarie'...
Seals help plug Antarctic water mystery
Elephant seals have helped scientists to demonstrate that fresh water from Antarctic's melting ice shelves slows the processes responsible for the formation of deep-water ocean currents that regulate global temperatures. The study was led by Dr Guy Williams from the Institute of Marine and Antarctic Studies and Antarctic Climate and Ecosystems CRC together with Professor Rob Harcourt from...
Ice-aged Aboriginal art uncovered in the Kimberley
What may be the longest, most impressive and complex rock art sequence anywhere in the world has been found in the remote Kimberley region of Western Australia. Evidence from recent excavations in the northwest Kimberley show that humans occupied the northern coastline as early as 36,000 years ago. The art of the region could potentially challenge Western Europe as the location for the p...
Cell colour technology wins Eureka Prize
Professor Ewa Goldys, Deputy Director of the ARC Centre of Excellence for Nanoscale BioPhotonics (CNBP) at Macquarie University, together with CNBP research affiliate Dr Martin Gosnell have won the ANSTO 'Innovative Use of Technology' award at the 2016 Australian Museum Eureka Prizes. They were recognised for their innovative colour-focused research, which is able to distinguish between...
From India to beyond – adrenalin junkie Nishant Patel believes anything is possible
MGSM Global MBA attracts leaders from all over the world
Technology, teamwork, and lot more dancing than you might expect…
More than fitness – Dana finds value for money and community at MQ Sport
Award-winning playwright Kendall Feaver makes it big overseas
Alumni Web Community
Alumni in the Spotlight
Global Alumni Network
Please select... Alumni Web Community Alumni in the Spotlight Alumni Benefits Events Newsroom Global Alumni Network Further Study Supporting Macquarie
Last Updated: Wednesday, 29 February, 2012 | ABN 90 952 801 237 | CRICOS Provider No 00002J
Privacy Statement | Accessibility Information

redpajama_set_name: RedPajamaCommonCrawl


text:
THE ULSTER PROJECT
Alliance, OH
Castlederg
Hutchinson, KS
McPherson, KS
Mahoning Valley, OH
Massillon/Canton, OH
"Transforming Young Christians
Into Leaders & Peacemakers"
The Ulster Project is committed to:
Following Christ as Committed Peace Builders
Fostering Understanding & Acceptance
Working Together to Build Community
Respecting Others & Ourselves
Leading by Example in Serving Others
The troubled & tumultuous history of Northern Ireland is well documented,
and was played out in newspapers & on television screens across the globe.
At the height of the violence, known as "The Troubles", the Ulster Project came into being.
Every year since 1975 the organisation has been working with teenagers in Northern Ireland & the United States, to educate them & develop them as leaders to effect change in their communities.
"Creating Unity, Amidst Diversity"


I've been at Hidcote for just over two weeks now. The time has whizzed by but somehow it seems like I've been here for ages: probably because of the number of things I've managed to cram in, and all the new people and places.
I'm really enjoying work so far, getting to know a new garden with lots of new plants and lots of new type of work. New to me, anyway. No more of the large-scale, "given where we are" work of the SB zone: I am in fiddly central. As a Triad Fellow, I get to work in all areas of the garden and am not confined to one of the three teams' areas. That gives a lovely diversity of work and places to work in: I've been digging up herbaceous in the Old Garden, tidying the Long Borders, weeding in the vegetable garden, deadheading in Mrs Winthrops and all sorts of other things.
And I have been having a good go on the hedge cutting. At Hidcote there are, of course, a lot of hedges. The standard description is that there are 4.5 miles of hedge faces to cut: this takes 4-5 months with 8 members of staff each cutting for two days a week. So as you can guess, hedges are taken very seriously here, with every member of staff (I think) having their own Little Wonder. As part of the renovations over the last 15 years, mains electricity lines have been run to all the areas of the garden with hedges, so no dragging a generator around with you: all you need is a transformer and a looooong cable. Despite the amazing convenience of the electricity supply and the electric hedge cutters (It's so quiet! It's so light!) it still takes a long time to cut the hedges because a standard as close as possible to perfect is required. Absolutely straight lines all round, please. Well, unless it's a bit of topiary, of course. I only work 4 days a week so I will probably only do one day of hedge cutting a week during my time here. So far I've spent two days on hedges that "aren't integral to the design vision" [subtext: it won't matter so much if you *^!* up] and have been judged as producing a pretty good-looking hedge. Who knows what I'll be allowed to cut next?! If you're laughing at this, let it be known that hedges are important and it does matter if they're perfectly straight or not. And no, a little bit wonky is not OK. I've always loved cutting hedges and am quite obsessive so this is perfect for me.
One of the 7 little wonders of Hidcote. Actually, there are more than 7.
Snowshill Manor: Nice, would be better if the NT gave them some resources.
Coughton Court: Quite good, but the walled garden was closed so I don't really know.
Mill Dene: Meh. Don't bother.
Sezincote Estate: Nice bits but the focus is the architecture of the house, not the garden.
Chastleton House: Titchy but sweet. Jacobian topiary, yeah.
Fountains Abbey & Studley Royal Water Gardens: You could have such an epic party here.
Harlow Carr: It's Harlow Carr, what do you expect? Immaculate, of course.
Oh how your blog and the way you put things remind me that you are very like my daughter Emma, in attitude and spirit. Great to know you are enjoying the experiences.


There must be a pan-European policy on migration and asylum, or risk the European Union falling apart, according to the EU's top migration official.
Dimitris Avramopoulos, the European Commission's senior migration official, told a debate in Brussels on Thursday that the migration crisis is testing the values on which the EU was founded.
During an EU committee of the regions debate on 3 December, Avramopoulos, mayor of Athens from 1995-2002, criticised the majority of European countries for failing to do enough to help refugees turning up on the continent's shores after fleeing war, poverty and persecution. Just eight of the 28 EU member states who originally agreed to a fairer distribution of refugees have taken action to resettle people in their own countries, he said.
Regions in the south and east of Europe have been left shouldering most of the burden in the influx of new arrivals. Not only does this test the EU principle of solidarity but also the principle of free movement, according to Avramopoulos. He added that the crisis could threaten the Schengen agreement for a borderless Europe, which he described as the EU's biggest achievement.
During the debate, the committee agreed to back the European commission's agenda on migration, which calls for stronger border controls and a relocation system to resettle refugees across the EU.
The committee, the EU's assembly of local government representatives, has also called for far greater recognition of the role regional and local authorities can play in tackling the crisis, and direct access to European funding for integration and resettlement schemes.
Avramopoulos said anyone resisting the arrival of migrants should remember that Europe is an ageing continent and needs to attract new people, as well as develop strategies to send home those who enter illegally.
The European parliament's co-rapporteur on migration, Cécile Kashetu Kyenge, also lambasted the "short-sighted, egotistical policies of certain member states". Kyenge, a Congolese-Italian politician and member of the European parliament, said the EU should promote a bottom-up approach that involved local authorities in planning and implementing migration policy.
"It is up to them, in practice, to find a way to maintain social cohesion in their communities and to prevent social tensions and extremism," she said.
Some members of the committee voiced more hostile views on the crisis facing Europe. Anna Magyar, a Hungarian politician from Csongrád County, which shares a border with Serbia and has seen clashes between local authorities and refugees with police using tear gas and refugees declaring hunger strikes, said many of the migrants entering Europe were simply looking for a better standard of living.
French politician François Decoster, who comes from Maire de Saint-Omer, about 40km north of Calais, said local authorities are much better placed to determine local need. Speaking to the Guardian, Decoster said the commissioner and French prime minister had visited his region to announce construction of 1,500 shelters. "At the time we had 3,000 people there. The number announced for building shelters was already insufficient," he said.
Decoster called for local authorities to be allowed to bypass their national governments and apply for direct funding from the EU. Each of the 28 EU member states has its own policy; this is one of the reasons why the situation at the border between France and England in Calais is so difficult to resolve, Decoster said.
Decoster, who has been working on the Committee of the Regions' (CoR) response to the European commission's agenda on migration since the spring, said local and regional governments across Europe are given too little political say, too little funding and too little backing. "That must change," he said.
Donald Tusk, president of the European Council, which is made up of the leaders of EU member states, praised CoR members for being at the frontline of European politics and dealing directly with the migrant influx. Tusk, the former Polish prime minister, dropped out of the plenary line-up, but in a recorded video message he told delegates that the EU faced existential threats and needed to decide "what kind of political community we are".


text:
Q: How to get distinct keys as a list from an RDD in pyspark? Here is some example data turned into an RDD:
my_data = [{'id': '001', 'name': 'Sam', 'class': "classA", 'age': 15, 'exam_score': '90'},
           {'id': '002', 'name': 'Tom', 'class': "classA", 'age': 15, 'exam_score': '78'},
           {'id': '003', 'name': 'Ben', 'class': "classB", 'age': 16, 'exam_score': '91'},
           {'id': '004', 'name': 'Max', 'class': "classB", 'age': 16, 'exam_score': '76'},
           {'id': '005', 'name': 'Ana', 'class': "classA", 'age': 15, 'exam_score': '88'},
           {'id': '006', 'name': 'Ivy', 'class': "classA", 'age': 16, 'exam_score': '77'},
           {'id': '007', 'name': 'Eva', 'class': "classB", 'age': 15, 'exam_score': '86'},
           {'id': '008', 'name': 'Zoe', 'class': "classB", 'age': 16, 'exam_score': '89'}]

my_rdd = sc.parallelize(my_data)

Running my_rdd by itself returns:
#>>> ParallelCollectionRDD[117] at readRDDFromFile at PythonRDD.scala:274

And I know you can display the RDD with my_rdd.collect() which returns:
#[{'age': 15,
#  'class': 'classA',
#  'exam_score': '90',
#  'id': '001',
#  'name': 'Sam'},
# {'age': 15,
#  'class': 'classA',
#  'exam_score': '78',
#  'id': '002',
#  'name': 'Tom'}, ...]

I have found that I can access the keys by running my_rdd.keys(), but this returns:
#>>> PythonRDD[121] at RDD at PythonRDD.scala:53

I want to return a list of all the distinct keys (I know the keys are the same for each line but for a scenario where they aren't I would like to to know) in the RDD - so something that looks like this:
#>>> ['id', 'name', 'class', 'age', 'exam_score']

So with this I assumed I could get this by running my_rdd.keys().distinct.collect() but I get an error instead.
I'm still learning pyspark so I would really appreciate if someone could provide some input :)

A: my_data = [{'id': '001', 'name': 'Sam', 'class': "classA", 'age': 15, 'exam_score': '90'},
           {'id': '008', 'name': 'Zoe', 'xxxxx': "classB", 'age': 16, 'exam_score': '89'},
           {'id': '007', 'name': 'Eva', 'class': "classB", 'age': 15, 'exam_score': '86'},
        ]

my_rdd = sc.parallelize(my_data)

key_rdd = my_rdd.flatMap(lambda x: x) # flatMap

print( key_rdd.collect() )
# ['id', 'name', 'class', 'age', 'exam_score', 'id', 'name', 'xxxxx', 'age', 'exam_score', 'id', 'name', 'class', 'age', 'exam_score']
print( key_rdd.distinct().collect() )
# ['class', 'id', 'exam_score', 'age', 'name', 'xxxxx']

redpajama_set_name: RedPajamaStackExchange


The Rise of "No-Click Search Results"
This means people around the world perform more than 40,000 unique searches every second and more than 3.5 billion searches per day.
The number of Google searches keeps growing, but the way that people are searching is changing. The number of "No Click" searches, especially on mobile, is on the rise. Google is continuing to adapt their algorithm to answer its user's questions on the Search Engine Results Page, or the SERP so that they don't even have to click through to a company's site.
Basically, Google is getting even better at answering user's questions. For many search entries, Google will show featured information from one of the top results and put it at the top of the page as an answer to the search. People are seeing the answer they searched for on the search page in the form of "universal search results." Universal search results include map packs, answer boxes, instant answers, and other aggregated information from top-ranking results pages.
Users can get most of their answers (like: "what time does the movie start" or "where is the restaurant located", without clicking thru a website.
The value of these universal search results will only continue to rise in the future. It is incredibly important for companies to recognize the rising trend of the "No Click" search and just how many answers are being found on the actual SERP itself.
Research has shown that the click-through rates on organic listings have also taken a hit ever since the introduction of universal results. Organic is still the main player in SEO, with 70% of the links that users click on are organic.
Organic search results are still the driving factor in Google's universal search result algorithms. It is critical to have optimized organic content in order to get your site in the universal search result types, which are answering user's questions the quickest.
Not sure where to start your SEO efforts? We'd love to help! Contact us.


text:
Rockies 2014 player grades: LaTroy Hawkins, RHP
By Nick Groke
Goose Gossage, LaTroy Hawkins, Rex Brothers, Tommy Kahnle
Colorado Rockies relief pitcher LaTroy Hawkins. (Lynne Sladky, The Associated Press)
BSvs
57 54.1 3.31 32 13 23 3 3 1.196
LaTroy Hawkins seemed really offended when I asked him the question. After he pitched a hitless ninth inning to earn a win in the Rockies' comeback 7-6 victory over Arizona at Coors Field on Sept. 18, Hawkins made his 996th career appearance.
The Rockies, at that point, had nine games remaining. He needed four appearances to reach a major milestone. That's an appearance every other day down the stretch, basically. In a lost season, when the games stopped mattering much, that's a lot of action to demand of a 41-year-old arm.
So I asked: "Do you think you'll even have the opportunity to reach 1,000 games? Will Weiss call on you enough?"
He snapped: "Oh, I'll get to 1,000. No question."
"You mean this season or next year?"
"I'll get it this season, no doubt."
At that point, I started wondering, why is he rushing it? Is he racing to 1,000 because he's about to retire?
Turns out, all those questions were too curious. Hawkins simply was motivated. It's probably the same motivation that will propel him to a 21st major-league season in 2015 at the age of 42.
Over that remaining week-plus, Hawkins pitched three total innings over four games. He allowed one hit and no runs. And he played in his 1,000th big-league game on Sept. 27 against the Dodgers in L.A.
"A lot of managers had a lot of faith in me," Hawkins said that day. "A lot of good teammates, a lot of good mentors in the game. Plenty of blessings from the man upstairs to stay healthy."
And Hawkins will add to that total in one more season, likely his last. The Rockies last week picked up his $2.25 million option for 2015.
"I anticipated coming back and I'm excited," Hawkins said. "It gives me one more season in the big leagues and I get to come back to Colorado. I really think that if we can stay healthy next year that we can make some noise."
Hawkins needs just three games to pass Goose Gossage for 15th on the list of most appearances by a pitcher. And he could pass Trevor Hoffman to reach the Top 10 later in the season.
That's what Hawkins has to look forward to. But what will the Rockies get from their 42-year-old closer?
In 2014, Hawkins owned the third-best ERA among Rockies pitchers at 3.31, trailing only Brett Anderson and reliever Brooks Brown (who pitched half as many innings). Hawkins was the most consistent pitcher in purple last season.
Hawkins' 2014 was impressively boring. He allowed only three home runs — for a 0.5 HR/9 average, best on the team. His 1.196 WHIP was second-best, behind only Tommy Kahnle. His ERA and WHIP certainly aren't elite league-wide. But for the Rockies, that's admirable.
He didn't strike out a lot of batters (his K/9 average of 5.3 was among the three-lowest numbers on the team), but that might speak more to his veteran focus on smart outs as opposed to power. That number is near his career K/9 average of 6.0 and it was higher than two of his past three seasons.
There seems to be some negative focus on Hawkins' BABIP in 2014, suggesting he's due for some serious regression next season. But that might be misguided.
Sure, he held batters to a .275 average on balls in play last season. But that number isn't skewed by an irregularly low number at Coors Field. He did it on the road, in more normal circumstances (.300 BABIP at Coors vs. .235 on the road).
And, in scouting how Hawkins might fare in 2015, it's worth looking at his recent past. He's finished with an ERA above 4.00 just once in the past eight seasons. In his past four seasons, with the Brewers, Angels, Mets and Rockies, Hawkins pitched 215.1 innings over 229 games, with 73 earned runs — for a 3.05 ERA.
The Rockies signed Hawkins before 2014 as a place-holder closer before Rex Brothers took over the role full time. But those plans were scuttled. Now, going to 2015, Colorado has a presumptive closer or, depending on additions, a reliable late-inning arm.
It's easy to dismiss a dude who was drafted BNN (1991, before Nirvana's 'Nevermind'). But Hawkins has found a late-career groove without a hint of missing motivation.
2014 Salary: $2.25 million
Stat of Note: 0.5 … HRs per nine innings average. Hawkins' had the best HR/9 average on a team that was killed by the long ball, allowing the most home runs in baseball (173 in 2014, for a staff 1.1 HR/9 average).
GRADE: A-minus
FIND ALL THE ROCKIES' 2014 PLAYER GRADES HERE.
Categories: General Rockies, Player Grades
Sorting out trade speculation on Rockies' Gonzalez, Tulo, Cuddyer, Morneau
Inside look at Nolan Arenado and D.J. LeMahieu, Rockies Gold Glove winners


text:
class Vulnreport < Sinatra::Base
	post '/admin/settings/cache/evict/?' do
		key = params[:key]

		if(!settings.redis.get(key).nil?)
			settings.redis.del(key)
		end

		return 200
	end

	get '/admin/settings/cache/?' do
		@hits = getSetting("cache_hits").to_i + settings.redis.get("cache_hits").to_i
		@misses = getSetting("cache_misses").to_i + settings.redis.get("cache_misses").to_i

		if(@hits == 0 && @misses == 0)
			@pct = 0
		else
			@pct = (@hits.to_f/(@hits.to_f+@misses.to_f))
		end

		keys = settings.redis.keys
		@keysTTL = Array.new
		keys.each do |k|
			@keysTTL << {:key => k, :ttl => settings.redis.ttl(k)}
		end

		erb :admin_vr_cache_settings
	end

	get '/admin/settings/mail/?' do
		@vr_mail_method = getSetting('VR_MAIL_METHOD')
		@vr_from_email = getSetting('VR_NOREPLY_EMAIL')

		if(@vr_mail_method == 'custom')
			@vr_mail_addr = getSetting('VR_MAIL_ADDR')
			@vr_mail_port = getSetting('VR_MAIL_PORT').to_i
			@vr_mail_domain = getSetting('VR_MAIL_DOMAIN')
			@vr_mail_user = getSetting('VR_MAIL_USER')
			@vr_mail_pass = getSetting('VR_MAIL_PASS')
		end

		erb :admin_vr_mail_settings
	end

	post '/admin/settings/mail/?' do
		vr_mail_method = params[:vr_mail_method].strip
		if(vr_mail_method != "sendmail" && vr_mail_method != "custom")
			vr_mail_method = "sendmail"
		end

		vr_from_email = params[:vr_from_email].strip

		setSetting('VR_MAIL_METHOD', vr_mail_method)
		setSetting('VR_NOREPLY_EMAIL', vr_from_email) unless (vr_from_email.nil? || vr_from_email.empty?)

		if(vr_mail_method == 'custom')
			vr_mail_addr = params[:vr_mail_addr].strip
			vr_mail_port = params[:vr_mail_port].to_i
			vr_mail_domain = params[:vr_mail_domain].strip
			vr_mail_user = params[:vr_mail_user].strip
			vr_mail_pass = params[:vr_mail_pass].strip

			setSetting('VR_MAIL_ADDR', vr_mail_addr) unless vr_mail_addr.nil?
			setSetting('VR_MAIL_PORT', vr_mail_port.to_s) unless vr_mail_port.nil?
			setSetting('VR_MAIL_DOMAIN', vr_mail_domain) unless vr_mail_domain.nil?
			setSetting('VR_MAIL_USER', vr_mail_user) unless vr_mail_user.nil?
			setSetting('VR_MAIL_PASS', vr_mail_pass) unless (vr_mail_pass.nil? || vr_mail_pass.empty?)

			Pony.options = {
				:via => :smtp,
				:via_options => {
					:address => getSetting('VR_MAIL_ADDR'),
					:port => getSetting('VR_MAIL_PORT').to_i,
					:domain => getSetting('VR_MAIL_DOMAIN'),
					:user_name => getSetting('VR_MAIL_USER'),
					:password => getSetting('VR_MAIL_PASS'),
					:authentication => :plain,
					:enable_starttls_auto => true
				}
			}
		else
			Pony.options = {
				:via => :sendmail
			}
		end

		redirect "/admin/settings/mail"
	end

	get '/admin/settings/?' do
		@vr_name = getSetting('VR_INS_NAME')
		@vr_root = getSetting('VR_ROOT')
		@vr_footer = getSetting('VR_FOOTER')
		@sshotMaxSize = getSetting('SSHOT_MAX_SIZE_KB')
		@payloadMaxSize = getSetting('PAYLOAD_MAX_SIZE_KB')
		@pdf_on = (getSetting('PDF_EXPORT_ON') == 'true')

		@sso_auth = (getSetting('AUTH_SSO_ENABLED') == 'true')
		@autoadd = (getSetting('AUTO_ADD_USERS') == 'true')
		@sso_name = getSetting('AUTH_SSO_NAME')
		@sso_issuer = getSetting('AUTH_SSO_ISSUER')
		@sso_target_url = getSetting('AUTH_SSO_TARGET_URL')
		@sso_cert_fingerprint = getSetting('AUTH_SSO_CERT_FINGERPRINT')

		@login_auth = (getSetting('AUTH_LOGIN_ENABLED') == 'true')
		@login_pwlen = getSetting('AUTH_LOGIN_PWLEN')

		@ip_restrictions = (getSetting('IP_RESTRICTIONS_ON') == 'true')
		@ip_restrictions_allowed = getSetting('IP_RESTRICTIONS_ALLOWED')

		@app_version = Vulnreport::VERSION::STRING
		@app_hostname = %x{hostname}

		erb :admin_vr_settings
	end

	post '/admin/settings/?' do
		vr_name = params[:vr_name].strip
		vr_root = params[:vr_root].strip
		vr_footer = params[:vr_footer].strip
		sshotMaxSize = params[:sshotMaxSize].strip.to_i
		payloadMaxSize = params[:payloadMaxSize].strip.to_i
		pdf_on = (!params[:pdf_on].nil?)

		sso_auth = (!params[:sso_auth].nil?)
		autoCreate = (!params[:autoCreate].nil?)
		sso_name = params[:sso_name].strip
		sso_issuer = params[:sso_issuer].strip
		sso_target_url = params[:sso_target_url].strip
		sso_cert_fingerprint = params[:sso_cert_fingerprint].strip

		login_auth = (!params[:login_auth].nil?)
		login_pwlen = params[:login_pwlen].strip

		ip_restrictions = (!params[:ip_restrictions].nil?)
		ip_restrictions_allowed = params[:ip_restrictions_allowed].strip
		if(!ip_restrictions_allowed.nil? && !ip_restrictions_allowed.empty?)
			ip_allowed_arr = ip_restrictions_allowed.split(",")
			ip_allowed_arr.map!{|s| s.strip}
		else
			#Don't allow IP restrictions to be turned on with nothing allowed
			ip_restrictions = false
		end

		if(!vr_name.nil? && !vr_name.empty?)
			setSetting('VR_INS_NAME', vr_name)
			settings.vrname = vr_name
		end

		setSetting('VR_ROOT', vr_root) unless (vr_root.nil? || vr_root.empty?)

		if(!vr_footer.nil? && !vr_footer.empty?)
			setSetting('VR_FOOTER', vr_footer)
			settings.vrfooter = vr_footer
		end

		if(sshotMaxSize <= 0 || sshotMaxSize > (1024*1024*12))
			sshotMaxSize = 2048
		end

		if(payloadMaxSize <= 0 || payloadMaxSize > (1024*1024*12))
			payloadMaxSize = 2048
		end

		setSetting('SSHOT_MAX_SIZE_KB', sshotMaxSize.to_s)
		setSetting('PAYLOAD_MAX_SIZE_KB', payloadMaxSize.to_s)
		setSetting('PDF_EXPORT_ON', pdf_on)

		setSetting('AUTH_SSO_ENABLED', sso_auth)
		setSetting('AUTO_ADD_USERS', autoCreate)
		setSetting('AUTH_SSO_NAME', sso_name)
		setSetting('AUTH_SSO_ISSUER', sso_issuer)
		setSetting('AUTH_SSO_TARGET_URL', sso_target_url)
		setSetting('AUTH_SSO_CERT_FINGERPRINT', sso_cert_fingerprint)

		setSetting('AUTH_LOGIN_ENABLED', login_auth)
		setSetting('AUTH_LOGIN_PWLEN', login_pwlen)

		setSetting('IP_RESTRICTIONS_ON', ip_restrictions)
		setSetting('IP_RESTRICTIONS_ALLOWED', ip_allowed_arr.join(',')) unless ip_allowed_arr.nil?

		redirect "/admin/settings"
	end

	get '/admin/users/new/?' do
		@orgs = Organization.all()

		erb :admin_user_new
	end

	post '/admin/users/new/?' do
		newVerified = false
		if (!params[:isVerified].nil?)
			newVerified = true
		end
		newOrg = 0 if !newVerified

		newReportsOnly = false
		if(!params[:isReportsOnly].nil?)
			newReportsOnly = true
		end

		newAdmin = false
		if (!params[:isAdmin].nil? && !newReportsOnly)
			newAdmin = true
		end

		newName = params[:userName].strip
		newInits = params[:userInitials].strip
		newEmail = params[:userEmail].strip

		newOrg = params[:userOrg].to_i
		if(!newVerified)
			newOrg = 0
		end

		newSSOUser = nil
		newSSOUser = nil
		newUsername = nil
		newPassword = nil

		sso_auth = (getSetting('AUTH_SSO_ENABLED') == 'true')
		login_auth = (getSetting('AUTH_LOGIN_ENABLED') == 'true')

		if(sso_auth)
			newSSOUser = params[:sso_user].strip
			newSSOUID = params[:sso_id].strip

			if(newSSOUser.nil? || newSSOUser == "" || newSSOUID.nil? || newSSOUID == "")
				errstr = "SSO Information must be entered"
				return erb :error
			end
		end

		if(login_auth)
			newUsername = params[:login_user].strip
			newPassword = params[:login_password].strip
		end

		@user = User.create(:username => newUsername, :password => newPassword, :sso_user => newSSOUser, :sso_id => newSSOUID, :email => newEmail, :name => newName, :initials => newInits, :org => newOrg, :admin => newAdmin, :reportsOnly => newReportsOnly)

		if(!@user.saved?)
			errstr = "Error saving user"
			return erb :error
		end

		redirect "/admin/users/#{@user.id}"
	end

	get '/admin/users/:uid/?' do
		@user = User.get(params[:uid])
		if(@user.nil?)
			@errstr = "User not found"
			return erb :error
		end

		@orgs = Organization.all()
		@logins = AuditRecord.all(:event_type => [EVENT_TYPE::USER_LOGIN, EVENT_TYPE::USER_LOGIN_FAILURE], :actor => @user.id, :order => [:event_at.desc], :limit => 10)

		erb :admin_user_single
	end

	post '/admin/users/:uid/resetpw' do
		@user = User.get(params[:uid])
		if(@user.nil?)
			return 404
		end

		pwlen = getSetting("AUTH_LOGIN_PWLEN").to_i
		if(pwlen == 0)
			pwlen = 12
		end

		@newpass = SecureRandom.base64(pwlen)[0..(pwlen-1)]
		@user.password = @newpass
		if(@user.save)
			renderer = ERB.new(File.open("views/emails/passResetEmail.erb", "rb").read)
			body = renderer.result(binding)

			fromEmail = getSetting('VR_NOREPLY_EMAIL')
			Pony.mail(:to => @user.email, :from => fromEmail, :subject => "Vulnreport Password Reset", :html_body => body)

			return 200
		else
			Rollbar.error("Error saving user for password reset", {:uid => @user.id, :error => @user.errors.inspect})
			return 500
		end
	end

	post '/admin/users/:uid/?' do
		@user = User.get(params[:uid])
		if(@user.nil?)
			@errstr = "User not found"
			return erb :error
		end

		newVerified = (!params[:isVerified].nil?)
		@user.org = 0 if !newVerified

		newActive = (!params[:isActive].nil?)
		@user.active = newActive

		newReportsOnly = (!params[:isReportsOnly].nil?)
		@user.reportsOnly = newReportsOnly

		newAllocationUser = (!params[:isAllocationUser].nil? && !newReportsOnly)
		@user.useAllocation = newAllocationUser

		newAllocCoeff = params[:allocCoeff].to_i
		newAllocCoeff = 12 if(newAllocCoeff <= 0)
		@user.allocCoeff = newAllocCoeff

		newAdmin = (!params[:isAdmin].nil? && !newReportsOnly)
		@user.admin = newAdmin

		newAuditor = (!params[:isAuditor].nil? && !newReportsOnly)
		@user.canAuditMonitors = newAuditor

		newConPasser = (!params[:isConPasser].nil? && !newReportsOnly)
		@user.canPassToCon = newConPasser

		newRequireApproval = (!params[:isApprovalRequired].nil?)
		@user.requireApproval = newRequireApproval

		if(newRequireApproval)
			newApproverUsers = Array.new
			if(!params[:approver_users].nil?)
				params[:approver_users].each do |uid|
					newApproverUsers << uid.to_i
				end
			end
			newApproverUsers = nil if(newApproverUsers.size == 0)
			@user.approver_users = newApproverUsers

			newApproverOrgs = Array.new
			if(!params[:approver_orgs].nil?)
				params[:approver_orgs].each do |oid|
					newApproverOrgs << oid.to_i
				end
			end
			newApproverOrgs = nil if(newApproverOrgs.size == 0)
			@user.approver_orgs = newApproverOrgs
		else
			@user.approver_users = nil
			@user.approver_orgs = nil
		end

		newName = params[:userName].strip
		@user.name = newName unless newName.nil?

		newEmail = params[:email].strip
		@user.email = newEmail unless (newEmail.nil? || !isValidEmail?(newEmail))

		newInits = params[:userInitials].strip
		@user.initials = newInits unless newInits.nil?

		newExtEID = params[:user_ext_eid].strip
		@user.extEID = newExtEID unless newExtEID.nil?

		newOrg = params[:userOrg].to_i
		if(!newVerified)
			@user.org = 0
		else
			@user.org = newOrg unless newOrg == 0
		end

		newGeo = params[:userGeo].to_i
		@user.defaultGeo = newGeo unless newGeo == 0

		if(getSetting('AUTH_SSO_ENABLED') == 'true')
			newSSOUser = params[:sso_user].strip
			@user.sso_user = newSSOUser unless newSSOUser.nil?

			newSSOId = params[:sso_id].strip
			@user.sso_id = newSSOId unless newSSOId.nil?
		end

		if(getSetting('AUTH_LOGIN_ENABLED') == 'true')
			newUsername = params[:login_user]
			@user.username = newUsername unless newUsername.nil?
		end

		@user.save

		redirect "/admin/users/#{@user.id}"
	end

	get '/admin/users/:uid/loginhistory/?' do
		@user = User.get(params[:uid])
		if(@user.nil?)
			@errstr = "User not found"
			return erb :error
		end

		#Offset parse
		lim = 50

		if(params[:os].nil?)
			offset = 0
		else
			offset = params[:os].to_i
		end
		@total = AuditRecord.count(:event_type => [EVENT_TYPE::USER_LOGIN, EVENT_TYPE::USER_LOGIN_FAILURE], :actor => @user.id)

		@start = offset+1
		@end = (offset+lim > @total) ? @total : (offset+lim)

		@next = nil
		if(offset+lim < @total)
			@next = offset+lim
		end

		@last = nil
		if(offset > 0)
			@last = offset-lim
			if(@last < 0)
				@last = 0
			end
		end

		@logins = AuditRecord.all(:event_type => [EVENT_TYPE::USER_LOGIN, EVENT_TYPE::USER_LOGIN_FAILURE], :actor => @user.id, :order => [:event_at.desc], :limit => lim, :offset => offset)

		erb :admin_user_single_loginhistory
	end

	get '/admin/users/?' do
		@adminUsers = Array.new
		@conUsers = Array.new
		@activeUsers = Array.new
		@roUsers = Array.new
		@unverified = Array.new
		@inactive = Array.new

		User.all().each do |u|
			org = Organization.get(u.org) unless u.org == 0

			status = "Active"
			if(!u.active)
				status = "Inactive"
			elsif(u.admin && u.org != 0)
				status = "Admin"
			elsif(u.reportsOnly && u.org != 0)
				status = "Reports Only"
			elsif(u.org == 0)
				status = "Unverified"
			end

			lastLogin = u.lastLogin
			lastLoginStr = ""

			if(!lastLogin.nil?)
				lastLoginStr = lastLogin.event_at.strftime('%-d %b %Y - %H:%M')
				if(lastLogin.blobObj[:type] == 'sso')
					lastLoginStr += " (SSO)"
				else
					lastLoginStr += " (direct)"
				end
			end

			if(!u.active)
				if(u.org == 0)
					@inactive << {:uid => u.id, :name => u.name, :inits => u.initials, :status => status, :org => "", :oid => 0, :email => u.email, :lastLogin => lastLoginStr}
				else
					@inactive << {:uid => u.id, :name => u.name, :inits => u.initials, :status => status, :org => org.name, :oid => org.id, :email => u.email, :lastLogin => lastLoginStr}
				end
			else
				if(u.admin && u.org != 0)
					@adminUsers << {:uid => u.id, :name => u.name, :inits => u.initials, :status => status, :org => org.name, :oid => org.id, :email => u.email, :lastLogin => lastLoginStr}
				end

				if(u.org != 0)
					if(org.contractor)
						@conUsers << {:uid => u.id, :name => u.name, :inits => u.initials, :status => status, :org => org.name, :oid => org.id, :email => u.email, :lastLogin => lastLoginStr}
					elsif(u.reportsOnly)
						@roUsers << {:uid => u.id, :name => u.name, :inits => u.initials, :status => status, :org => org.name, :oid => org.id, :email => u.email, :lastLogin => lastLoginStr}
					else
						@activeUsers << {:uid => u.id, :name => u.name, :inits => u.initials, :status => status, :org => org.name, :oid => org.id, :email => u.email, :lastLogin => lastLoginStr}
					end
				else
					@unverified << {:uid => u.id, :name => u.name, :inits => u.initials, :status => status, :email => u.email, :lastLogin => lastLoginStr}
				end
			end
		end

		@adminUsers.sort!{|x,y| x[:name].split(" ").last <=> y[:name].split(" ").last }
		@conUsers.sort!{|x,y| x[:name].split(" ").last <=> y[:name].split(" ").last }
		@activeUsers.sort!{|x,y| x[:name].split(" ").last <=> y[:name].split(" ").last }
		@roUsers.sort!{|x,y| x[:name].split(" ").last <=> y[:name].split(" ").last }
		@inactive.sort!{|x,y| x[:name].split(" ").last <=> y[:name].split(" ").last }

		erb :admin_users
	end

	get '/admin/orgs/new/?' do
		erb :admin_org_new
	end

	post '/admin/orgs/new/?' do
		newSuper = false
		if (!params[:isSuper].nil?)
			newSuper = true
		end

		newContractor = false
		if (!params[:isCon].nil?)
			newContractor = true
			newSuper = false
		end

		newName = params[:orgName].strip

		org = Organization.create(:name => newName, :super => newSuper, :contractor => newContractor)
		org.save

		redirect "/admin/orgs/"
	end

	get '/admin/orgs/:oid/?' do
		@org = Organization.get(params[:oid])
		@orgs = Organization.all()

		if(@org.nil?)
			@errstr = "Org not found"
			return erb :error
		end

		@users = Array.new
		User.all(:org => @org.id).each do |u|
			status = "Active"
			if(!u.active)
				status = "Inactive"
			elsif(u.admin && u.org != 0)
				status = "Admin"
			elsif(u.reportsOnly && u.org != 0)
				status = "Reports Only"
			elsif(u.org == 0)
				status = "Unverified"
			end

			@users << {:uid => u.id, :name => u.name, :inits => u.initials, :status => status, :org => @org.name, :oid => @org.id, :email => u.email}
		end

		@appRecordTypes = RecordType.allAppRecordTypes()
		@allowedRTs = getAllowedRTsForOrg(@org.id)

		@dashConfigs = DashConfig.all(:active => true)

		erb :admin_org_single
	end

	post '/admin/orgs/:oid/?' do
		@org = Organization.get(params[:oid])
		if(@org.nil?)
			@errstr = "Org not found"
			return erb :error
		end

		newSuper = false
		if (!params[:isSuper].nil?)
			newSuper = true
		end

		newCanReport = false
		if (!params[:canReport].nil?)
			newCanReport = true
		end

		newContractor = false
		if (!params[:isCon].nil?)
			newContractor = true
			newSuper = false
		end

		newRequireApproval = (!params[:isApprovalRequired].nil?)
		@org.requireApproval = newRequireApproval

		if(newRequireApproval)
			newApproverUsers = Array.new
			if(!params[:approver_users].nil?)
				params[:approver_users].each do |uid|
					newApproverUsers << uid.to_i
				end
			end
			newApproverUsers = nil if(newApproverUsers.size == 0)
			@org.approver_users = newApproverUsers

			newApproverOrgs = Array.new
			if(!params[:approver_orgs].nil?)
				params[:approver_orgs].each do |oid|
					newApproverOrgs << oid.to_i
				end
			end
			newApproverOrgs = nil if(newApproverOrgs.size == 0)
			@org.approver_orgs = newApproverOrgs
		else
			@org.approver_users = nil
			@org.approver_orgs = nil
		end

		@org.super = newSuper
		@org.canReport = newCanReport
		@org.contractor = newContractor

		newName = params[:orgName].strip
		@org.name = newName unless newName.nil?

		if(params[:dashConfig].to_i != @org.dashconfig)
			#Set all org users to the new choice
			User.all(:org => @org.id).update(:dashOverride => -1)
		end
		@org.dashconfig = params[:dashConfig].to_i

		@org.save

		allowedRTs = Array.new
		if(!params[:rtms].nil?)
			params[:rtms].each do |rtid|
				allowedRTs << rtid.to_i
			end
		end

		allowedRTs.each do |rtid|
			if(!orgAllowedRT?(@org.id, rtid))
				allowRTForOrg(@org.id, rtid)
			end
		end

		RecordType.allAppRecordTypes().each do |rt|
			if(!allowedRTs.include?(rt.id) && orgAllowedRT?(@org.id, rt.id))
				removeRTForOrg(@org.id, rt.id)
			end
		end

		redirect "/admin/orgs/#{@org.id}"
	end

	get '/admin/orgs/:oid/delete/?' do
		@org = Organization.get(params[:oid])
		if(@org.nil?)
			@errstr = "Org not found"
			return erb :error
		end

		@orgOptions = Organization.all(:id.not => @org.id)
		@users = User.all(:org => @org.id)

		erb :admin_org_delete_conf
	end

	post '/admin/orgs/:oid/delete/?' do
		@org = Organization.get(params[:oid])
		if(@org.nil?)
			@errstr = "Org not found"
			return erb :error
		end

		confirm = false
		if(params[:confirm].downcase == "confirm")
			confirm = true
		end

		if(!confirm)
			redirect "/admin/orgs/#{@org.id}"
			return
		else
			newOrgId = params[:newOrg].to_i
			if(newOrgId == @org.id)
				@errstr = "Invalid migration org"
				return erb :error
			end

			newOrg = Organization.get(newOrgId)
			if(newOrg.nil?)
				@errstr = "Invalid migration org"
				return erb :error
			end

			#Move Users
			User.all(:org => @org.id).each do |u|
				u.org = newOrgId
				if(!u.save)
					@errstr = "Problem moving user - #{u.errors.inspect}"
					return erb :error
				end
			end

			#Move over apps and tests
			Test.all(:org_created => @org.id).each do |t|
				t.org_created = newOrgId
				if(!t.save)
					@errstr = "Problem moving test - #{t.errors.inspect}"
					return erb :error
				end
			end

			Application.all(:org_created => @org.id).each do |a|
				a.org_created = newOrgId
				if(!a.save)
					@errstr = "Problem moving test - #{a.errors.inspect}"
					return erb :error
				end
			end

			#Delete perm links for RTs
			Link.all(:fromType => LINK_TYPE::ORGANIZATION, :fromId => @org.id, :toType => LINK_TYPE::ALLOW_APP_RT).destroy

			#Delete the org
			@org.destroy

			redirect "/admin/orgs/#{newOrgId}"
			return
		end
	end

	get '/admin/orgs/?' do
		@superOrgs = Array.new
		@regOrgs = Array.new
		@conOrgs = Array.new

		Organization.all().each do |o|
			if(o.super)
				@superOrgs << {:id => o.id, :name => o.name, :num => User.count(:org => o.id)}
				if(!o.contractor)
					@regOrgs << {:id => o.id, :name => o.name, :num => User.count(:org => o.id)}
				end
			else
				if(o.contractor)
					@conOrgs << {:id => o.id, :name => o.name, :num => User.count(:org => o.id)}
				else
					@regOrgs << {:id => o.id, :name => o.name, :num => User.count(:org => o.id)}
				end
			end
		end

		erb :admin_orgs
	end

	get '/admin/vulntypes/new/?' do
		@appRecordTypes = RecordType.appRecordTypes()

		erb :admin_vt_new
	end

	post '/admin/vulntypes/new/?' do
		newEnabled = false
		if (!params[:isEnabled].nil?)
			newEnabled = true
		end

		newName = params[:vtName].strip
		newLabel = params[:vtLabel].strip
		newCwe = params[:cwe].strip.to_i
		if(newCwe <= 0)
			newCwe = nil
		end
		newPri = params[:vtPri].to_i
		newHtml = params[:html].strip

		newRts = Array.new
		if(!params[:rtms].nil?)
			params[:rtms].each do |rtid|
				newRts << rtid.to_i
			end
		end

		newSecs = Array.new
		if(!params[:secms].nil?)
			params[:secms].each do |sid|
				newSecs << sid.to_i
			end
		end

		vt = VulnType.create(:name => newName, :label => newLabel, :cwe_mapping => newCwe, :priority => newPri, :html => newHtml, :enabled => newEnabled, :enabledRTs => newRts, :enabledSections => newSecs)

		redirect "/admin/vulntypes/"
	end

	get '/admin/vulntypes/export/?' do
		vulnTypes = VulnType.all()

		builder = Nokogiri::XML::Builder.new do |xml|
			xml.vulntypes{
				vulnTypes.each do |vt|
					xml.vulntype{
						xml.name vt.name
						xml.label vt.label
						xml.cwe vt.cwe_mapping
						xml.html vt.html
						xml.priority vt.priority
						xml.enabledSections vt.enabledSections
					}
				end
			}
		end

		attachment "vulntypes.xml"
		return builder.to_xml
	end

	get '/admin/vulntypes/import/?' do
		erb :admin_vt_import
	end

	post '/admin/vulntypes/import/?' do
		data = params[:vt_import]

		filesize = (File.size(data[:tempfile]).to_f)/1024
		if(filesize > 1024)
			@errstr = "XML File too large - Max 1MB"
			return erb :error
		end

		file = File.open(data[:tempfile], "rb")
		doc = Nokogiri::XML(file)

		@vts = Array.new
		doc.xpath("//vulntype").each do |vt|
			vtname = vt.at_xpath(".//name").children.first.text.to_s

			vtlabel = vt.at_xpath(".//label").children
			if(!vtlabel.nil? && vtlabel.size > 0)
				vtlabel = vtlabel.first.text.to_s
			else
				vtlabel = nil
			end

			vtcwe = vt.at_xpath(".//cwe").children
			if(!vtcwe.nil? && vtcwe.size > 0)
				vtcwe = vtcwe.first.text.to_i
			else
				vtcwe = nil
			end

			vtpriority = vt.at_xpath(".//priority").children
			if(!vtpriority.nil? && vtpriority.size > 0)
				vtpriority = vtpriority.first.text.to_i
			else
				vtpriority = nil
			end

			vtenabled = vt.at_xpath(".//enabledSections").children.first.text.gsub("[","").gsub("]","").split(",").map{|s| s.to_i}

			vthtml = vt.at_xpath(".//html").children
			if(!vthtml.nil? && vthtml.size > 0)
				vthtml = vthtml.first.text.to_s
			else
				vthtml = nil
			end

			newvt = {:name => vtname, :label =>vtlabel, :cwe => vtcwe, :priority => vtpriority, :enabled => vtenabled, :html => vthtml}
			@vts << newvt
		end

		@appRecordTypes = RecordType.appRecordTypes()

		erb :admin_vt_import_confirm
	end

	post '/admin/vulntypes/doImport/?' do
		selected = params[:vt_confirms].map{|e| e.to_i}

		newRts = Array.new
		if(!params[:rtms].nil?)
			params[:rtms].each do |rtid|
				newRts << rtid.to_i
			end
		end

		selected.each do |idx|
			vtname = params["vt_name_#{idx}"].to_s

			vtlabel = params["vt_label_#{idx}"]
			if(vtlabel.nil? || vtlabel.to_s.strip.empty?)
				vtlabel = nil
			else
				vtlabel = vtlabel.to_s
			end

			vtcwe = params["vt_cwe_#{idx}"]
			if(vtcwe.nil? || vtcwe.to_s.strip.empty?)
				vtcwe = nil
			else
				vtcwe = vtcwe.to_i
			end

			vtpriority = params["vt_priority_#{idx}"]
			if(vtpriority.nil? || vtpriority.to_s.strip.empty?)
				vtpriority = nil
			else
				vtpriority = vtpriority.to_i
			end

			vtenabled = params["vt_enabled_#{idx}"]
			if(vtenabled.nil? || vtenabled.to_s.strip.empty?)
				vtenabled = []
			else
				vtenabled = vtenabled.to_s.gsub("[","").gsub("]","").split(",").map{|s| s.to_i}
			end

			vthtml = params["vt_html_#{idx}"]
			if(vthtml.nil? || vthtml.to_s.strip.empty?)
				vthtml = nil
			else
				vthtml = vthtml.to_s
			end

			vt = VulnType.create(:name => vtname, :label => vtlabel, :cwe_mapping => vtcwe, :priority => vtpriority, :html => vthtml, :enabled => true, :enabledRTs => newRts, :enabledSections => vtenabled)
		end

		redirect "/admin/vulntypes/"
	end

	get '/admin/vulntypes/:vtid/?' do
		@vt = VulnType.get(params[:vtid])
		if(@vt.nil?)
			@errstr = "Type not found"
			return erb :error
		end

		@enabled = ""
		if(@vt.enabled)
			@enabled = "checked"
		end

		@appRecordTypes = RecordType.appRecordTypes()

		erb :admin_vt_single
	end

	post '/admin/vulntypes/:vtid/?' do
		@vt = VulnType.get(params[:vtid])
		if(@vt.nil?)
			@errstr = "Type not found"
			return erb :error
		end

		newEnabled = false
		if (!params[:isEnabled].nil?)
			newEnabled = true
		end

		@vt.enabled = newEnabled

		newName = params[:vtName].strip
		@vt.name = newName unless newName.nil?

		newLabel = params[:vtLabel].strip
		@vt.label = newLabel unless newLabel.nil?

		newCwe = params[:cwe].strip.to_i
		if(newCwe <= 0)
			@vt.cwe_mapping = nil
		else
			@vt.cwe_mapping = newCwe
		end

		newPriority = params[:vtPri]
		if(newPriority.nil? || newPriority.to_i < 0)
			newPriority = nil
		else
			newPriority = newPriority.to_i
		end
		@vt.priority = newPriority

		newHtml = params[:html].strip
		@vt.html = newHtml unless newHtml.nil?

		newRts = Array.new
		if(!params[:rtms].nil?)
			params[:rtms].each do |rtid|
				newRts << rtid.to_i
			end
		end

		@vt.enabledRTs = newRts

		newSecs = Array.new
		if(!params[:secms].nil?)
			params[:secms].each do |sid|
				newSecs << sid.to_i
			end
		end

		@vt.enabledSections = newSecs

		@vt.save

		@enabled = ""
		if(@vt.enabled)
			@enabled = "checked"
		end

		redirect "/admin/vulntypes/#{@vt.id}"
	end

	get '/admin/vulntypes/?' do
		@vulnTypes = VulnType.all()

		erb :admin_vts
	end

	get '/admin/vtids/?' do
		@vts = VulnType.all(:enabled => true, :order => [:id.asc])
		erb :admin_vtids
	end

	get '/admin/customVTs/?' do
		@customVTs = Array.new
		@counts = Array.new
		@firstUseVID = Array.new #First VID of use to look up later
		@usedTIDs = Array.new #array of arrays, uses of each
		downcased = Array.new

		Vulnerability.all(:vulntype => 0).each do |vt|
			if(!downcased.include?(vt.custom.downcase))
				@customVTs << vt.custom
				downcased = @customVTs.map(&:downcase)
				@counts << 1
				@firstUseVID << vt.id
				use = Array.new
				use << vt.test.id.to_s + "|" + vt.test.name + "|" + vt.test.application.name
				@usedTIDs << use
			else
				idx = downcased.index(vt.custom.downcase)
				@counts[idx] += 1
				@usedTIDs[idx] << vt.test.id.to_s + "|" + vt.test.name + "|" + vt.test.application.name
			end
		end

		erb :admin_vts_custom
	end

	post '/admin/customVTs/newFromCVT/?' do
		vid = params[:fuVID].to_i
		v = Vulnerability.get(vid)

		if(v.vulntype != 0)
			@errstr = "Not a valid custom vuln ID"
			erb :error
		end

		@vtName = v.custom
		@appRecordTypes = RecordType.appRecordTypes()

		erb :admin_vt_new_from_cvt
	end

	post '/admin/customVTs/doNewFromCVT/?' do
		origCVText = params[:cvt_txt]

		#Create VT
		newEnabled = false
		if (!params[:isEnabled].nil?)
			newEnabled = true
		end

		newName = params[:vtName].strip
		newHtml = params[:html].strip
		newLabel = params[:vtLabel].strip
		newCwe = params[:cwe].strip.to_i
		if(newCwe <= 0)
			newCwe = nil
		end
		newPri = params[:vtPri].to_i

		newRts = Array.new
		if(!params[:rtms].nil?)
			params[:rtms].each do |rtid|
				newRts << rtid.to_i
			end
		end

		newSecs = Array.new
		if(!params[:secms].nil?)
			params[:secms].each do |sid|
				newSecs << sid.to_i
			end
		end

		vt = VulnType.create(:name => newName, :label => newLabel, :cwe_mapping => newCwe, :priority => newPri, :html => newHtml, :enabled => newEnabled, :enabledRTs => newRts, :enabledSections => newSecs)
		vt.save

		Vulnerability.all(:vulntype => 0, :custom => origCVText).each do |v|
			v.vulntype = vt.id
			v.custom = nil
			v.save
		end

		redirect "/admin/vulntypes/"
	end

	post '/admin/customVTs/mergeFromCVT/?' do
		@vts = VulnType.all(:enabled => true)

		vid = params[:fuVID].to_i
		v = Vulnerability.get(vid)

		if(v.vulntype != 0)
			@errstr = "Not a valid custom vuln ID"
			erb :error
		end

		@vtName = v.custom

		erb :admin_vt_merge_cvt
	end

	post '/admin/customVTs/doMergeFromCVT/?' do
		origCVText = params[:cvt_txt]
		mergeID = params[:svt].to_i

		mergeVT = VulnType.get(mergeID)

		if(mergeVT.nil?)
			@errstr = "Not a valid VTID"
			erb :error
		end

		Vulnerability.all(:vulntype => 0, :custom => origCVText).each do |v|
			v.vulntype = mergeVT.id
			v.custom = nil
			v.save
		end

		redirect "/admin/vulntypes/"
	end

	get '/admin/recordTypes/?' do
		@appRecordTypes = RecordType.all(:object => LINK_TYPE::APPLICATION)

		erb :admin_rts
	end

	get '/admin/recordTypes/new/?' do
		@linkOptions = Array.new
		VRLinkedObject.each do |vrlo|
			@linkOptions << {:name => vrlo.vrlo_name.to_s, :key => vrlo.vrlo_key.to_s}
		end

		erb :admin_rt_new
	end

	post '/admin/recordTypes/new/?' do
		name = params[:rtName].strip.to_s
		desc = params[:rtDesc].strip.to_s
		obj = LINK_TYPE::APPLICATION
		linkObj = params[:rtLinkTo]

		active = (!params[:isActive].nil?)
		link = (!params[:isLinked].nil? && linkObj != "0")

		if(name.nil? || name.empty?)
			@errstr = "Record Type must have a name"
			return erb :error
		end

		if(link)
			rt = RecordType.create(:object => obj, :name => name, :description => desc, :isLinked => true, :linkedObjectKey => linkObj)
		else
			rt = RecordType.create(:object => obj, :name => name, :description => desc, :isLinked => false)
		end

		VulnType.all().each do |vt|
			curTypes = vt.enabledRTs
			if(curTypes.nil?)
				curTypes = Array.new
			end
			curTypes << rt.id
			vt.enabledRTs = curTypes
			vt.save
		end

		redirect "/admin/recordTypes/#{rt.id}"
	end

	get '/admin/recordTypes/:rtid/?' do
		rtid = params[:rtid].to_i

		@rt = RecordType.get(rtid)
		if(@rt.nil?)
			@errstr = "Unable to find RecordType"
			return erb :error
		end

		@exportFormats = ExportFormat.all()

		@regOrgs = Organization.all(:contractor => false)
		@conOrgs = Organization.all(:contractor => true)
		@orgsAllowed = getOrgsAllowedForRT(@rt.id)
		@linkOptions = Array.new
		VRLinkedObject.each do |vrlo|
			@linkOptions << {:name => vrlo.vrlo_name.to_s, :key => vrlo.vrlo_key.to_s}
		end

		@vulnTypes = VulnType.all(:enabled => true).sort{ |x,y| x.name <=> y.name}
		@enabledVTs = Array.new
		VulnType.getByRecordType(rtid).each do |vt|
			@enabledVTs << vt.id
		end

		erb :admin_rt_single
	end

	post '/admin/recordTypes/:rtid/?' do
		rtid = params[:rtid].to_i

		rt = RecordType.get(rtid)
		if(rt.nil?)
			@errstr = "Unable to find RecordType"
			return erb :error
		end

		name = params[:rtName].strip.to_s
		desc = params[:rtDesc].strip.to_s
		linkObj = params[:rtLinkTo]
		exportFormat = params[:rtExport].to_i
		newPrisStr = params[:rtPriorities].strip.to_s

		active = (!params[:isActive].nil?)
		link = (!params[:isLinked].nil? && linkObj != "0")
		isPassable = (!params[:isPassable].nil?)
		isProvPassable = (!params[:isProvPassable].nil?)
		defaultPrivate = (!params[:defaultPrivate].nil?)

		rt.active = active
		rt.name = name
		rt.description = desc
		rt.isLinked = link
		rt.linkedObjectKey = linkObj
		rt.canBePassedToCon = isPassable
		rt.canBeProvPassed = isProvPassable
		rt.defaultPrivate = defaultPrivate
		rt.exportFormat = exportFormat

		rt.save

		newPris = newPrisStr.split(',')
		newPris.each_with_index do |str, idx|
			next if(str.nil? || str.length > 50)
			rt.setVulnPriorityString(idx, str)
		end

		allowedOrgs = Array.new
		if(!params[:orgms].nil?)
			params[:orgms].each do |oid|
				allowedOrgs << oid.to_i
			end
		end

		allowedOrgs.each do |oid|
			if(!orgAllowedRT?(oid, rt.id))
				allowRTForOrg(oid, rt.id)
			end
		end

		Organization.all.each do |org|
			if(!allowedOrgs.include?(org.id) && orgAllowedRT?(org.id, rt.id))
				removeRTForOrg(org.id, rt.id)
			end
		end

		enabledVTs = Array.new
		if(!params[:vtms].nil?)
			params[:vtms].each do |vtid|
				enabledVTs << vtid.to_i
			end
		end

		VulnType.all().each do |vt|
			vtEnabled = vt.enabledRTs
			if(!vtEnabled.nil? && vtEnabled.include?(rt.id) && !enabledVTs.include?(vt.id))
				vtEnabled.delete(rt.id)
			end

			if(!vtEnabled.nil? && !vtEnabled.include?(rt.id) && enabledVTs.include?(vt.id))
				vtEnabled << rt.id
			end

			vt.enabledRTs = vtEnabled
			vt.save
		end

		redirect "/admin/recordTypes/#{rt.id}"
	end

	get '/admin/exportFormats/?' do
		@exportFormats = ExportFormat.all()

		erb :admin_efs
	end

	get '/admin/exportFormats/new/?' do
		erb :admin_ef_new
	end

	post '/admin/exportFormats/new/?' do
		name = params[:efName].strip.to_s
		desc = params[:efDesc].strip.to_s

		if(name.nil? || name.empty?)
			@errstr = "Record Type must have a name"
			return erb :error
		end

		defaultFile = File.open("exportTemplates/default.erb", "rb")
		defaultContents = defaultFile.read

		ef = ExportFormat.create(:name => name, :description => desc, :erb => defaultContents)
		redirect "/admin/exportFormats/#{ef.id}"
	end

	get '/admin/exportFormats/:efid/?' do
		efid = params[:efid].to_i

		if(efid != 0)
			@ef = ExportFormat.get(efid)
			if(@ef.nil?)
				@errstr = "Unable to find ExportFormat"
				return erb :error
			end
			@default = false
		else
			@default = true
		end

		if(efid == 0)
			f = File.open("exportTemplates/default.erb", "rb")
			@efERB = f.read
		else
			@efERB = @ef.erb
		end

		erb :admin_ef_single
	end

	post '/admin/exportFormats/:efid/?' do
		efid = params[:efid].to_i

		if(efid != 0)
			ef = ExportFormat.get(efid)
			if(ef.nil?)
				@errstr = "Unable to find ExportFormat"
				return erb :error
			end
			default = false

			name = params[:efName].strip.to_s
			desc = params[:efDesc].strip.to_s

			ef.name = name
			ef.description = desc

			ef.save
		else
			default = true
		end

		newFileContents = params[:efTemplateCode].strip.to_s

		if(efid == 0)
			File.open("exportTemplates/default.erb", "w"){ |f| f.write(newFileContents) }
		else
			ef.erb = newFileContents
			ef.save
		end

		redirect "/admin/exportFormats/#{efid}"
	end

	get '/admin/dashConfigs/?' do
		@dashConfigs = DashConfig.all()

		erb :admin_dcs
	end

	get '/admin/dashConfigs/new/?' do
		erb :admin_dc_new
	end

	post '/admin/dashConfigs/new/?' do
		name = params[:name].strip.to_s
		desc = params[:desc].strip.to_s

		if(name.nil? || name.empty?)
			@errstr = "Dashboard Config must have a name"
			return erb :error
		end

		dc = DashConfig.create(:name => name, :description => desc, :panels => Array.new, :stats => Array.new)
		redirect "/admin/dashConfigs/#{dc.id}"
	end

	get '/admin/dashConfigs/:dcid/?' do
		dcid = params[:dcid].to_i

		@dc = DashConfig.get(dcid)
		if(@dc.nil?)
			@errstr = "Unable to find DashConfig"
			return erb :error
		end

		if(@dc.customCode)
			erb :admin_dc_single_cc
		else
			@rtOpts = RecordType.appRecordTypes()
			@nonRtTypes = NON_RT_DASHPANELS

			erb :admin_dc_single
		end
	end

	post '/admin/dashConfigs/:dcid/newPanel/?' do
		dcid = params[:dcid].to_i

		dc = DashConfig.get(dcid)
		if(dc.nil?)
			@errstr = "Unable to find DashConfig"
			return erb :error
		end

		newPanelTitle = params[:panelTitle].strip.to_s
		newPanelColor = params[:panelColor].strip.to_s
		newPanelType = params[:panelType].to_i
		newPanelRecordType = params[:panelRecordType].to_i
		newPanelMaxWks = params[:panelMaxWks].to_i
		newPanelMaxWks = 0 if(newPanelMaxWks < 0)
		newPanelZeroText = params[:panelZeroText].strip.to_s
		if(newPanelZeroText.nil? || newPanelZeroText.empty?)
			newPanelZeroText = "No Records Returned"
		end

		newPanelHash = {:title => newPanelTitle, :color => newPanelColor, :type => newPanelType, :rt => newPanelRecordType, :maxwks => newPanelMaxWks, :zerotext => newPanelZeroText}
		dc.addPanel(newPanelHash)

		redirect "/admin/dashConfigs/#{dc.id}"
	end

	post '/admin/dashConfigs/:dcid/editPanel/:pidx/?' do
		dcid = params[:dcid].to_i
		pidx = params[:pidx].to_i

		dc = DashConfig.get(dcid)
		if(dc.nil?)
			@errstr = "Unable to find DashConfig"
			return erb :error
		end

		panel = dc.panels[pidx.to_i]
		if(panel.nil?)
			@errstr = "Unable to find Panel index #{pidx} on DC ID #{dcid}"
			return erb :error
		end

		if(params[:save].downcase == "delete")
			dc.panels.delete_at(pidx)

			dc.make_dirty(:panels)
			dc.save
		else
			newPanelTitle = params[:panelTitle].strip.to_s
			newPanelColor = params[:panelColor].strip.to_s
			newPanelType = params[:panelType].to_i
			newPanelRecordType = params[:panelRecordType].to_i
			newPanelMaxWks = params[:panelMaxWks].to_i
			newPanelMaxWks = 0 if(newPanelMaxWks < 0)
			newPanelZeroText = params[:panelZeroText].strip.to_s

			panel[:title] = newPanelTitle
			panel[:color] = newPanelColor
			panel[:type] = newPanelType
			panel[:rt] = newPanelRecordType
			panel[:maxwks] = newPanelMaxWks
			panel[:zerotext] = newPanelZeroText

			dc.make_dirty(:panels)
			dc.save
		end

		redirect "/admin/dashConfigs/#{dc.id}"
	end

	get '/admin/dashConfigs/:dcid/delete/?' do
		dcid = params[:dcid].to_i

		@dc = DashConfig.get(dcid)
		if(@dc.nil?)
			@errstr = "Unable to find DashConfig"
			return erb :error
		end

		@dcOptions = DashConfig.all(:id.not => @dc.id)
		@orgs = Organization.all(:dashconfig => @dc.id)
		@users = User.all(:dashOverride => @dc.id)

		erb :admin_dc_delete_conf
	end

	post '/admin/dashConfigs/:dcid/delete/?' do
		dcid = params[:dcid].to_i

		@dc = DashConfig.get(dcid)
		if(@dc.nil?)
			@errstr = "Unable to find DashConfig"
			return erb :error
		end

		confirm = false
		if(params[:confirm].downcase == "confirm")
			confirm = true
		end

		if(!confirm)
			redirect "/admin/dashConfigs/#{@dc.id}"
			return
		else
			newDcId = params[:newDc].to_i
			if(newDcId == @dc.id)
				@errstr = "Invalid migration Dash Config"
				return erb :error
			end

			newDc = DashConfig.get(newDcId)
			if(newDc.nil? && newDcId != 0)
				@errstr = "Invalid migration Dash Config"
				return erb :error
			end

			#Reset Users to no override
			User.all(:dashOverride => @dc.id).update(:dashOverride => -1)

			#Move over orgs
			Organization.all(:dashconfig => @dc.id).update(:dashconfig => newDcId)

			#Delete the DC
			@dc.destroy

			redirect "/admin/dashConfigs"
		end
	end

	post '/admin/dashConfigs/:dcid/?' do
		dcid = params[:dcid].to_i

		dc = DashConfig.get(dcid)
		if(dc.nil?)
			@errstr = "Unable to find DashConfig"
			return erb :error
		end

		newName = params[:name].strip.to_s
		newDesc = params[:desc].strip.to_s

		dc.active = (!params[:isActive].nil?)
		dc.name = newName
		dc.description = newDesc

		if(!dc.customCode)
			dc.showStats = (!params[:showStats].nil?)

			newStatBlocks = Array.new
			(1..4).each do |i|
				type = params["block#{i}_type"].to_i
				rt = params["block#{i}_rt"].to_i
				text = params["block#{i}_text"].to_s
				if(text.nil? || text.empty?)
					text = "Stat #{i}"
				end
				color = params["block#{i}_color"].to_s
				icon = params["block#{i}_icon"].to_s

				newStatBlocks << {:type => type, :rt => rt, :text => text, :color => color, :icon => icon}
			end

			dc.stats = newStatBlocks
		else
			settingsHash = Hash.new

			dc.customSettings.keys.each do |k|
				settingsHash[k] = {:name => dc.customSettings[k][:name], :val => params["custom_#{k}"]}
			end

			dc.customSettings = settingsHash
			dc.make_dirty(:customSettings)
		end

		dc.save

		redirect "/admin/dashConfigs/#{dc.id}"
	end

	get '/admin/flags/?' do
		@flags = Flag.all()

		erb :admin_flags
	end

	get '/admin/flags/new/?' do
		erb :admin_flag_new
	end

	post '/admin/flags/new/?' do
		name = params[:name].to_s
		desc = params[:desc].to_s
		icon = params[:icon].to_s
		active = (!params[:isActive].nil?)

		if(name.strip.empty?)
			redirect "/admin/flags/new"
		end

		if(!Flag.first(:name => name).nil?)
			@errstr = "Flag with that name already exists"
			return erb :error
		end

		flag = Flag.create(:name => name, :description => desc, :icon => icon, :active => active)

		redirect "/admin/flags/#{flag.id}"
	end

	get '/admin/flags/:fid/?' do
		fid = params[:fid].to_i

		@flag = Flag.get(fid)
		if(@flag.nil?)
			@errstr = "Unable to find Flag"
			return erb :error
		end

		erb :admin_flag_single
	end

	post '/admin/flags/:fid/?' do
		fid = params[:fid].to_i

		flag = Flag.get(fid)
		if(flag.nil?)
			@errstr = "Unable to find Flag"
			return erb :error
		end

		name = params[:name].to_s
		desc = params[:desc].to_s
		icon = params[:icon].to_s
		active = (!params[:isActive].nil?)

		curFlag = Flag.first(:name => name)
		if(!curFlag.nil? && curFlag.id != fid)
			@errstr = "Flag with that name already exists"
			return erb :error
		end

		flag.name = name unless name.empty?
		flag.description = desc
		flag.icon = icon
		flag.active = active

		flag.save

		redirect "/admin/flags/#{flag.id}"
	end

	get '/admin/flags/:fid/delete/?' do
		fid = params[:fid].to_i

		@flag = Flag.get(fid)
		if(@flag.nil?)
			@errstr = "Unable to find Flag"
			return erb :error
		end

		erb :admin_flag_delete_conf
	end

	post '/admin/flags/:fid/delete/?' do
		fid = params[:fid].to_i

		flag = Flag.get(fid)
		if(flag.nil?)
			@errstr = "Unable to find Flag"
			return erb :error
		end

		confirm = false
		if(params[:confirm].downcase == "confirm")
			confirm = true
		end

		if(!confirm)
			redirect "/admin/flags/#{flag.id}"
			return
		else
			flag.application_flags.destroy
			flag.destroy

			redirect "/admin/flags"
		end
	end

end

redpajama_set_name: RedPajamaGithub


BRICKFORM Satin Cure & Seal is a water based, clear acrylic co-polymer curing compound, dust proofer and sealer all in one. Satin Cure & Seal minimizes moisture loss from evaporation in newly placed concrete to provide maximum strength, hardness and protection. Reducing water evaporation loss will result is a stronger, denser, more durable concrete with higher compressive strength, and better crack and freeze-thaw resistance.


Welcome to paradise-also known for its beautiful sunsets. This spectacular, 2-story home is perfectly situated on over one and a half acres of gorgeous Florida property with 187.7 feet of direct Indian River frontage. Enjoy a day on the water or take a dip in your pool and soak up all that southern sunshine in beautiful Indialantic, Florida. With five bedrooms, four full baths, one half bath, and plenty of space for friends and family alike to feel at home in this tropical retreat. It's no wonder this 5,194 sf property is one of the most coveted on the Indian River.


Bertie County, NC Deed Book S begins a series of leases in 1803 and continues through 1805. These leases are all contracted with Sacarusa and Longboard as the chiefs, many with Jeremiah Slade, their power of attorney, signing on behalf of the chiefs.
1803 – Book S, p 690/691 – Indians to Johnston – June 15, 1803 Sacarusa and Longbeard, Chief of the Tuscarora Nation to Samuel W. Johnston – beginning on the bridge on the Fort Branch, up the said branch to the mouth of a branch, down the branch to a maple near Mrs. Pughs…containing 10 acres…to pay yearly one cent on demand on Dec. 25th. – leased until 1916.
Book S p 737 Indians to Johnson June 11, 1803 – Sacarusa and Longboard, Chiefs of the Tuscarora Nation of Indians, to Samuel W. Johnston of Bertie Co., NC messauge tenement or lot of land….Robert Bunchs….Betty Caustus (?)….200 acres…one cent per year until July 20, 1916. Witness J. H. Pugh and William W. Johnston, signed Sacarusa and Longboard.
Book S p 792 – Indians to Pugh – June 11, 1803 – Sacarusa and Longboard to Thomas Pugh for $8918 beginning at stake in Colonel Pugh's field…Town Swamp…Island Swamp just below the ground bridge….Robert's branch….Betty Carter…977 acres…til 12th of July 1916. Witnessed J. H. Pugh, Sam W. Johnston, signed Sacarusa and Longboard. Signed John M. Bindford, J. Slade and William Hawkins, commissioners. Registered Nov term 1803.
Book T p 69 – Indians to William Williams – July 11, 1803 – Sacarusa and Longboard, Chiefs of the Tuscarora Nation, to William Williams of Martin Co, NC, $1576 in hand paid, farm let messauge tract…head of Unerawet Swamp…Cullin Cooks land….Blunt's field…200 acres…until July 12, 1916…one cent due every Dec. 25th if demanded. Witness Sam W. Johnston. Signed Sacurusa and Longboard by marks. Signed by William M. Binford and William Hawkins, commissioners.
Book T p 184 Indians to Slade 1803 – Sacarusa and Longboard, Chiefs of the Tuscarora, to Jeremiah Slade of Martin Co., NC, power of attorney, June 18, 1803. Sacarusa signs with X and Longboard with +. Registered February term 1805.
Book T p 201 Indians to Samuel Johnston – Aug 18, 1804 – Sacarusa and Longboard, Chief of the Tuskarora nation of Indians to Samuel W. Johnston of Bertie Co., NC, $500, quitclaim to Samuel Johnston all that tract or piece of land lying in Bertie County which is embraced by the bounds mentioned in a lace to John Johnston, decd, dated March 18, 1777 containing by estimation 528 acres. Sacarusa and Longboard authorized to sell by an act of the Assembly at Raleigh in the year 1802. In witness whereof they the said Sacarusa and Longboard by Jeremiah Slade (their attorney duly authorized as well appear by a power of attorney recorded in the registers office of Bertie County) have hereunto set their hands and seals. Signed Sacarusa and Longboard by J. Slade, attorney. Registered February term 1805.
Book T p 304 Indians to Jones 1805 – Sacarusa and Longboard by attorney Jeremiah Slade of Martin Co., NC for sum of $2000 have released and forever quitclaim one third part the rent due the Tuscarora Indians on their lease to Msrs Jones, Pugh and Williams for 99 years to Willie William Jones, and Robert Allen Jones, Witness William Drew?, Sacarusa and Longboard by J. Slade, Atty.


text:
Tijana Zinajić, slovenska gledališka in filmska režiserka ter igralka, * 15. december 1973.

Tijana je študirala gledališko režijo na Akademiji za gledališče, radio, film in televizijo v Ljubljani. Režirala je v različnih slovenskih gledališčih, veliko pa je ustvarjala tudi v zunajinstitucionalnih gledališčih. Igrala je tudi v filmih, nadaljevankah in gledaliških predstavah.

Zasebno
Je mati štirih otrok. Tri sinove ima z bivšim partnerjem, igralcem Matijo Vastlom, najmlajšo hčer pa z režiserjem Gregorjem Andolškom.

Filmografija

Glej tudi
seznam slovenskih režiserjev

Sklici

Rojeni leta 1973
Živeči ljudje

Osebnosti s Škofjeloškega
Slovenski gledališki režiserji

Slovenski filmski režiserji

Župančičevi nagrajenci

redpajama_set_name: RedPajamaWikipedia


text:
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd">

<configuration>
  <settings>
    <setting name="lazyLoadingEnabled" value="false" />
  </settings>
  <typeAliases>
    <typeAlias type="org.flowable.eventregistry.impl.persistence.ResourceRefTypeHandler" alias="EventRegistryResourceRefTypeHandler"/>
  </typeAliases>
  <typeHandlers>
    <typeHandler handler="EventRegistryResourceRefTypeHandler"
                 javaType="org.flowable.eventregistry.impl.persistence.entity.ResourceRef"
                 jdbcType="VARCHAR"/>
  </typeHandlers>
  <mappers>
    <!-- Common mappers -->
    <mapper resource="org/flowable/common/db/mapping/entity/Property.xml" />
    <mapper resource="org/flowable/common/db/mapping/entity/TableData.xml" />
    <mapper resource="org/flowable/common/db/mapping/common.xml" />

    <!-- Engine mappers -->
    <mapper resource="org/flowable/eventregistry/db/mapping/entity/EventDeployment.xml" />
    <mapper resource="org/flowable/eventregistry/db/mapping/entity/EventDefinition.xml" />
    <mapper resource="org/flowable/eventregistry/db/mapping/entity/ChannelDefinition.xml" />
    <mapper resource="org/flowable/eventregistry/db/mapping/entity/EventResource.xml" />
  </mappers>
</configuration>


text:
Colonialism, Community, and Heritage in Native New England
Siobhan M. Hart
Series: Cultural Heritage Studies
"A compelling and timely challenge to archaeologists and all heritage professionals whose work articulates with Native community partners. Analyzing the narratives of four contemporary heritage sites in New England, Hart critically identifies deeply entrenched structures of whiteness, state power, and racism that continue to hinder Native sovereignty."—Katherine Howlett Hayes, coeditor of Rethinking Colonialism: Comparative Archaeological Approaches
"Refreshingly candid. Hart's innovative and masterful consideration of Aquinnah, Pocumtuck, Mashantucket, and Plimoth heritage landscapes reveals the extent to which collaborative approaches can challenge public perceptions of Native American persistence in New England today."—Mary Ann Levine, coeditor of Archaeology and Community Service Learning
Exploring museums and cultural centers in New England that hold important meanings for Native American communities today, this illuminating book offers a much-needed critique of collaborative efforts to preserve and promote the cultural heritage of the region.
Siobhan Hart examines the narratives told by and about Native American communities at heritage sites of the Aquinnah Wampanoag tribe on Martha's Vineyard, the Pocumtuck in Deerfield, Massachusetts, the Mashantucket Pequot reservation in Connecticut, and Plimoth Plantation in Massachusetts. Aimed largely at non-Native audiences, the interpretive signage, exhibits, events, and visitor-engagement strategies are intended to dispel the myth that Native peoples no longer live there. Hart investigates whether these tactics really do help topple the power structures of colonialism. She finds that in many cases, sites' efforts reinforce the privilege of whiteness. The burden of decolonizing falls on Indigenous curators, interpreters, and collaborators, while visitors can leave the difficult places, stories, and experiences behind them.
Hart's analysis spotlights the persistence of racialization and structural inequalities in these landscapes, as well as the negative effects on current Native American sovereignty. While their messages are changing public perceptions of Indigenous-community persistence in New England, the broader goal of decolonization, she argues, remains unrealized. This book presents startling evidence of the ways even well-intentioned multiperspective approaches to heritage can undermine the social justice they seek. Hart asks the difficult question, What do we want heritage sites to do?
Siobhan M. Hart is associate professor of anthropology at Skidmore College.
A volume in the series Cultural Heritage Studies, edited by Paul A. Shackel


Zillions compilation for 2003 Multivariant Tournament is a Zillions-of-Games file. It is categorized as: Orthodox chess, .
Zillions compilation for 2003 Multivariant Tournament . All designs (except Extinction) to be used in upcoming tournament.
Author: Glenn Overby II and Various.
Browse items that also start with the letters Zil.


How Much to Install UPVC Windows?
UPVC windows now come in so many shapes, styles, sizes and colours we have a plethora of glazing options. You can choose between single glazing, double glazing and even triple glazing for your home. We can also adorn our windows with tints, stains and grids to suit your lifestyle choices. But it's not just the quality and style of the glass that is improving and diversifying, it is also the materials with which we make our window frames. Back when windows were first invented, a single pane in a wooden frame was the only option. Although wooden frames are still available and very popular, the majority of window frames are now made from a revolutionary plastic know as UPVC. This material is cheap, durable, easy to maintain and can be applied to virtually any design due to its amazing versatility.
The UPVC window market is large, and it can be overwhelming trying to decide what product you think is best to suit your needs and tastes. This article aims to give you a little more basic knowledge about UPVC windows in the hope that you will find your way to the ideal solution for all your window-based needs!
Windows frames are no longer made with wood as standard. The industry standard material for windows is now UPVC. Wooden frames are still used in specific cases, usually for period buildings and conservation projects these days as opposed to new buildings. Corporate projects such as tower blocks or new public buildings such as museums and galleries often upgrade to metal alternatives such as steel or, more commonly, aluminium. Domestically though, UPVC is the most likely material to be used in external doors and window frames.
UPVC (Unplasticized Polyvinyl Chloride) is a derivative of PVC (Polyvinyl Chloride). In order to make the material suitable for use in window frames, additives and stabilizers are used. These additives change the material's chemical construction to create a material that is solid, versatile and durable. These stabilizers are not always the same, as certain additives affect the end product in different ways. This means that different stands of UPVC are available, in order to cater to a wide range of desired qualities and applications.
UPVC windows are formed by fusing sections of plastic known as 'profile' together. A profile is essentially a straight and rigid length of UPVC plastic designed specifically for door and window frames. Profiles are produced by forcing hot, liquid PVC into a mould. This PVC is then strengthened by adding stabilizers and being cooled almost instantly. These profiles are then cut to length and joined together to form the desired shape of the window. These joins are achieved either through heat fusion or through external t-joint connectors. Reinforcement materials are often added inside the UPVC profiles to add stability to the structure. Generally speaking the reinforcement material in question is either steel or aluminium.
We are lucky to have so much history in the UK. The architecture still standing throughout the country represents the building trends spanning over the last 1000 years. Because of this, these are a lot of oddly shaped, uniquely sized and specifically designed windows out there. UPVC windows can be designed to be in keeping with any building and made to measure in order to fit any opening. So, how much does the average UPVC window cost? It's difficult to know what the precise answer to that is if you take the growing demand for bespoke windows into account. However, to give you a rough idea of the material and labour costs associated with a new window, we have put together a couple of resources based on the standard UPVC casement window sizes currently available in the UK.
Opening Sections. There are some companies out there that will charge per opener.
Upgraded Glazing. You may want to upgrade your double-glazing to triple-glazing, to ensure a more energy efficient home. You may also wish to add a tint to your windows, a specific design, or classic elements such as lead barring and grids.
Coloured Frames. White is the standard for UPVC frames, but other options are available. As well as pretty much any block colour you can think of you can also apply various wood effects such as oak or rosewood.
Frame Quality. The quality of the UPVC frame itself can vary, both in the quality of the material itself and the construction.
Location. This refers to two things. First of all, if you live in an out-of-the-way location, fitting the windows may cost more. Secondly, if the windows you are replacing are on the ground floor as opposed to the first, second or third floor, then labour and scaffolding requirements will make the fitting of your windows cheaper.
Design. Any bespoke design requirements will hike the price upwards.
Energy Ratings. The higher the energy rating of the window, the higher the price.
Window Furniture. The bits and pieces that adorn your windows such as locks and handles come in various designs and styles, this will also change the cost of your windows.
All of these prices may look a little daunting, but never fear! The double-glazing industry is a big one and is therefore very competitive. There are deals to be had if you know where to look. Having said that, even if there are no deals to be seen at your preferred glazing company, negotiation is never off the table!
Speaking of deals, one of the savviest ways to cut the cost of your windows is to buy in bulk! Even though it might seem expensive at the time, it is much more cost effective to re-glaze your entire home at once, as opposed to doing a few at a time in order to fit with whatever cash-flow situation you are in. Most of the big UPVC vendors offer multi-unit deals all year round, these even extend into external doors. There is nothing worse than a home with shiny new windows and a grotty looking old door. A soon as you have new windows chances are you will want a front and back door to match; you might as well get them all at once and save money in the long run!
The installation makes up a sizeable chunk of the overall cost of your windows. If you are quite a handy person and only need to fit one or two windows, you might be tempted to fit them on your own. However, for a bigger project, such as a glazing overhaul of your entire property, you will definitely require professional window fitters. Installation usually accounts for somewhere between 25% and 40% of your entire spend. This table gives a rough example of what the cost breakdown might be for the professional fitting a single UPVC window.
The labour cost per window will reduce exponentially the more windows you have to fit. But this kind of breakdown is fairly typical for a single window fitting.
As stated above, installing the odd UPVC window yourself is not impossible if you take care to do everything correctly and to a high standard. This can be achieved using standard household tools and a little flair in the home improvements and DIY departments. It is so much easier to learn how to carry out tasks such as this than it was as little as a decade ago, as there is now plenty of online advice available. This article lays out in detail exactly what equipment you will need and what methods to use in order to fit your own window. Check it out HERE.
To compare UPVC manufacturers and to find out who is offering the best deal for you, check out what Greenmatch has to say on the subject. This site will help you to weigh up whether to go with one of the big companies such as Safestyle Everest, Zenith or Anglian or to employ the services of a smaller local company. But how do you know what makes a good UPVC window? Here is what you need to consider and look out for when you go window shopping!
Energy Rating. The energy rating of your new windows (normally rated between A and D) not only affects what it will cost to run your home but now also affects the value of your property.
Warranties. Always check the warranty before purchase. There are three standard warranty types to choose from.
Internal or External Glazing. There is a difference! Internal glazing performs much better for security.
Hinge Screws. Make sure these are made of a strong material. Stainless steel is the best, alternatives such as zinc are far less hard-wearing.
Locking System. Locking systems vary in their efficiency and security. Shoot bolt is the most popular option as far as a secure locking system goes.
The consumer group Which? always does a fantastic job of offering a fair and balanced review of any company. The 'Which?' article casts a light on the services and UPVC windows provided by Anglian, Everest and Safestyle. It also compares the main elements of these companies as well as alerting you to what to look out for when working with these window vendors.
What's the Difference Between UPVC and Composite Windows?
What is a composite window? The 'composite' element refers to the window frame itself primarily. Composite windows were initially developed for colder climates, such as those you may find in Scandinavia, so were designed to minimise heat loss. Their sturdy design also plays well for a UK-wide desire for increased security. Unlike UPVC, which is formed solely from plastics, the composite option, as the name suggests, is composed of a number of different materials. Most commonly the composite material combines plastic and toughened glass to create an extremely robust and secure material. Other elements are sometimes added to increase this security and its long-term durability; composite windows are designed to last up to 35 years, outstripping UPVC's average lifespan by a decade.
Robustness in composite windows is also increased by the use of engineered timber in its framework. This is particularly helpful for coastal properties where the wind speeds can often be quite high, as there is very little room for movement in the design of the window itself.
Composite windows also differ from UPVC windows in the quality of their glazing. Although both UPVC and composite windows both come in double glazing and triple glazing options, composite windows have an extra feature known as laminated glazing. This is also a measure taken to increase security. When impaled or put under pressure, laminated glass will shatter, but will also stay solid and in place in its window frame. UPVC windows do not come with this standard feature, broken glass will shatter and fall from the frame, allowing potential intruders easy access.


Heartburn is a painful Burning feeling in your Chest or Throat, just behind your Breastbone. The pain is often worse after eating, in the evening, or when lying down or bending over.
Occasional heartburn is common and no cause for alarm. But Heartburn that is more frequent or interferes with your daily routine may be a symptom of a more serious condition that requires medical care.
Tomato products, such as ketchup.
Alcohol, carbonated beverages, coffee or other caffeinated beverages.
Burning pain in the chest or Throat, that usually occurs after eating and may occur at night.


Nosso EP Catch me if you can agora está disponível na DieHard, na Galeria do Rock em SP! Eles também aceitam encomendas online pelo link abaixo!
Our EP Catch me if you can is available at DieHard, in São Paulo! They also sell it online on the link below!


Over the past year we have done a number of family walks on the South Downs. The walks tend to be approximately 8-10 kilometres long. We take most of a day to do a walk. We go at a pace suitable for children with lots of stops to look at things, meet animals or have snacks.
On the walks we take identification books and have tried to learn some things about the natural history of the area we are exploring. We were aiming to do the South Downs way in parts but the logistics of using public transport for some legs are very difficult so we are now just picking local manageable routs that we think will be of interest.
I love these walks. I really like exploring our local area and sharing information with other group members. As adults we have a nice time chatting with other adults while the children explore but we also have nice group moments with the kids where we all look at something or eat together. The walks are also a nice opportunity for families to spend some quality time doing something healthy.