text:
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>com.huawei.strategy.software.monitor</groupId>
	<artifactId>openview-api</artifactId>
	<version>0.0.1-SNAPSHOT</version>
	<packaging>jar</packaging>

	<repositories>
		<repository>
			<id>ossrh-snapshot</id>
			<url>https://oss.sonatype.org/content/repositories/snapshots</url>
		</repository>
		<repository>
			<id>ossrh-release</id>
			<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
		</repository>
		<repository>
			<id>org.springframework.repository.maven</id>
			<name>SpringSource Maven Repository</name>
			<url>http://repository.springframework.org/maven/</url>
		</repository>
		<repository>
			<id>central</id>
			<name>Maven Repository Switchboard</name>
			<url>http://repo1.maven.org/maven2</url>
		</repository>
		<repository>
			<id>mvnrepo</id>
			<name>mvnrepository</name>
			<url>https://mvnrepository.com/artifact/mysql/mysql-connector-java</url>
		</repository>

	</repositories>

	<pluginRepositories>
		<pluginRepository>
			<id>ossrh-snapshot</id>
			<url>https://oss.sonatype.org/content/repositories/snapshots</url>
		</pluginRepository>
		<pluginRepository>
			<id>ossrh-release</id>
			<url>https://oss.sonatype.org/content/repositories/public</url>
		</pluginRepository>
		<pluginRepository>
			<id>central</id>
			<name>Maven Plugin Repository</name>
			<url>http://repo1.maven.org/maven2</url>
		</pluginRepository>
	</pluginRepositories>

	<properties>
		<!-- Dependencies Versions -->
		<version.kikaha>2.0.4</version.kikaha>
		<version.trip>2.1.0</version.trip>
		<version.config>1.2.0</version.config>
		<version.jackson>2.7.5</version.jackson>
		<version.slf4j>1.7.13</version.slf4j>
		<version.junit>4.12</version.junit>
		<version.lombok>1.16.10</version.lombok>
		<version.mysql-connector-java>5.1.6</version.mysql-connector-java>
        <version.ormlite>5.0</version.ormlite>
		<version.raml-tester>0.8.13</version.raml-tester>
		<version.rest-assured>3.0.2</version.rest-assured>

		<!-- Plugin's Versions -->
		<version.maven-compiler-plugin>3.6.1</version.maven-compiler-plugin>
		<version.maven-war-plugin>2.6</version.maven-war-plugin>
		<version.resources.plugin>2.6</version.resources.plugin>
		<version.source.plugin>2.3</version.source.plugin>
		<version.javadoc.plugin>2.10.1</version.javadoc.plugin>
		<version.surfire.plugin>2.18</version.surfire.plugin>
		<version.gpg.plugin>1.5</version.gpg.plugin>
		<version.nexus-staging.plugin>1.6.3</version.nexus-staging.plugin>
		<!-- Configs -->
		<config.webdir>${project.basedir}/src/main/webapp</config.webdir>
		<config.skip.tests>false</config.skip.tests>
		<config.skip.tests.unit>${config.skip.tests}</config.skip.tests.unit>
		<config.skip.tests.integration>${config.skip.tests}</config.skip.tests.integration>
		<config.encoding>UTF-8</config.encoding>
		<config.encoding.source>${config.encoding}</config.encoding.source>
		<config.encoding.resources>${config.encoding}</config.encoding.resources>
		<project.build.sourceEncoding>${config.encoding}</project.build.sourceEncoding>
	</properties>

	<dependencies>

		<dependency>
			<groupId>org.apache.commons</groupId>
			<artifactId>commons-math3</artifactId>
			<version>3.6</version>
		</dependency>
		<dependency>
			<groupId>io.fabric8</groupId>
			<artifactId>kubernetes-client</artifactId>
			<version>2.2.9</version>
		</dependency>
		<dependency>
			<groupId>commons-io</groupId>
			<artifactId>commons-io</artifactId>
			<version>2.4</version>
		</dependency>
		<dependency>
			<groupId>org.apache.commons</groupId>
			<artifactId>commons-lang3</artifactId>
			<version>3.4</version>
		</dependency>

		<!-- Test time dependencies -->
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>${version.junit}</version>
			<scope>test</scope>
		</dependency>
		<!-- Compile time dependencies -->
		<dependency>
			<groupId>org.projectlombok</groupId>
			<artifactId>lombok</artifactId>
			<version>${version.lombok}</version>
		</dependency>
		<dependency>
			<groupId>io.skullabs.trip</groupId>
			<artifactId>trip-processor</artifactId>
			<version>${version.trip}</version>
		</dependency>

		<!-- Kikaha -->
		<dependency>
			<groupId>io.skullabs.kikaha</groupId>
			<artifactId>kikaha-db</artifactId>
			<version>${version.kikaha}</version>
		</dependency>
		<dependency>
			<groupId>io.skullabs.kikaha</groupId>
			<artifactId>kikaha-urouting-jackson</artifactId>
			<version>${version.kikaha}</version>
		</dependency>

		<!-- Main project dependencies -->
		<dependency>
			<groupId>io.skullabs.trip</groupId>
			<artifactId>trip-core</artifactId>
			<version>${version.trip}</version>
		</dependency>
		<dependency>
			<groupId>io.skullabs.trip</groupId>
			<artifactId>trip-jsr-330</artifactId>
			<version>${version.trip}</version>
		</dependency>
		<dependency>
			<groupId>com.typesafe</groupId>
			<artifactId>config</artifactId>
			<version>${version.config}</version>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
			<version>${version.slf4j}</version>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-log4j12</artifactId>
			<version>${version.slf4j}</version>
			<scope>test</scope>
		</dependency>

		<!-- Kafka client -->
		<dependency>
			<groupId>org.apache.kafka</groupId>
			<artifactId>kafka_2.11</artifactId>
			<version>0.9.0.0</version>
		</dependency>
		<dependency>
			<groupId>com.101tec</groupId>
			<artifactId>zkclient</artifactId>
			<version>0.7</version>
		</dependency>

		<!-- HTTP client library -->
		<dependency>
			<groupId>com.squareup.okhttp3</groupId>
			<artifactId>okhttp</artifactId>
			<version>3.6.0</version>
		</dependency>
		<!-- json.org parser -->
		<dependency>
			<groupId>org.json</groupId>
			<artifactId>json</artifactId>
			<version>20151123</version>
		</dependency>

		<!-- YAML parser -->
		<dependency>
			<groupId>com.fasterxml.jackson.dataformat</groupId>
			<artifactId>jackson-dataformat-yaml</artifactId>
			<version>${version.jackson}</version>
		</dependency>

		<!-- https://mvnrepository.com/artifact/org.yaml/snakeyaml -->
		<dependency>
			<groupId>org.yaml</groupId>
			<artifactId>snakeyaml</artifactId>
			<version>1.17</version>
		</dependency>

		<!-- https://mvnrepository.com/artifact/org.jasypt/jasypt -->
		<dependency>
			<groupId>org.jasypt</groupId>
			<artifactId>jasypt</artifactId>
			<version>1.9.2</version>
		</dependency>

		<!-- https://mvnrepository.com/artifact/org.mindrot/jbcrypt -->
		<dependency>
			<groupId>org.mindrot</groupId>
			<artifactId>jbcrypt</artifactId>
			<version>0.3m</version>
		</dependency>

		<dependency>
            <groupId>com.j256.ormlite</groupId>
            <artifactId>ormlite-jdbc</artifactId>
            <version>${version.ormlite}</version>
		</dependency>

		<!-- Mysql connector -->
		<dependency>
		    <groupId>mysql</groupId>
		    <artifactId>mysql-connector-java</artifactId>
			<version>${version.mysql-connector-java}</version>
		</dependency>

		<!-- https://mvnrepository.com/artifact/net.jodah/expiringmap -->
		<dependency>
		    <groupId>net.jodah</groupId>
		    <artifactId>expiringmap</artifactId>
		    <version>0.5.7</version>
		</dependency>

        <!-- https://mvnrepository.com/artifact/com.jayway.restassured/rest-assured -->
        <dependency>
			<groupId>io.rest-assured</groupId>
            <artifactId>rest-assured</artifactId>
			<version>${version.rest-assured}</version>
        </dependency>
        <dependency>
            <groupId>guru.nidi.raml</groupId>
            <artifactId>raml-tester</artifactId>
			<version>${version.raml-tester}</version>
        </dependency>

    </dependencies>

	<build>
		<plugins>
			<!-- Preconfiguring kikaha maven plugin -->
			<plugin>
				<groupId>io.skullabs.kikaha</groupId>
				<version>${version.kikaha}</version>
				<artifactId>kikaha-maven-plugin</artifactId>
				<configuration>
					<webresourcesPath>${config.webdir}</webresourcesPath>
				</configuration>
				<executions>
					<execution>
						<phase>package</phase>
						<goals>
							<goal>package</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<inherited>true</inherited>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>${version.maven-compiler-plugin}</version>
				<configuration>
					<source>1.8</source>
					<target>1.8</target>
					<optimize>false</optimize>
					<debug>true</debug>
					<encoding>UTF-8</encoding>
				</configuration>
			</plugin>
			<plugin>
				<artifactId>maven-war-plugin</artifactId>
				<version>${version.maven-war-plugin}</version>
				<configuration>
					<!-- So maven doesn't require web.xml -->
					<failOnMissingWebXml>false</failOnMissingWebXml>
				</configuration>
			</plugin>
		</plugins>
	</build>
</project>


text:
<!DOCTYPE html>

		<title>Sancture</title>
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<meta name="description" content="Sancture UB">
		<link rel="stylesheet" href="assets/css/font-roboto.css">
		<link rel="stylesheet" href="assets/main.css" />
		<link rel="icon" type="image/x-icon" href="favicon.ico" />
		<meta charset="UTF-8">

 •  Great Intelligence  •

				 Contact Us

				 Facebook

redpajama_set_name: RedPajamaGithub


text:
'use strict';

angular.module('mostPopularListingsApp.home', ['ngRoute'])

// Routing configuration for this module
.config(['$routeProvider',function($routeprovider){
	$routeprovider.when('/', {
		controller: 'HomeController',
		templateUrl: 'components/views/homeView.html'
	});
}])

// Controller definition for this module
.controller('HomeController', ['$scope', function($scope) {

	// Just a housekeeping.
	// In the init method we are declaring all the
	// neccesarry settings and assignments to be run once
	// controller is invoked
	init();

	function init(){

	};

	this.message = "Hello Home!";

}]);


text:
using Newtonsoft.Json;

namespace QuantConnect.Brokerages.Tradier
{
    /// <summary>
    /// Wrapper container for fault:
    /// </summary>
    public class TradierFaultContainer
    {
        /// Inner Fault Object
        [JsonProperty(PropertyName = "fault")]
        public TradierFault Fault;

        /// Fault Container Constructor:
        public TradierFaultContainer()
        { }
    }

    /// <summary>
    /// Tradier fault object:
    /// {"fault":{"faultstring":"Access Token expired","detail":{"errorcode":"keymanagement.service.access_token_expired"}}}
    /// </summary>
    public class TradierFault
    {
        /// Description of fault
        [JsonProperty(PropertyName = "faultstring")]
        public string Description = "";

        /// Detail object for fault exception
        [JsonProperty(PropertyName = "detail")]
        public TradierFaultDetail Details = new TradierFaultDetail();

        /// Tradier Fault Constructor:
        public TradierFault()
        { }
    }

    /// <summary>
    /// Error code associated with this fault.
    /// </summary>
    public class TradierFaultDetail
    {
        /// Error code for fault
        [JsonProperty(PropertyName = "errorcode")]
        public string ErrorCode;

        /// Tradier Detail Fault Constructor
        public TradierFaultDetail()
        { }
    }
}


text:
package no.jpro.examples.cdiandfilters;

import javax.enterprise.context.SessionScoped;
import javax.enterprise.inject.Produces;

import java.io.Serializable;

@SessionScoped
public class UserContextHolder implements Serializable {
	private static int instanceCounter;
	private int instanceNumber;

	private UserContext userContext;

	public UserContextHolder() {
		instanceNumber = ++instanceCounter;
		System.out.println("UserContextHolder instance " + instanceNumber + " constructed");
	}

	@Produces
	public UserContext getUserContext() {
		if (userContext == null) {
			userContext = new UserContext();
			System.out.println("UserContextHolder instance " + instanceNumber + " created NEW user context");
		}
		System.out.println("UserContextHolder instance " + instanceNumber + " returns user context for " + userContext.getName());
		return userContext;
	}

	public void setUserContext(UserContext userContext) {
		this.userContext = userContext;
	}
}


text:
import logging; log = logging.getLogger(__name__)

from . import BaseEndpointTestCase

class MerchantsEndpointTestCase(BaseEndpointTestCase):
    """
    General
    """
    def test_merchants(self):
        print
        print "----------------------------------------------------------------------"
        print "Request: "
        params = {'id':'761254',
                 }
        response = self.api.merchants('761254', params)
        #response = self.api.merchants(params)
        print "Response: "
        print response

    def test_merchants_factual(self):
        print
        print "----------------------------------------------------------------------"
        print "Request: "
        params = {'id':'274cd394-fcd3-4d17-8c37-8f5fcafeee80',
                  'namespace':'factual'
                 }
        response = self.api.merchants('274cd394-fcd3-4d17-8c37-8f5fcafeee80',params)
        #response = self.api.merchants(params)
        print "Response: "
        print response

    """
    # Not yet supported
    def test_merchants_foursquare(self):
        print
        print "----------------------------------------------------------------------"
        print "Request: "
        params = {'id':'',
                  'namespace':'foursquare'
                 }
        response = self.api.merchants(params)
        response = self.api.merchants(params)
        print "Response: "
        print response

    def test_merchants_facebook(self):
        print
        print "----------------------------------------------------------------------"
        print "Request: "
        params = {'id':'',
                  'namespace':'facebook'
                 }
        response = self.api.merchants(params)
        response = self.api.merchants(params)
        print "Response: "
        print response

    def test_merchants_google(self):
        print
        print "----------------------------------------------------------------------"
        print "Request: "
        params = {'id':'',
                  'namespace':'google'
                 }
        response = self.api.merchants(params)
        response = self.api.merchants(params)
        print "Response: "
        print response

    def test_merchants_citysearch(self):
        print
        print "----------------------------------------------------------------------"
        print "Request: "
        params = {'id':'',
                  'namespace':'citySearch'
                 }
        response = self.api.merchants(params)
        response = self.api.merchants(params)
        print "Response: "
        print response

    def test_merchants_yelp(self):
        print
        print "----------------------------------------------------------------------"
        print "Request: "
        params = {'id':'',
                  'namespace':'yelp'
                 }
        response = self.api.merchants(params)
        response = self.api.merchants(params)
        print "Response: "
        print response
    """


text:
<?php

namespace Kendo\Dataviz\UI;

class StockChartNavigatorSeriesItemHighlightBorder extends \Kendo\SerializableObject {
//>> Properties

    /**
    * The width of the border.
    * @param float $value
    * @return \Kendo\Dataviz\UI\StockChartNavigatorSeriesItemHighlightBorder
    */
    public function width($value) {
        return $this->setProperty('width', $value);
    }

    /**
    * The border color.
    * @param string $value
    * @return \Kendo\Dataviz\UI\StockChartNavigatorSeriesItemHighlightBorder
    */
    public function color($value) {
        return $this->setProperty('color', $value);
    }

    /**
    * The border opacity.
    * @param float $value
    * @return \Kendo\Dataviz\UI\StockChartNavigatorSeriesItemHighlightBorder
    */
    public function opacity($value) {
        return $this->setProperty('opacity', $value);
    }

//<< Properties
}

?>


text:
/**
 * This module handles formatting and parsing the <input type='date'/> stuff
 * Angular doesn't seem to nicely bind this
 */
define(['app'], function(app) {
  var padLeft = function(input, padLength, char) {
    input = input.toString();
    return Array(padLength - input.length + 1).join(char || " ") + input;
  };

  app.factory('inputDateHandler', function() {
    return {
      format: function(d) {
        return d.getFullYear()
          + '-' + padLeft(d.getMonth() + 1, 2, '0')
          + '-' + padLeft(d.getDate(), 2, '0');
      },
      parse: function(d) {
        return new Date(Date.parse(d));
      }
    };
  });
});


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>com.ricston</groupId>
	<artifactId>mule-transport-netty-publisher</artifactId>
	<version>1.1-SNAPSHOT</version>
	<packaging>mule-module</packaging>
	<name>Mule Cloud Connector</name>

	<parent>
		<groupId>org.mule.tools.devkit</groupId>
		<artifactId>mule-devkit-parent</artifactId>
		<version>3.6.1</version>
	</parent>

	<properties>
		<jdk.version>1.7</jdk.version>
		<category>Community</category>
		<licensePath>LICENSE.md</licensePath>
		<junit.version>4.9</junit.version>
		<mockito.version>1.8.2</mockito.version>
		<devkit.studio.package.skip>false</devkit.studio.package.skip>
		<netty.version>4.0.30.Final</netty.version>
	</properties>

	<dependencies>
		<dependency>
			<groupId>eclipse</groupId>
			<artifactId>eclipse-runtime</artifactId>
			<version>2.1.0</version>
			<scope>provided</scope>
		</dependency>

		<dependency>
			<groupId>io.netty</groupId>
			<artifactId>netty-all</artifactId>
			<version>${netty.version}</version>
		</dependency>
		<dependency>
			<groupId>org.mule</groupId>
			<artifactId>mule-core</artifactId>
			<version>${mule.version}</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.mule.modules</groupId>
			<artifactId>mule-module-spring-config</artifactId>
			<version>${mule.version}</version>
		</dependency>

		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>${junit.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.mockito</groupId>
			<artifactId>mockito-all</artifactId>
			<version>${mockito.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.mule.tests</groupId>
			<artifactId>mule-tests-functional</artifactId>
			<version>${mule.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.mule.transports</groupId>
			<artifactId>mule-transport-tcp</artifactId>
			<version>${mule.version}</version>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<repositories>
		<repository>
			<id>mulesoft-releases</id>
			<name>MuleSoft Releases Repository</name>
			<url>http://repository.mulesoft.org/releases/</url>
			<layout>default</layout>
		</repository>
	</repositories>
</project>


text:
package org.bitcoins.core.script.control

import org.bitcoins.testkitcore.util.BitcoinSUnitTest

/** Created by chris on 1/8/16.
  */
class ControlOperationsFactoryTest extends BitcoinSUnitTest {

  "ControlOperationsFactory" must "match a string with a control operation" in {
    ControlOperations.fromStringOpt("OP_ELSE") must be(Some(OP_ELSE))
    ControlOperations.fromStringOpt("OP_ENDIF") must be(Some(OP_ENDIF))
    ControlOperations.fromStringOpt("OP_IF") must be(Some(OP_IF))
    ControlOperations.fromStringOpt("OP_NOTIF") must be(Some(OP_NOTIF))
    ControlOperations.fromStringOpt("OP_RETURN") must be(Some(OP_RETURN))
    ControlOperations.fromStringOpt("OP_VERIFY") must be(Some(OP_VERIFY))
    ControlOperations.fromStringOpt("RANDOM") must be(None)
  }

}


text:
#include "maiaFault.h"
#include "maiaObject.h"

MaiaFault::MaiaFault(const MaiaFault &other) : QObject(other.parent()) {
	fault = other.fault;
}

MaiaFault::MaiaFault(int faultCode, QString faultString, QObject *parent) : QObject(parent) {
	fault["faultCode"] = faultCode;
	fault["faultString"] = faultString;
}

QString MaiaFault::toString() {
	QDomDocument doc;
	QDomProcessingInstruction header = doc.createProcessingInstruction( "xml", QString("version=\"1.0\" encoding=\"UTF-8\"" ));
	doc.appendChild(header);
	QDomElement methodResponse = doc.createElement("methodResponse");
	doc.appendChild(methodResponse);
	QDomElement faultelement = doc.createElement("fault");
	methodResponse.appendChild(faultelement);
	faultelement.appendChild(MaiaObject::toXml(fault));
	return doc.toString();
}


text:
require 'rails/generators/active_record'

class PublishableGenerator < ActiveRecord::Generators::Base
  desc  "Create a migration to add publishing to your model. " +
        "Usage: rails g publishable Model"

  def self.source_root
    @source_root ||= File.expand_path('../templates', __FILE__)
  end

  def generate_migration
    migration_template "publishable_migration.rb.erb", "db/migrate/#{migration_file_name}"
  end

  protected

  def migration_name
    "add_publishing_to_#{name.underscore.pluralize}"
  end

  def migration_file_name
    "#{migration_name}.rb"
  end

  def migration_class_name
    migration_name.camelize
  end
end


text:
// Targeted by JavaCPP version 1.5.7: DO NOT EDIT THIS FILE

package org.tensorflow.internal.c_api;

import java.nio.*;
import org.bytedeco.javacpp.*;
import org.bytedeco.javacpp.annotation.*;

import static org.tensorflow.internal.c_api.global.tensorflow.*;

// Allocates a new kernel builder and returns a pointer to it.
//
// If non-null, TensorFlow will call create_func when it needs to instantiate
// the kernel. The pointer returned by create_func will be passed to
// compute_func and delete_func, thereby functioning as a "this" pointer for
// referring to kernel instances.
//
// The TF_OpKernelConstruction pointer passed to create_func is owned by
// TensorFlow and will be deleted once create_func returns. It must not be used
// after this.
//
// When TensorFlow needs to perform a computation with this kernel, it will
// call compute_func. This function will receive the pointer returned by
// create_func (or null if no create_func was provided), along with the inputs
// to the computation.
//
// The TF_OpKernelContext pointer received by compute_func is owned by
// TensorFlow and will be deleted once compute_func returns. It must not be used
// after this.
//
// Finally, when TensorFlow no longer needs the kernel, it will call
// delete_func if one is provided. This function will receive the pointer
// returned in `create_func` or nullptr if no `create_func` was provided.
//
// The caller should pass the result of this function to
// TF_RegisterKernelBuilder, which will take ownership of the pointer. If, for
// some reason, the kernel builder will not be registered, the caller should
// delete it with TF_DeleteKernelBuilder.
@Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class)
public class Create_func_TF_OpKernelConstruction extends FunctionPointer {
    static { Loader.load(); }
    /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
    public    Create_func_TF_OpKernelConstruction(Pointer p) { super(p); }
    protected Create_func_TF_OpKernelConstruction() { allocate(); }
    private native void allocate();
    public native Pointer call(TF_OpKernelConstruction arg0);
}


text:
@interface NSMutableArray<T> (Essentials)

#pragma mark - Mutating

/// Inserts a given object at the end of the array. If the object is nil, does nothing.
- (void)addObjectIfAny:(T)object;

/// Inserts given object to keep array sorted by given descriptors.
- (void)insertObject:(T)object usingSortDescriptors:(NSArray<NSSortDescriptor *> *)sortDescriptors equalFirst:(BOOL)insertEqualAsFirst;

#pragma mark Mapping

/// Invokes given block on each element and replaces it with returned value. Returns receiver.
- (void)replace:(id(^)(T object))block;

/// Invokes given block on each element and replaces it with returned value. Returns receiver.
- (void)replaceIndex:(id(^)(NSUInteger index, T object))block;

#pragma mark Nested Arrays

/// Unwraps all contained arrays (not transitively). Returns receiver.
- (void)flatten;

#pragma mark Filtering

/// Removes all objects from the receiver for which the block returns NO. Method returns receiver.
- (void)filter:(BOOL(^)(T object))block;

/// Removes all objects from the receiver for which the block returns NO. Method returns receiver.
- (void)filterIndex:(BOOL(^)(NSUInteger index, T object))block;

#pragma mark Randomize

/// Changes positions of all objects in array, in random order. Method returns reordered array.
- (void)randomizeOrder;

@end


text:
jQuery.sap.declare("sap.suite.ui.commons.ViewRepeaterRenderer");
jQuery.sap.require("sap.ui.commons.RowRepeaterRenderer");

/**
 * @class RowRepeater renderer.
 * @static
 */
sap.suite.ui.commons.ViewRepeaterRenderer = sap.ui.core.Renderer.extend(sap.ui.commons.RowRepeaterRenderer);

/**
 * Renders the HTML for the given control, using the provided {@link sap.ui.core.RenderManager}.
 *
 * @param {sap.ui.core.RenderManager} oRenderManager the RenderManager that can be used for writing to the render output buffer
 * @param {sap.ui.core.Control} oControl an object representation of the control that should be rendered
 */
sap.suite.ui.commons.ViewRepeaterRenderer.render = function(oRenderManager, oControl) {
	// escape directly if control is not visible
	if(!oControl.getVisible()) {
	    return;
	}

    var sTooltip = oControl.getTooltip_AsString();
	// opening root DIV
	oRenderManager.write("<div");
	oRenderManager.writeControlData(oControl);
    if (sTooltip) {
        oRenderManager.writeAttributeEscaped("title", sTooltip);
    }
    // add design CSS class: sapUiRrDesignStandard/sapUiRrDesignTransparent/sapUiRrDesignBareShell
	oRenderManager.addClass("sapUiRrDesign" + oControl.getDesign() );

	if (oControl.getResponsive() && oControl.getShowMoreSteps() == 0) {
		oRenderManager.addClass("suiteUiVrResp");
	}

	oRenderManager.writeClasses();

	if (oControl.getResponsive() && oControl.getShowMoreSteps() == 0) {
		oRenderManager.write(" style='height:" + oControl.getHeight() +"'");
	}

	oRenderManager.write(">");

	// render the row repeater header (not in BARESHELL design)
	if( oControl.getDesign() !== sap.ui.commons.RowRepeaterDesign.BareShell){
	    this.renderHeader(oRenderManager, oControl);
	}

	if (oControl.getExternal() !== true) {
	    // render the row repeater body
	    this.renderBody(oRenderManager, oControl);

	    // render the row repeater footer (not in BARESHELL design)
	    if( oControl.getDesign() !== sap.ui.commons.RowRepeaterDesign.BareShell){
	        this.renderFooter(oRenderManager, oControl);
	    }
	} else {
	    oRenderManager.renderControl(sap.ui.getCore().byId(oControl.getAssociation("externalRepresentation")));
	}

	// closing root DIV
	oRenderManager.write("
");
};

sap.suite.ui.commons.ViewRepeaterRenderer.renderHeader = function(oRenderManager, oControl) {
    this.renderViewSwitcher(oRenderManager, oControl);
    if (oControl.getExternal() !== true) {
        sap.ui.commons.RowRepeaterRenderer.renderHeader.call(this, oRenderManager, oControl);
    }
};

sap.suite.ui.commons.ViewRepeaterRenderer.renderFooter = function(oRenderManager, oControl) {
    if (oControl.getExternal() !== true) {
        sap.ui.commons.RowRepeaterRenderer.renderFooter.call(this, oRenderManager, oControl);
    }
};

sap.suite.ui.commons.ViewRepeaterRenderer.renderViewSwitcher = function(oRenderManager, oControl) {
	if (oControl.getShowViews() || oControl.getShowSearchField()) {
        oRenderManager.write("
");

        if (oControl.getShowViews()) {
            // opening view switcher DIV
            oRenderManager.write("
");
                oRenderManager.renderControl(oControl._oSegBtn);
            // closing view switcher DIV
            oRenderManager.write("
");
        }

        if (oControl.getShowSearchField()) {
            // opening view switcher DIV
            oRenderManager.write("
");
                oRenderManager.renderControl(oControl._oSearchField);
            // closing view switcher DIV
            oRenderManager.write("
");
        }
        oRenderManager.write("
");
    }
    oRenderManager.write("
");
};


text:
https://stark-taiga-55141.herokuapp.com/

## Code Credits
###-Bootstrap
###-USDA database API (https://ndb.nal.usda.gov/ndb/doc/index)
###-Yeoman full stack generator (https://github.com/angular-fullstack/generator-angular-fullstack)

## Implemented Features
-Landing Page
![Landing Page](https://raw.githubusercontent.com/SEGroup9b/whatUEatin/dev/screenshots/landing_page.PNG)
-Create Recipe
![Create Recipe](https://raw.githubusercontent.com/SEGroup9b/whatUEatin/dev/screenshots/create_recipe.PNG)
-Healthify Page
![Healthify Page](https://raw.githubusercontent.com/SEGroup9b/whatUEatin/dev/screenshots/healthify.PNG)
-View Recipes Page
![View Recipes Page](https://raw.githubusercontent.com/SEGroup9b/whatUEatin/dev/screenshots/view_recipes.PNG)
-Leaderboard Page
![View Leaaderboard](https://raw.githubusercontent.com/SEGroup9b/whatUEatin/dev/screenshots/leaderboard.PNG)
-Profile Page
![Profile Page](https://raw.githubusercontent.com/SEGroup9b/whatUEatin/dev/screenshots/view_profile.PNG)
-List Recipes Page
![list recipes](https://raw.githubusercontent.com/SEGroup9b/whatUEatin/dev/screenshots/list_recipes.PNG)
-List Categories Page
![categories](https://raw.githubusercontent.com/SEGroup9b/whatUEatin/dev/screenshots/list_categories.PNG)
-Recipe by Category
![recipe by category](https://raw.githubusercontent.com/SEGroup9b/whatUEatin/dev/screenshots/recipe_by_category.PNG)

## Running Instructions
#### Clone Repository
####  Run
```bash
$ npm install
```
#### Run
```bash
$ bower install
```
####  Run
```bash
$ grunt
```
#### Visit localhost:3000 on web browser

## How to Update Database and Server Connections
Under config/env you'll need create/update your development.js/production.js to have the proper mongoDB location as well as update your amazon and USDA API keys.
Within the recipe and user modules you'll have to update the url's for bucket uploads/saving as we didn't make global variables for them due to time contraints. (Or just make your own globals in development/production and replace them apporpriately


text:
"use strict";

var XHR = require("./xhr")

var url = require("url")

var reducible = require("reducible/reducible")
var isReduced = require("reducible/is-reduced")
var end = require("reducible/end")

var take = require("reducers/take")
var drop = require("reducers/drop")
var map = require("reducers/map")

var method = require("method")

var connect = method("connect")

var keys = Object.keys
var isArray = Array.isArray

// Based of https://mxr.mozilla.org/mozilla-central/source/content/base/src/nsXMLHttpRequest.cpp#3221
var unsupportedHeaders = [
  "accept-charset", "accept-encoding", "access-control-request-headers",
  "access-control-request-method", "connection", "content-length",
  "cookie", "cookie2", "content-transfer-encoding", "date", "expect",
  "host", "keep-alive", "origin", "referer", "te", "trailer",
  "transfer-encoding",  "upgrade", "user-agent", "via"
]

function isHeaderSupported(name) {
  return unsupportedHeaders.indexOf(name) === -1
}

function setHeaders(xhr, headers) {
  keys(headers).forEach(function (name) {
    if (isHeaderSupported(name)) {
      var value = headers[name]
        if (isArray(value))
          value.forEach(function(value) { xhr.setRequestHeader(name, value) })
        else
          xhr.setRequestHeader(name, value)
    }
  })
}

function incorporateHeader(headers, source) {
  if (source !== "") {
    var m = source.match(/^([^:]+):\s*(.*)/)
    if (m) {
      var name = m[1].toLowerCase()
      var value = m[2]
      if (headers[name] !== undefined) {
        if (isArray(headers[name])) headers[name].push(value)
        else headers[name] = [ headers[name], value ]
      } else {
        headers[name] = value
      }
    } else {
      headers[source] = true
    }
  }
  return headers
}

function parseHeaders(xhr) {
  try {
    var lines = xhr.getAllResponseHeaders().split(/\r?\n/)
    return lines.reduce(incorporateHeader, {})
  } catch(e) {
    return null
  }
}

var isStatus2Supported = true
var isStreamingSupported = true

function readChunk(xhr, position) {
  try { return xhr.responseText.substr(position) } catch(e) { return null }
}

function Request(options) {
  this.method = options.method ? options.method.toUpperCase() : "GET"
  this.headers = options.headers || null
  this.protocol = options.protocol || "http:"
  this.host = options.host
  this.hostname = options.hostname
  this.port = options.port || null
  this.pathname = options.pathname || "/"
  this.hash = options.hash || ""
  this.query = options.query || ""
  this.body = options.body || ""
  this.type = options.type || null
  this.mimeType = options.mimeType || null
  this.credentials = options.credentials || null
  this.timeout = options.timeout || null
  this.uri = options.uri || url.format(this)
}
connect.define(Request, function(request) {
  var uri = request.uri
  var method = request.method
  var type = request.type
  var headers = request.headers
  var mimeType = request.mimeType
  var credentials = request.credentials
  var timeout = request.timeout
  var body = request.body

  return reducible(function(next, state) {
    var xhr = new XHR()
    if (credentials)
      xhr.open(method, uri, true, credentials.user, credentials.password)
    else
      xhr.open(request.method, request.uri, true)

    if (type) xhr.responseType = type
    if (headers) setHeaders(xhr, headers)
    if (mimeType) xhr.overrideMimeType(mimeType)
    if (credentials) xhr.withCredentials = true
    if (timeout) xhr.timeout = timeout

    var position = 0
    var responseHeaders = null
    var responseStatusCode = null
    var chunk = null

    xhr.onreadystatechange = function readyStateHandler(event) {
      if (!responseHeaders && (responseHeaders = parseHeaders(xhr))) {
        state = next({
          headers: responseHeaders,
          statusCode: xhr.status
        }, state)
      } else if ((chunk = readChunk(xhr, position))) {
        position = position + chunk.length
        state = next(chunk, state)
      }

      if (xhr.readyState === 4) {
        xhr.onreadystatechange = null
        if (xhr.error) next(xhr.error, state)
        else next(end, state)
      } else if (isReduced(state)) {
        xhr.onreadystatechange = null
        xhr.abort()
        next(end, state.value)
      }
    }

    xhr.send(body)
  })
})

function request(options) {
  return typeof(options) === "string" ? new Request({ uri: options }) :
         new Request(options)
}

connect.define(String, function(uri) { return connect(request({ uri: uri })) })
connect.request = request
connect.head = function head(options) {
  /**
  Read the head data for a single request.
  Returns a reducible.
  **/
  return take(connect(request(options)), 1)
}
connect.headers = function headers(request) {
  /**
  Read the headers for a single request.
  Returns a reducible.
  **/
  return map(connect.head(request), function(head) { return head.headers })
}
connect.body = function read(options) {
  /**
  Read the request body for a single request.
  Returns a reducible.

  Example:

      var body = http.read("http://example.com");
      reduce(body, writeBodyToDOM);

  **/
  return drop(connect(request(options)), 1)
}
connect.read = connect.body

module.exports = connect

/**
## Usage

var content = http.content("http://localhost:8080/")

reduce(content, function(_, data) {
  console.log(data)
}, 0)
**/


text:
using System;
using System.Collections.Generic;
using System.Security.Claims;
using System.Web;
using System.Web.Security;
using System.Web.UI;

namespace CachedPage.Account
{
    public partial class Login : Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            RegisterHyperLink.NavigateUrl = "Register";
            OpenAuthLogin.ReturnUrl = Request.QueryString["ReturnUrl"];

            var returnUrl = HttpUtility.UrlEncode(Request.QueryString["ReturnUrl"]);
            if (!String.IsNullOrEmpty(returnUrl))
            {
                RegisterHyperLink.NavigateUrl += "?ReturnUrl=" + returnUrl;
            }
        }

        protected void LogIn(object sender, EventArgs e)
        {
            if (IsValid)
            {
                // Validate the user password
                if (IdentityConfig.Secrets.Validate(UserName.Text, Password.Text))
                {
                    string localUserId = IdentityConfig.Logins.GetUserId(IdentityConfig.LocalLoginProvider, UserName.Text);
                    if (localUserId != null)
                    {
                        Context.SignIn(localUserId, new Claim[] { }, RememberMe.Checked);
                        IdentityConfig.RedirectToReturnUrl(Request.QueryString["ReturnUrl"], Response);
                    };
                }
                else
                {
                    FailureText.Text = "Your login attempt was not successful. Please try again.";
                    ErrorMessage.Visible = true;
                }
            }
        }
    }
}


text:
using System;
using System.Collections.Generic;
using System.IO;
using System.Text.RegularExpressions;

namespace EasyNetQ.Hosepipe
{
    public class FileMessageWriter : IMessageWriter
    {
        readonly static Regex invalidCharRegex = new Regex(@"[\\\/:\*\?\""\<\>|]");

        public void Write(IEnumerable<HosepipeMessage> messages, QueueParameters parameters)
        {
            var count = 0;
            foreach (var message in messages)
            {
                var uniqueFileName = SanitiseQueueName(parameters.QueueName) + "." + count.ToString();

                var bodyPath = Path.Combine(parameters.MessageFilePath, uniqueFileName + ".message.txt");
                var propertiesPath = Path.Combine(parameters.MessageFilePath, uniqueFileName + ".properties.txt");
                var infoPath = Path.Combine(parameters.MessageFilePath, uniqueFileName + ".info.txt");

                if(File.Exists(bodyPath))
                {
                    Console.WriteLine("Overwriting existing messsage file: {0}", bodyPath);
                }
                try
                {
                    File.WriteAllText(bodyPath, message.Body);
                    File.WriteAllText(propertiesPath, Newtonsoft.Json.JsonConvert.SerializeObject(message.Properties));
                    File.WriteAllText(infoPath, Newtonsoft.Json.JsonConvert.SerializeObject(message.Info));
                }
                catch (DirectoryNotFoundException)
                {
                    throw new EasyNetQHosepipeException(
                        string.Format("Directory '{0}' does not exist", parameters.MessageFilePath));
                }
                count++;
            }
        }

        public static string SanitiseQueueName(string queueName)
        {
            return invalidCharRegex.Replace(queueName, "_");
        }
    }
}


text:
import ray
from ray.data.preprocessors import StandardScaler
from ray.train.batch_predictor import BatchPredictor
from ray.train.xgboost import XGBoostTrainer, XGBoostPredictor
from ray.air.config import ScalingConfig

# Split data into train and validation.
dataset = ray.data.read_csv("s3://anonymous@air-example-data/breast_cancer.csv")
train_dataset, valid_dataset = dataset.train_test_split(test_size=0.3)
test_dataset = valid_dataset.drop_columns(["target"])

columns_to_scale = ["mean radius", "mean texture"]
preprocessor = StandardScaler(columns=columns_to_scale)

trainer = XGBoostTrainer(
    label_column="target",
    num_boost_round=20,
    scaling_config=ScalingConfig(num_workers=2),
    params={
        "objective": "binary:logistic",
        "eval_metric": ["logloss", "error"],
    },
    datasets={"train": train_dataset},
    preprocessor=preprocessor,
)
result = trainer.fit()

# You can also create a checkpoint from a trained model using
# `XGBoostCheckpoint.from_model`.

# import xgboost as xgb
# from ray.train.xgboost import XGBoostCheckpoint
# model = xgb.Booster()
# model.load_model(...)
# checkpoint = XGBoostCheckpoint.from_model(model, path=".")
checkpoint = result.checkpoint

batch_predictor = BatchPredictor.from_checkpoint(checkpoint, XGBoostPredictor)

predicted_probabilities = batch_predictor.predict(test_dataset)
predicted_probabilities.show()


text:
import * as React from 'react';
import { MenuItem } from '../menuitem';
import TooltipOptions from '../tooltip/tooltipoptions';
import {IconType, TemplateType} from "../utils/Utils";

type SplitButtonAppendToType = 'self' | HTMLElement | undefined | null;

export interface SplitButtonProps {
    id?: string;
    label?: string;
    icon?: IconType<SplitButtonProps>;
    model?: MenuItem[];
    disabled?: boolean;
    style?: object;
    className?: string;
    menuStyle?: object;
    menuClassName?: string;
    tabIndex?: number;
    appendTo?: SplitButtonAppendToType;
    tooltip?: string;
    tooltipOptions?: TooltipOptions;
    buttonTemplate?: TemplateType<SplitButtonProps>;
    transitionOptions?: object;
    dropdownIcon?: IconType<SplitButtonProps>;
    onClick?(event: React.MouseEvent<HTMLElement>): void;
    onShow?(): void;
    onHide?(): void;
}

export declare class SplitButton extends React.Component<SplitButtonProps, any> { }


text:
package com.bupt.core.system.model;

import java.util.ArrayList;
import java.util.List;

public class RoleExample {

	protected Integer start;
	protected Integer limit;

    public Integer getStart() {
		return start;
	}

	public Integer getLimit() {
		return limit;
	}

	public void setStart(Integer start) {
		this.start = start;
	}

	public void setLimit(Integer limit) {
		this.limit = limit;
	}

	/**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database table t_security_role
     *
     * @mbggenerated Fri Sep 06 15:12:05 CST 2013
     */
    protected String orderByClause;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database table t_security_role
     *
     * @mbggenerated Fri Sep 06 15:12:05 CST 2013
     */
    protected boolean distinct;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database table t_security_role
     *
     * @mbggenerated Fri Sep 06 15:12:05 CST 2013
     */
    protected List<Criteria> oredCriteria;

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_security_role
     *
     * @mbggenerated Fri Sep 06 15:12:05 CST 2013
     */
    public RoleExample() {
        oredCriteria = new ArrayList<Criteria>();
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_security_role
     *
     * @mbggenerated Fri Sep 06 15:12:05 CST 2013
     */
    public void setOrderByClause(String orderByClause) {
        this.orderByClause = orderByClause;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_security_role
     *
     * @mbggenerated Fri Sep 06 15:12:05 CST 2013
     */
    public String getOrderByClause() {
        return orderByClause;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_security_role
     *
     * @mbggenerated Fri Sep 06 15:12:05 CST 2013
     */
    public void setDistinct(boolean distinct) {
        this.distinct = distinct;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_security_role
     *
     * @mbggenerated Fri Sep 06 15:12:05 CST 2013
     */
    public boolean isDistinct() {
        return distinct;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_security_role
     *
     * @mbggenerated Fri Sep 06 15:12:05 CST 2013
     */
    public List<Criteria> getOredCriteria() {
        return oredCriteria;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_security_role
     *
     * @mbggenerated Fri Sep 06 15:12:05 CST 2013
     */
    public void or(Criteria criteria) {
        oredCriteria.add(criteria);
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_security_role
     *
     * @mbggenerated Fri Sep 06 15:12:05 CST 2013
     */
    public Criteria or() {
        Criteria criteria = createCriteriaInternal();
        oredCriteria.add(criteria);
        return criteria;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_security_role
     *
     * @mbggenerated Fri Sep 06 15:12:05 CST 2013
     */
    public Criteria createCriteria() {
        Criteria criteria = createCriteriaInternal();
        if (oredCriteria.size() == 0) {
            oredCriteria.add(criteria);
        }
        return criteria;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_security_role
     *
     * @mbggenerated Fri Sep 06 15:12:05 CST 2013
     */
    protected Criteria createCriteriaInternal() {
        Criteria criteria = new Criteria();
        return criteria;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_security_role
     *
     * @mbggenerated Fri Sep 06 15:12:05 CST 2013
     */
    public void clear() {
        oredCriteria.clear();
        orderByClause = null;
        distinct = false;
    }

    /**
     * This class was generated by MyBatis Generator.
     * This class corresponds to the database table t_security_role
     *
     * @mbggenerated Fri Sep 06 15:12:05 CST 2013
     */
    protected abstract static class GeneratedCriteria {
        protected List<Criterion> criteria;

        protected GeneratedCriteria() {
            super();
            criteria = new ArrayList<Criterion>();
        }

        public boolean isValid() {
            return criteria.size() > 0;
        }

        public List<Criterion> getAllCriteria() {
            return criteria;
        }

        public List<Criterion> getCriteria() {
            return criteria;
        }

        protected void addCriterion(String condition) {
            if (condition == null) {
                throw new RuntimeException("Value for condition cannot be null");
            }
            criteria.add(new Criterion(condition));
        }

        protected void addCriterion(String condition, Object value, String property) {
            if (value == null) {
                throw new RuntimeException("Value for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value));
        }

        protected void addCriterion(String condition, Object value1, Object value2, String property) {
            if (value1 == null || value2 == null) {
                throw new RuntimeException("Between values for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value1, value2));
        }

        public Criteria andRoleIdIsNull() {
            addCriterion("role_id is null");
            return (Criteria) this;
        }

        public Criteria andRoleIdIsNotNull() {
            addCriterion("role_id is not null");
            return (Criteria) this;
        }
        //这里面的roleId应该是个property
        public Criteria andRoleIdEqualTo(Integer value) {
            addCriterion("role_id =", value, "roleId");
            return (Criteria) this;
        }

        public Criteria andRoleIdNotEqualTo(Integer value) {
            addCriterion("role_id <>", value, "roleId");
            return (Criteria) this;
        }

        public Criteria andRoleIdGreaterThan(Integer value) {
            addCriterion("role_id >", value, "roleId");
            return (Criteria) this;
        }

        public Criteria andRoleIdGreaterThanOrEqualTo(Integer value) {
            addCriterion("role_id >=", value, "roleId");
            return (Criteria) this;
        }

        public Criteria andRoleIdLessThan(Integer value) {
            addCriterion("role_id <", value, "roleId");
            return (Criteria) this;
        }

        public Criteria andRoleIdLessThanOrEqualTo(Integer value) {
            addCriterion("role_id <=", value, "roleId");
            return (Criteria) this;
        }

        public Criteria andRoleIdIn(List<Integer> values) {
            addCriterion("role_id in", values, "roleId");
            return (Criteria) this;
        }

        public Criteria andRoleIdNotIn(List<Integer> values) {
            addCriterion("role_id not in", values, "roleId");
            return (Criteria) this;
        }

        public Criteria andRoleIdBetween(Integer value1, Integer value2) {
            addCriterion("role_id between", value1, value2, "roleId");
            return (Criteria) this;
        }

        public Criteria andRoleIdNotBetween(Integer value1, Integer value2) {
            addCriterion("role_id not between", value1, value2, "roleId");
            return (Criteria) this;
        }

        public Criteria andNameIsNull() {
            addCriterion("name is null");
            return (Criteria) this;
        }

        public Criteria andNameIsNotNull() {
            addCriterion("name is not null");
            return (Criteria) this;
        }

        public Criteria andNameEqualTo(String value) {
            addCriterion("name =", value, "name");
            return (Criteria) this;
        }

        public Criteria andNameNotEqualTo(String value) {
            addCriterion("name <>", value, "name");
            return (Criteria) this;
        }

        public Criteria andNameGreaterThan(String value) {
            addCriterion("name >", value, "name");
            return (Criteria) this;
        }

        public Criteria andNameGreaterThanOrEqualTo(String value) {
            addCriterion("name >=", value, "name");
            return (Criteria) this;
        }

        public Criteria andNameLessThan(String value) {
            addCriterion("name <", value, "name");
            return (Criteria) this;
        }

        public Criteria andNameLessThanOrEqualTo(String value) {
            addCriterion("name <=", value, "name");
            return (Criteria) this;
        }

        public Criteria andNameLike(String value) {
            addCriterion("name like","%"+value+"%", "name");
            return (Criteria) this;
        }

        public Criteria andNameNotLike(String value) {
            addCriterion("name not like",value, "name");
            return (Criteria) this;
        }

        public Criteria andNameIn(List<String> values) {
            addCriterion("name in", values, "name");
            return (Criteria) this;
        }

        public Criteria andNameNotIn(List<String> values) {
            addCriterion("name not in", values, "name");
            return (Criteria) this;
        }

        public Criteria andNameBetween(String value1, String value2) {
            addCriterion("name between", value1, value2, "name");
            return (Criteria) this;
        }

        public Criteria andNameNotBetween(String value1, String value2) {
            addCriterion("name not between", value1, value2, "name");
            return (Criteria) this;
        }

        public Criteria andDescriptionIsNull() {
            addCriterion("description is null");
            return (Criteria) this;
        }

        public Criteria andDescriptionIsNotNull() {
            addCriterion("description is not null");
            return (Criteria) this;
        }

        public Criteria andDescriptionEqualTo(String value) {
            addCriterion("description =", value, "description");
            return (Criteria) this;
        }

        public Criteria andDescriptionNotEqualTo(String value) {
            addCriterion("description <>", value, "description");
            return (Criteria) this;
        }

        public Criteria andDescriptionGreaterThan(String value) {
            addCriterion("description >", value, "description");
            return (Criteria) this;
        }

        public Criteria andDescriptionGreaterThanOrEqualTo(String value) {
            addCriterion("description >=", value, "description");
            return (Criteria) this;
        }

        public Criteria andDescriptionLessThan(String value) {
            addCriterion("description <", value, "description");
            return (Criteria) this;
        }

        public Criteria andDescriptionLessThanOrEqualTo(String value) {
            addCriterion("description <=", value, "description");
            return (Criteria) this;
        }

        public Criteria andDescriptionLike(String value) {
            addCriterion("description like", value, "description");
            return (Criteria) this;
        }

        public Criteria andDescriptionNotLike(String value) {
            addCriterion("description not like", value, "description");
            return (Criteria) this;
        }

        public Criteria andDescriptionIn(List<String> values) {
            addCriterion("description in", values, "description");
            return (Criteria) this;
        }

        public Criteria andDescriptionNotIn(List<String> values) {
            addCriterion("description not in", values, "description");
            return (Criteria) this;
        }

        public Criteria andDescriptionBetween(String value1, String value2) {
            addCriterion("description between", value1, value2, "description");
            return (Criteria) this;
        }

        public Criteria andDescriptionNotBetween(String value1, String value2) {
            addCriterion("description not between", value1, value2, "description");
            return (Criteria) this;
        }

        public Criteria andParentIdIsNull() {
            addCriterion("parent_id is null");
            return (Criteria) this;
        }

        public Criteria andParentIdIsNotNull() {
            addCriterion("parent_id is not null");
            return (Criteria) this;
        }

        public Criteria andParentIdEqualTo(Integer value) {
            addCriterion("parent_id =", value, "parentId");
            return (Criteria) this;
        }

        public Criteria andParentIdNotEqualTo(Integer value) {
            addCriterion("parent_id <>", value, "parentId");
            return (Criteria) this;
        }

        public Criteria andParentIdGreaterThan(Integer value) {
            addCriterion("parent_id >", value, "parentId");
            return (Criteria) this;
        }

        public Criteria andParentIdGreaterThanOrEqualTo(Integer value) {
            addCriterion("parent_id >=", value, "parentId");
            return (Criteria) this;
        }

        public Criteria andParentIdLessThan(Integer value) {
            addCriterion("parent_id <", value, "parentId");
            return (Criteria) this;
        }

        public Criteria andParentIdLessThanOrEqualTo(Integer value) {
            addCriterion("parent_id <=", value, "parentId");
            return (Criteria) this;
        }

        public Criteria andParentIdIn(List<Integer> values) {
            addCriterion("parent_id in", values, "parentId");
            return (Criteria) this;
        }

        public Criteria andParentIdNotIn(List<Integer> values) {
            addCriterion("parent_id not in", values, "parentId");
            return (Criteria) this;
        }

        public Criteria andParentIdBetween(Integer value1, Integer value2) {
            addCriterion("parent_id between", value1, value2, "parentId");
            return (Criteria) this;
        }

        public Criteria andParentIdNotBetween(Integer value1, Integer value2) {
            addCriterion("parent_id not between", value1, value2, "parentId");
            return (Criteria) this;
        }

        public Criteria andPrilegeEqualTo(String privilege){
        	addCriterion("role_id in (select role_id from t_security_role_privilege where privilege_id = " + privilege + ")");
        	return (Criteria) this;
        }
        public Criteria andDepartmentEqualTo(String department){
        	addCriterion("role_id in (select role_id from t_security_user_role where user_id in (select user_id from t_security_user where department_id = " + department + "))");
        	return (Criteria) this;
        }
    }

    /**
     * This class was generated by MyBatis Generator.
     * This class corresponds to the database table t_security_role
     *
     * @mbggenerated do_not_delete_during_merge Fri Sep 06 15:12:05 CST 2013
     */
    public static class Criteria extends GeneratedCriteria {

        protected Criteria() {
            super();
        }
    }

    /**
     * This class was generated by MyBatis Generator.
     * This class corresponds to the database table t_security_role
     *
     * @mbggenerated Fri Sep 06 15:12:05 CST 2013
     */
    public static class Criterion {
        private String condition;

        private Object value;

        private Object secondValue;

        private boolean noValue;

        private boolean singleValue;

        private boolean betweenValue;

        private boolean listValue;

        private String typeHandler;

        public String getCondition() {
            return condition;
        }

        public Object getValue() {
            return value;
        }

        public Object getSecondValue() {
            return secondValue;
        }

        public boolean isNoValue() {
            return noValue;
        }

        public boolean isSingleValue() {
            return singleValue;
        }

        public boolean isBetweenValue() {
            return betweenValue;
        }

        public boolean isListValue() {
            return listValue;
        }

        public String getTypeHandler() {
            return typeHandler;
        }

        protected Criterion(String condition) {
            super();
            this.condition = condition;
            this.typeHandler = null;
            this.noValue = true;
        }

        protected Criterion(String condition, Object value, String typeHandler) {
            super();
            this.condition = condition;
            this.value = value;
            this.typeHandler = typeHandler;
            if (value instanceof List<?>) {
                this.listValue = true;
            } else {
                this.singleValue = true;
            }
        }

        protected Criterion(String condition, Object value) {
            this(condition, value, null);
        }

        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
            super();
            this.condition = condition;
            this.value = value;
            this.secondValue = secondValue;
            this.typeHandler = typeHandler;
            this.betweenValue = true;
        }

        protected Criterion(String condition, Object value, Object secondValue) {
            this(condition, value, secondValue, null);
        }
    }
}


text:
<?php

declare(strict_types=1);

namespace EnumType;

use WsdlToPhp\PackageBase\AbstractStructEnumBase;

/**
 * This class stands for UnifiedGroupCreationErrorType EnumType
 * @package Ews
 * @subpackage Enumerations
 * @author WsdlToPhp <contact@wsdltophp.com>
 */
class EwsUnifiedGroupCreationErrorType extends AbstractStructEnumBase
{
    /**
     * Constant for value 'NoError'
     * @return string 'NoError'
     */
    const VALUE_NO_ERROR = 'NoError';
    /**
     * Constant for value 'FailedCreate'
     * @return string 'FailedCreate'
     */
    const VALUE_FAILED_CREATE = 'FailedCreate';
    /**
     * Constant for value 'FailedMailboxProvision'
     * @return string 'FailedMailboxProvision'
     */
    const VALUE_FAILED_MAILBOX_PROVISION = 'FailedMailboxProvision';
    /**
     * Return allowed values
     * @uses self::VALUE_NO_ERROR
     * @uses self::VALUE_FAILED_CREATE
     * @uses self::VALUE_FAILED_MAILBOX_PROVISION
     * @return string[]
     */
    public static function getValidValues(): array
    {
        return [
            self::VALUE_NO_ERROR,
            self::VALUE_FAILED_CREATE,
            self::VALUE_FAILED_MAILBOX_PROVISION,
        ];
    }
}


text:
from django.conf import settings

from dcu.active_memory import upload_rotate

import datetime
import os.path
import subprocess
import logging

logger = logging.getLogger(__name__)

class BackupFailed(Exception):
    pass

def backup_media():
    '''
    make a backup of media files
    '''
    timestamp = datetime.datetime.utcnow().strftime('%Y-%m-%d')
    media_parent = os.path.dirname(settings.MEDIA_ROOT)
    media_folder = os.path.basename(settings.MEDIA_ROOT)
    backup_dest = os.path.join(settings.BACKUP_DIR, '{0}-{1}.tar.bz2'.format(media_folder, timestamp))

    cmd_template = 'tar -cjf {backup_dest} -C {media_parent} {media_folder}'
    cmd = cmd_template.format(
        backup_dest=backup_dest,
        media_parent=media_parent,
        media_folder=media_folder
    )
    logger.debug('Backing up media with following command: {0}'.format(cmd))
    return_code = subprocess.call(cmd.split(' '))
    if return_code != 0:
        raise BackupFailed('could not create media backup')

    # Upload to S3
    upload_rotate(
        backup_dest,
        settings.BACKUP_AWS_STORAGE_BUCKET_NAME,
        settings.BACKUP_AWS_KEY_PREFIX,
        aws_key=settings.BACKUP_AWS_ACCESS_KEY_ID,
        aws_secret=settings.BACKUP_AWS_SECRET_ACCESS_KEY
    )

def backup_db():
    '''
    make a backup of the database
    '''

    if settings.DATABASES['default']['ENGINE'] != 'django.db.backends.postgresql_psycopg2':
        raise BackupFailed('Database engine not supported')

    timestamp = datetime.datetime.utcnow().strftime('%Y-%m-%d')
    backup_dest = os.path.join(settings.BACKUP_DIR, 'db-{0}.dump'.format(timestamp))

    cmd_template = 'pg_dump -Fc -w -h {db_host_name} -U {db_user} {db_name} -f {backup_dest}'
    cmd = cmd_template.format(
        db_host_name=settings.DATABASES['default']['HOST'],
        db_user=settings.DATABASES['default']['USER'],
        db_name=settings.DATABASES['default']['NAME'],
        backup_dest=backup_dest
    )
    logger.debug('Backing up db with following command: {0}'.format(cmd))
    env = os.environ.copy()
    env['PGPASSWORD'] = settings.DATABASES['default']['PASSWORD']
    #TODO not the best way to pass the password!
    process = subprocess.Popen(cmd.split(' '), env=env, stderr=subprocess.PIPE)
    return_code = process.wait()
    if return_code != 0:
        _, err = process.communicate()
        raise BackupFailed('could not create database backup ' + err)

    # Upload to S3
    upload_rotate(
        backup_dest,
        settings.BACKUP_AWS_STORAGE_BUCKET_NAME,
        settings.BACKUP_AWS_KEY_PREFIX,
        aws_key=settings.BACKUP_AWS_ACCESS_KEY_ID,
        aws_secret=settings.BACKUP_AWS_SECRET_ACCESS_KEY
    )


text:
package org.kairosdb.rollup;

import org.kairosdb.core.exception.KairosDBException;

public class RollUpException extends KairosDBException
{
	public RollUpException(String message)
	{
		super(message);
	}

	public RollUpException(String message, Throwable cause)
	{
		super(message, cause);
	}

	public RollUpException(Throwable cause)
	{
		super(cause);
	}
}


text:
'use strict';
var HTMLSelectHelper = require('../../helpers/html-select.helper.js');

module.exports = {

	examplePage : {
		//All elements in the page / section
		firstNumberField : element(by.model('first')),
		secondNumberField : element(by.model('second')),
		operator : element(by.model('operator')),
		goButton : element(by.id('gobutton')),
		resultField : element(by.binding('latest'))
	},

	getExamplePage : function () {
		return this.examplePage;
	},

	setFirstNumber : function (number) {
		this.getExamplePage().firstNumberField.clear();
		this.getExamplePage().firstNumberField.sendKeys(number);
	},

	setSecondNumber : function (number) {
		this.getExamplePage().secondNumberField.clear();
		this.getExamplePage().secondNumberField.sendKeys(number);
	},

	clickGo : function () {
		this.getExamplePage().goButton.click();
	},

	getResult : function () {
		return this.getExamplePage().resultField.getText();
	},

	setOperation : function (operator) {
		new HTMLSelectHelper(this.getExamplePage().operator).selectOptionByName(operator);
	}

};


text:
""" Location class for antennas/stations for the Virtual Radio Interferometer """

class Location(object):
	""" Location class to show coordinates of antennas/stations """
	def __init__(self, x, y, z):
		""" x,y,z coordinates are defined with respect to the center of the observatory,
		need to convert to geocentric coordinates at some point. """
		self.x = x # x coordinate (EW distance from observatory center)
		self.y = y # y coordinate (NS distance from observatory center)
		self.z = z # z coordinate (altitude rel. to observatory center)


text:
<?php
namespace Imtigger\OneExcel;

interface OneExcelWriterInterface
{
    public function create($output_format = Format::XLSX);

    public function setSheet($id);

    public function load($filename, $output_format = Format::XLSX, $input_format = Format::AUTO);

    public function writeCell($row_num, $column_num, $data, $data_type = ColumnType::STRING);

    public function writeRow($row_num, $data);

    public function output();
}


text:
<resources>
    <string name="app_name">Spotiwify</string>

    <string name="title_section1">Wifi Connection</string>
    <string name="title_section2">Time Periods</string>
    <string name="title_section3">Settings</string>

    <string name="navigation_drawer_open">Open navigation drawer</string>
    <string name="navigation_drawer_close">Close navigation drawer</string>

    <string name="action_example">Example action</string>

    <string name="action_settings">Settings</string>
</resources>


text:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
	class inicio extends CI_Controller{

		public function index(){
			$this->load->view("index");
		}

	}


text:
include ../Makefile.header

SRC= callsite.c generic_stack.c glist.c
OBJ= $(SRC:.c=.o)

include ../Makefile.base


text:
using System.Messaging;
using System;
using Messaging.Base;

namespace MsmqGateway.Core
{
    public class MessageQueueGateway : QueueGateway<MessageQueue>, IDisposable
    {
        MessageQueue msgQueue;

        public override string QueueName
        {
            get { return msgQueue.QueueName; }
        }

        public void Dispose()
        {
            if (msgQueue != null)
            {
                msgQueue.Dispose();
                msgQueue = null;
            }
        }

        public MessageQueueGateway(String q)
            : this(FindQueue(q))
		{
		}

		public MessageQueueGateway(MessageQueue queue)
		{
            SetQueue(queue);
		}

		public override MessageQueue GetQueue(){
			return msgQueue;
		}

        public override void SetQueue(MessageQueue queue)
        {
            msgQueue = queue;
        }

        static MessageQueue FindQueue(String q)
		{
			if (!MessageQueue.Exists(q))
			{
				return MessageQueue.Create(q);
			}
			else
				return new MessageQueue(q);
		}
	}
}


text:
<?php
namespace Procure\Domain\AccountPayable\Validator;

use Procure\Domain\AccountPayable\Validator\Header\APPostingValidator;
use Procure\Domain\AccountPayable\Validator\Header\DefaultHeaderValidator;
use Procure\Domain\AccountPayable\Validator\Header\GrDateAndWarehouseValidator;
use Procure\Domain\AccountPayable\Validator\Header\IncotermValidator;
use Procure\Domain\AccountPayable\Validator\Header\InvoiceAndPaymentTermValidator;
use Procure\Domain\AccountPayable\Validator\Row\DefaultRowValidator;
use Procure\Domain\AccountPayable\Validator\Row\GLAccountValidator;
use Procure\Domain\AccountPayable\Validator\Row\PoRowValidator;
use Procure\Domain\AccountPayable\Validator\Row\WarehouseValidator;
use Procure\Domain\Service\SharedService;
use Procure\Domain\Service\ValidationServiceImpl;
use Procure\Domain\Validator\HeaderValidatorCollection;
use Procure\Domain\Validator\RowValidatorCollection;
use Webmozart\Assert\Assert;
use InvalidArgumentException;

/**
 *
 * @author Nguyen Mau Tri - ngmautri@gmail.com
 *
 */
class ValidatorFactory
{

    /**
     *
     * @param SharedService $sharedService
     * @param boolean $isPosting
     * @throws InvalidArgumentException
     * @return \Procure\Domain\Service\ValidationServiceImpl
     */
    public static function create(SharedService $sharedService, $isPosting = false)
    {
        Assert::notNull($sharedService, "SharedService not found");

        $fxService = $sharedService->getFxService();

        $sharedSpecsFactory = $sharedService->getSharedSpecificationFactory();
        $domainSpecsFactory = $sharedService->getDomainSpecificationFactory();

        $headerValidators = new HeaderValidatorCollection();
        $validator = new DefaultHeaderValidator($sharedSpecsFactory, $fxService);
        $headerValidators->add($validator);

        $rowValidators = new RowValidatorCollection();
        $validator = new DefaultRowValidator($sharedSpecsFactory, $fxService);
        $rowValidators->add($validator);

        $validator = new WarehouseValidator($sharedSpecsFactory, $fxService);
        $rowValidators->add($validator);

        $validator = new GLAccountValidator($sharedSpecsFactory, $fxService);
        $rowValidators->add($validator);

        if ($isPosting) {
            $validator = new GrDateAndWarehouseValidator($sharedSpecsFactory, $fxService);
            $headerValidators->add($validator);
            $validator = new APPostingValidator($sharedSpecsFactory, $fxService);
            $headerValidators->add($validator);
        }

        return new ValidationServiceImpl($headerValidators, $rowValidators);
    }

    /**
     *
     * @param SharedService $sharedService
     * @param boolean $isPosting
     * @throws InvalidArgumentException
     * @return \Procure\Domain\Service\ValidationServiceImpl
     */
    public static function createForHeader(SharedService $sharedService, $isPosting = false)
    {
        if ($sharedService == null) {
            throw new InvalidArgumentException("SharedService service not found");
        }

        if ($sharedService->getSharedSpecificationFactory() == null) {
            throw new InvalidArgumentException("Shared specs service not found!");
        }

        $fxService = $sharedService->getFxService();
        $sharedSpecsFactory = $sharedService->getSharedSpecificationFactory();

        // Header Validators
        $headerValidators = new HeaderValidatorCollection();

        $validator = new DefaultHeaderValidator($sharedSpecsFactory, $fxService);
        $headerValidators->add($validator);

        $validator = new GrDateAndWarehouseValidator($sharedSpecsFactory, $fxService);
        $headerValidators->add($validator);

        $validator = new IncotermValidator($sharedSpecsFactory, $fxService);
        $headerValidators->add($validator);

        $validator = new InvoiceAndPaymentTermValidator($sharedSpecsFactory, $fxService);
        $headerValidators->add($validator);

        return new ValidationServiceImpl($headerValidators);
    }

    /**
     *
     * @param SharedService $sharedService
     * @param boolean $isPosting
     * @throws InvalidArgumentException
     * @return \Procure\Domain\Service\ValidationServiceImpl
     */
    public static function createForPosting(SharedService $sharedService, $isPosting = false)
    {
        if ($sharedService == null) {
            throw new \InvalidArgumentException("SharedService service not found");
        }

        if ($sharedService->getSharedSpecificationFactory() == null) {
            throw new \InvalidArgumentException("Shared spec service not found");
        }

        $fxService = $sharedService->getFxService();

        $sharedSpecFactory = $sharedService->getSharedSpecificationFactory();
        $domainSpecFactory = $sharedService->getDomainSpecificationFactory();

        $headerValidators = new HeaderValidatorCollection();

        $validator = new DefaultHeaderValidator($sharedSpecFactory, $fxService);
        $headerValidators->add($validator);

        $validator = new GrDateAndWarehouseValidator($sharedSpecFactory, $fxService);
        $headerValidators->add($validator);

        $validator = new APPostingValidator($sharedSpecFactory, $fxService);
        $headerValidators->add($validator);

        // =======================

        $rowValidators = new RowValidatorCollection();

        $validator = new DefaultRowValidator($sharedSpecFactory, $fxService);
        $rowValidators->add($validator);

        $validator = new PoRowValidator($sharedSpecFactory, $fxService, $domainSpecFactory);
        $rowValidators->add($validator);

        $validator = new WarehouseValidator($sharedSpecFactory, $fxService);
        $rowValidators->add($validator);

        $validator = new GLAccountValidator($sharedSpecFactory, $fxService);
        $rowValidators->add($validator);

        return new ValidationServiceImpl($headerValidators, $rowValidators);
    }

    /**
     *
     * @param SharedService $sharedService
     * @param boolean $isPosting
     * @throws InvalidArgumentException
     * @return \Procure\Domain\Service\ValidationServiceImpl
     */
    public static function createForCopyFromPO(SharedService $sharedService, $isPosting = false)
    {
        if ($sharedService == null) {
            throw new InvalidArgumentException("SharedService service not found");
        }

        if ($sharedService->getSharedSpecificationFactory() == null) {
            throw new InvalidArgumentException("Shared spec service not found");
        }

        $fxService = $sharedService->getFxService();

        $sharedSpecsFactory = $sharedService->getSharedSpecificationFactory();

        // Header validator
        $headerValidators = new HeaderValidatorCollection();
        $validator = new DefaultHeaderValidator($sharedSpecsFactory, $fxService);
        $headerValidators->add($validator);

        $validator = new InvoiceAndPaymentTermValidator($sharedSpecsFactory, $fxService);
        $headerValidators->add($validator);

        $validator = new GrDateAndWarehouseValidator($sharedSpecsFactory, $fxService);
        $headerValidators->add($validator);

        // Row validator
        $rowValidators = new RowValidatorCollection();
        $validator = new DefaultRowValidator($sharedSpecsFactory, $fxService);
        $rowValidators->add($validator);

        return new ValidationServiceImpl($headerValidators, $rowValidators);
    }
}


text:
package com.github.ac31007_group_8.quiz.student.controllers;

import com.github.ac31007_group_8.quiz.common.ParameterManager;
import com.github.ac31007_group_8.quiz.student.models.StudentQuizModel;
import com.github.ac31007_group_8.quiz.student.models.StudentResultModel;
import com.github.ac31007_group_8.quiz.util.Init;
import spark.Request;
import spark.Response;
import spark.TemplateEngine;
import spark.template.mustache.MustacheTemplateEngine;

import java.util.*;
import java.util.logging.Logger;

import com.github.ac31007_group_8.quiz.student.*;
import com.github.ac31007_group_8.quiz.staff.store.*;

import static spark.Spark.*;

/**
 * @author Kerr, Allan (adapted from Can and Allan)
 */
public class StudentResultManager {

    public StudentResultManager(){

    }

    @Init
    public static void init() {
        get("/student/getResult", StudentResultManager::serveGetResult);
    }

    public static Object serveGetResult(Request req, Response res){

        TemplateEngine eng = new MustacheTemplateEngine();
        HashMap<String, Object> map = ParameterManager.getAllParameters(req);

        String quizIDString = req.queryParams("quizID");//don't need this
        int resultID = Integer.parseInt(req.queryParams("resultID"));
        if (quizIDString == (null) || quizIDString.equals(""))
        {
            //display error page
            throw halt(400, eng.render(eng.modelAndView(map, "invalidQuiz.mustache")));
        }
        int quizID = Integer.parseInt(quizIDString);

        StudentQuizModel quizModel = new StudentQuizModel();
        Quiz quiz = quizModel.getCompleteQuiz(quizID);
        if (quiz == null)
        {
            throw halt(400, eng.render(eng.modelAndView(map, "invalidQuiz.mustache")));
        }

        if (!quiz.isPublish_status())
        {
            return eng.render(eng.modelAndView(map, "unpublishedQuiz.mustache"));
        }

        StudentResultModel studResMod = new StudentResultModel();
        List<Integer> studAnsIds = studResMod.getResultAnswers(resultID);

        for (Question nextQuestion: quiz.getQuestions()) {
            for (Answer answer: nextQuestion.getAnswers()) {
                if(studAnsIds.contains(answer.getAnswer_id()))
                {
                    answer.setIsStudentAnswer(true);
                }

            }
        }
        //TODO: Do this without re-calc
        int score = StudentQuizManager.calculateScore(studAnsIds,quiz);//I think we need to merge this class into StudentQuizManager (but can keep separate files for now)

        map.put("quizID", quizID);
        map.put("quiz", quiz);
        map.put("score", score);

        return eng.render(eng.modelAndView(map, "getResult.mustache"));

    }

}