text:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:mongo="http://www.springframework.org/schema/data/mongo"
xmlns:context="http://www.springframework.org/schema/context"
  xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
    http://www.springframework.org/schema/data/mongo
    http://www.springframework.org/schema/data/mongo/spring-mongo-1.0.xsd
    	http://www.springframework.org/schema/context
	http://www.springframework.org/schema/context/spring-context.xsd">

	<!-- Root Context: defines shared resources visible to all other web components -->
		    <!-- Factory bean that creates the Mongo instance -->
<!-- <bean id="mongo" class="org.springframework.data.mongodb.core.MongoFactoryBean">
        <property name="host" value="localhost" />
    </bean> -->

     <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
     	<property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE"/>

     	  <property name="ignoreResourceNotFound" value="true" />
  		<property name="locations">
		      <!-- Default location inside war file -->
		      <value>classpath*:/spring/properties/*-properties.properties</value>
	  </property>

	 </bean>

    <bean id="mongoEnv" class="src.main.java.startupconfig.DatabaseConfig">
        <constructor-arg name="userName" value="${OPENSHIFT_MONGODB_DB_USERNAME}"></constructor-arg>
        <constructor-arg name="password" value="${OPENSHIFT_MONGODB_DB_PASSWORD}"></constructor-arg>
        <constructor-arg name="host" value="${OPENSHIFT_MONGODB_DB_HOST}"></constructor-arg>
        <constructor-arg name="port" value="${OPENSHIFT_MONGODB_DB_PORT}"></constructor-arg>
    </bean>

<!-- <mongo:mongo id="mongo" /> -->

    <!-- MongoTemplate for connecting and quering the documents in the database -->
    <bean id="mongoTemplate" class="org.springframework.data.mongodb.core.MongoTemplate" depends-on="mongo">
      <!-- <constructor-arg name="mongo" ref="mongo" />
        <constructor-arg name="databaseName" value="fojax" />
        <constructor-arg name="userCredentials" value="userCredentials" /> -->
        <constructor-arg name="mongoDbFactory" ref="mongoDbFactory"></constructor-arg>
    </bean>

     <!-- Default bean name is 'mongo' -->
  <mongo:mongo host="#{mongoEnv.host}" port="#{T(java.lang.Integer).parseInt(mongoEnv.port)}"/>

  <mongo:db-factory id="mongoDbFactory" dbname="fojax" username="#{mongoEnv.userName}" password="#{mongoEnv.password}" mongo-ref="mongo" />

 <!-- <mongo:db-factory dbname="fojax" mongo-ref="mongo"/> -->
  <mongo:repositories base-package="src.main.java.repository**"></mongo:repositories>

  <bean class="org.springframework.data.mongodb.core.mapping.event.LoggingEventListener"/>

</beans>


text:
package wx_mch

import (
	"crypto/tls"
	"crypto/x509"
	"github.com/bysir-zl/bygo/log"
	"io/ioutil"
	"net/http"
	"bytes"
)

var tlsConfig *tls.Config

func getTLSConfig() (*tls.Config, error) {
	if tlsConfig != nil {
		return tlsConfig, nil
	}

	// load cert
	cert, err := tls.LoadX509KeyPair(certPemPath, keyPemPath)
	if err != nil {
		log.Error("load wechat keys fail", err)
		return nil, err
	}

	// load root ca
	caData, err := ioutil.ReadFile(cAPemPath)
	if err != nil {
		log.Error("read wechat ca fail", err)
		return nil, err
	}
	pool := x509.NewCertPool()
	pool.AppendCertsFromPEM(caData)

	tlsConfig = &tls.Config{
		Certificates: []tls.Certificate{cert},
		RootCAs:      pool,
	}
	return tlsConfig, nil
}
func SecurePost(url string, xmlContent []byte) ([]byte, error) {
	tlsConfig, err := getTLSConfig()
	if err != nil {
		return nil, err
	}

	tr := &http.Transport{TLSClientConfig: tlsConfig}
	client := &http.Client{Transport: tr}
	rsp, err := client.Post(url, "text/xml", bytes.NewBuffer(xmlContent))
	if err != nil {
		return nil, err
	}
	body, err := ioutil.ReadAll(rsp.Body)
	if err != nil {
		return nil, err
	}
	rsp.Body.Close()

	return body, nil
}

redpajama_set_name: RedPajamaGithub


text:
FactoryGirl.define do
  factory :susply_payment, :class => 'Susply::Payment' do
    owner_id 1
    plan_id 1
    subscription_id 1
    amount 1
    period_start "2015-05-21 17:26:35"
    period_end "2015-05-21 17:26:35"
    status "generated"
    invoice "MyString"
    generated_type "plan_renovation"
  end
end


text:
<html>
<body>

Support classes to configure OpenSpaces Jms using Spring namespace support.

</body>
</html>


text:
[![github-readme_header](https://cloud.githubusercontent.com/assets/2406615/17754363/6e205280-64d4-11e6-946d-e7e7aedb2e30.png)](https://www.pcextreme.nl)

# PHP Cloudstack Client

[![Latest Version](https://img.shields.io/github/tag/PCextreme/cloudstack-php.svg?style=flat-square)](https://github.com/PCextreme/cloudstack-php/tags)
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](https://github.com/PCextreme/cloudstack-php/blob/master/LICENSE)
[![Build Status](https://img.shields.io/travis/PCextreme/cloudstack-php/master.svg?style=flat-square)](https://travis-ci.org/PCextreme/cloudstack-php)
[![Scrutinizer](https://img.shields.io/scrutinizer/g/PCextreme/cloudstack-php/master.svg?style=flat-square)](https://scrutinizer-ci.com/g/PCextreme/cloudstack-php/)
[![Coverage Status](https://img.shields.io/coveralls/PCextreme/cloudstack-php/master.svg?style=flat-square)](https://coveralls.io/r/PCextreme/cloudstack-php?branch=master)

This package makes it simple to integrate the Cloudstack API in your PHP applications.

## Requirements

The following versions of PHP are supported:

* PHP 7.1 or higher

### Support for PHP 5.x has been dropped

In favour of stricter type hinting and return types we stopped supporting older PHP versions in new releases.

**Please note:** General support for PHP 5.x will be ending soon, [check the PHP documentation](http://php.net/supported-versions.php) for more information about PHP version support.

_If you still require support for PHP 5.x or HHVM you can use the `~0.2` [releases](/PCextreme/cloudstack-php/releases) of this package._

## Installation

Use `composer require` to add the client to your `composer.json` file, [please check the Composer documentation](https://getcomposer.org) for more information about Composer.

```
$ composer require pcextreme/cloudstack
```

## Usage

There are various ways to interact with the Cloudstack API using this package. The easiest and preferred way is to call the Cloudstack 'commands' directly as a method on the client.

Internally the client resolves the command using the `__call` magic method. The command will be automatically resolved and the provided options are verified. Also when everything goes as expected the API response is automatically parsed.

The client uses an API list mapping stored in the cache folder do determine if an API command exists and all required parameters are provided. This list is generated using Cloudstack's `listApis` command.

```php
<?php

include(__DIR__.'/vendor/autoload.php');

use PCextreme\Cloudstack\Client;

$client = new Client([
    'urlApi'    => 'https://api.auroracompute.eu/ams',
    'apiKey'    => 'YOUR-API-KEY',
    'secretKey' => 'YOUR-SECRET-KEY',
]);

var_dump($client->listAccounts(['name' => 'admin', 'listall' => 'true']));
```

### Directly calling the command method

Its also possible to bypass the `__call` magic method and call the `command` method directly.

```php
<?php

// Using an existing client instance.

$client->command('listAccounts', ['name' => 'admin', 'listall' => 'true']);
```

### Manually accessing the API

If for some reason the `cache/api_list.php` is removed, outdated or gets corrupted you can access the API directly by building a request manually. This bypasses all previously mentioned checks but still parses the response.

```php
<?php

// Using an existing client instance.

$command = 'listAccounts';
$options = ['name' => 'admin', 'listall' => 'true'];

$method  = $client->getCommandMethod($command);
$url     = $client->getCommandUrl($command, $options);
$request = $client->getRequest($method, $url, $options);

$accounts = $client->getResponse($request);
```

## Updating the API list

You can update or regenerate the provided API list using the `bin/cloudstack` CLI.

```
$ php bin/cloudstack api:list
```

You can also get a list of available CLI commands.

```
$ php bin/cloudstack
```

## Contributing

This package is open-source and welcomes issues and pull requests from anyone. Before opening pull requests, please read our short [Contribution Guide](./CONTRIBUTING.md).

## Credits

- [Kevin Dierkx](https://github.com/kevindierkx)
- [Jesse Kramer](https://github.com/FrontEndCoffee)
- [All Contributors](https://github.com/pcextreme/cloudstack-php/contributors)

## License

The MIT License (MIT). Please see [License File](LICENSE) for more information.


text:
        {{--<form action="#" method="get" class="sidebar-form">--}}
            {{--
--}}
                {{--<input type="text" name="q" class="form-control" placeholder="{{ trans('strings.backend.general.search_placeholder') }}"/>--}}
                  {{----}}
                    {{--<button type='submit' name='search' id='search-btn' class="btn btn-flat"></button>--}}
                  {{----}}
            {{--
--}}
        {{--</form>--}}

            @permission('view-ocean')

                        {{ trans('member/menus.rates.title') }}

                            {{ trans('member/oceans.index') }}

            @endauth


text:
package command

import (
	"bufio"
	"bytes"
	"fmt"
	"io"
	"os/exec"
	"path"
	"strconv"
	"strings"
	"sync"
	"time"

	"github.com/golang/glog"
	"github.com/kballard/go-shellquote"
	"github.com/pkg/errors"
	"golang.org/x/crypto/ssh"
	"golang.org/x/sync/errgroup"
	"k8s.io/minikube/pkg/minikube/assets"
)

var (
	layout = "2006-01-02 15:04:05.999999999 -0700"
)

// SSHRunner runs commands through SSH.
//
// It implements the CommandRunner interface.
type SSHRunner struct {
	c *ssh.Client
}

// NewSSHRunner returns a new SSHRunner that will run commands
// through the ssh.Client provided.
func NewSSHRunner(c *ssh.Client) *SSHRunner {
	return &SSHRunner{c}
}

// Remove runs a command to delete a file on the remote.
func (s *SSHRunner) Remove(f assets.CopyableFile) error {
	sess, err := s.c.NewSession()
	if err != nil {
		return errors.Wrap(err, "getting ssh session")
	}
	defer sess.Close()
	cmd := getDeleteFileCommand(f)
	return sess.Run(cmd)
}

// teeSSH runs an SSH command, streaming stdout, stderr to logs
func teeSSH(s *ssh.Session, cmd string, outB io.Writer, errB io.Writer) error {
	outPipe, err := s.StdoutPipe()
	if err != nil {
		return errors.Wrap(err, "stdout")
	}

	errPipe, err := s.StderrPipe()
	if err != nil {
		return errors.Wrap(err, "stderr")
	}
	var wg sync.WaitGroup
	wg.Add(2)

	go func() {
		if err := teePrefix(ErrPrefix, errPipe, errB, glog.V(8).Infof); err != nil {
			glog.Errorf("tee stderr: %v", err)
		}
		wg.Done()
	}()
	go func() {
		if err := teePrefix(OutPrefix, outPipe, outB, glog.V(8).Infof); err != nil {
			glog.Errorf("tee stdout: %v", err)
		}
		wg.Done()
	}()
	err = s.Run(cmd)
	wg.Wait()
	return err
}

// RunCmd implements the Command Runner interface to run a exec.Cmd object
func (s *SSHRunner) RunCmd(cmd *exec.Cmd) (*RunResult, error) {
	rr := &RunResult{Args: cmd.Args}
	glog.Infof("Run: %v", rr.Command())

	var outb, errb io.Writer
	start := time.Now()

	if cmd.Stdout == nil {
		var so bytes.Buffer
		outb = io.MultiWriter(&so, &rr.Stdout)
	} else {
		outb = io.MultiWriter(cmd.Stdout, &rr.Stdout)
	}

	if cmd.Stderr == nil {
		var se bytes.Buffer
		errb = io.MultiWriter(&se, &rr.Stderr)
	} else {
		errb = io.MultiWriter(cmd.Stderr, &rr.Stderr)
	}

	sess, err := s.c.NewSession()
	if err != nil {
		return rr, errors.Wrap(err, "NewSession")
	}

	defer func() {
		if err := sess.Close(); err != nil {
			if err != io.EOF {
				glog.Errorf("session close: %v", err)
			}
		}
	}()

	err = teeSSH(sess, shellquote.Join(cmd.Args...), outb, errb)
	elapsed := time.Since(start)

	if exitError, ok := err.(*exec.ExitError); ok {
		rr.ExitCode = exitError.ExitCode()
	}
	// Decrease log spam
	if elapsed > (1 * time.Second) {
		glog.Infof("Completed: %s: (%s)", rr.Command(), elapsed)
	}
	if err == nil {
		return rr, nil
	}

	return rr, fmt.Errorf("%s: %v\nstdout:\n%s\nstderr:\n%s", rr.Command(), err, rr.Stdout.String(), rr.Stderr.String())
}

// Copy copies a file to the remote over SSH.
func (s *SSHRunner) Copy(f assets.CopyableFile) error {
	dst := path.Join(path.Join(f.GetTargetDir(), f.GetTargetName()))
	exists, err := s.sameFileExists(f, dst)
	if err != nil {
		glog.Infof("Checked if %s exists, but got error: %v", dst, err)
	}
	if exists {
		glog.Infof("Skipping copying %s as it already exists", dst)
		return nil
	}
	sess, err := s.c.NewSession()
	if err != nil {
		return errors.Wrap(err, "NewSession")
	}

	w, err := sess.StdinPipe()
	if err != nil {
		return errors.Wrap(err, "StdinPipe")
	}
	// The scpcmd below *should not* return until all data is copied and the
	// StdinPipe is closed. But let's use errgroup to make it explicit.
	var g errgroup.Group
	var copied int64
	glog.Infof("Transferring %d bytes to %s", f.GetLength(), dst)

	g.Go(func() error {
		defer w.Close()
		header := fmt.Sprintf("C%s %d %s\n", f.GetPermissions(), f.GetLength(), f.GetTargetName())
		fmt.Fprint(w, header)
		if f.GetLength() == 0 {
			glog.Warningf("%s is a 0 byte asset!", f.GetTargetName())
			fmt.Fprint(w, "\x00")
			return nil
		}

		copied, err = io.Copy(w, f)
		if err != nil {
			return errors.Wrap(err, "io.Copy")
		}
		if copied != int64(f.GetLength()) {
			return fmt.Errorf("%s: expected to copy %d bytes, but copied %d instead", f.GetTargetName(), f.GetLength(), copied)
		}
		glog.Infof("%s: copied %d bytes", f.GetTargetName(), copied)
		fmt.Fprint(w, "\x00")
		return nil
	})

	scp := fmt.Sprintf("sudo test -d %s && sudo scp -t %s", f.GetTargetDir(), f.GetTargetDir())
	mtime, err := f.GetModTime()
	if err != nil {
		glog.Infof("error getting modtime for %s: %v", dst, err)
	} else {
		scp += fmt.Sprintf(" && sudo touch -d \"%s\" %s", mtime.Format(layout), dst)
	}
	out, err := sess.CombinedOutput(scp)
	if err != nil {
		return fmt.Errorf("%s: %s\noutput: %s", scp, err, out)
	}
	return g.Wait()
}

func (s *SSHRunner) sameFileExists(f assets.CopyableFile, dst string) (bool, error) {
	// get file size and modtime of the source
	srcSize := f.GetLength()
	srcModTime, err := f.GetModTime()
	if err != nil {
		return false, err
	}
	if srcModTime.IsZero() {
		return false, nil
	}

	// get file size and modtime of the destination
	sess, err := s.c.NewSession()
	if err != nil {
		return false, err
	}

	cmd := "stat -c \"%s %y\" " + dst
	out, err := sess.CombinedOutput(cmd)
	if err != nil {
		return false, err
	}
	outputs := strings.SplitN(strings.Trim(string(out), "\n"), " ", 2)

	dstSize, err := strconv.Atoi(outputs[0])
	if err != nil {
		return false, err
	}
	dstModTime, err := time.Parse(layout, outputs[1])
	if err != nil {
		return false, err
	}
	glog.Infof("found %s: %d bytes, modified at %s", dst, dstSize, dstModTime)

	// compare sizes and modtimes
	if srcSize != dstSize {
		return false, errors.New("source file and destination file are different sizes")
	}

	return srcModTime.Equal(dstModTime), nil
}

// teePrefix copies bytes from a reader to writer, logging each new line.
func teePrefix(prefix string, r io.Reader, w io.Writer, logger func(format string, args ...interface{})) error {
	scanner := bufio.NewScanner(r)
	scanner.Split(bufio.ScanBytes)
	var line bytes.Buffer

	for scanner.Scan() {
		b := scanner.Bytes()
		if _, err := w.Write(b); err != nil {
			return err
		}
		if bytes.IndexAny(b, "\r\n") == 0 {
			if line.Len() > 0 {
				logger("%s%s", prefix, line.String())
				line.Reset()
			}
			continue
		}
		line.Write(b)
	}
	// Catch trailing output in case stream does not end with a newline
	if line.Len() > 0 {
		logger("%s%s", prefix, line.String())
	}
	return nil
}


text:
<!DOCTYPE html>
<html>
    <head>
        <title>audiovisual</title>
        <meta http-equiv="content-type" content="text/html; charset=UTF8" />
        <meta name="viewport" content="width=device-width, initial-scale=1" />
    </head>
    <body>
    </body>
</html>


text:
package com.mastercard.api.location.v1.merchants.domain.options;

public class CountryMerchantLocationRequestOptions {

    private String details;

    public CountryMerchantLocationRequestOptions(String details){
        this.details = details;
    }

    public String getDetails(){
        return this.details;
    }
}


text:
#ifndef TENSORFLOW_LITE_DELEGATES_GPU_CL_CL_PROGRAM_H_
#define TENSORFLOW_LITE_DELEGATES_GPU_CL_CL_PROGRAM_H_

#include <cstdint>
#include <vector>

#include "absl/types/span.h"
#include "tensorflow/lite/delegates/gpu/cl/cl_context.h"
#include "tensorflow/lite/delegates/gpu/cl/cl_device.h"
#include "tensorflow/lite/delegates/gpu/cl/opencl_wrapper.h"
#include "tensorflow/lite/delegates/gpu/common/status.h"
#include "tensorflow/lite/delegates/gpu/common/task/compiler_options.h"

namespace tflite {
namespace gpu {
namespace cl {

std::string CompilerOptionsToString(
    const GpuInfo& gpu_info,
    const std::vector<CompilerOptions>& compiler_options);

class CLProgram {
 public:
  CLProgram() {}
  CLProgram(cl_program program, cl_device_id device_id);

  // Move only
  CLProgram(CLProgram&& program);
  CLProgram& operator=(CLProgram&& program);
  CLProgram(const CLProgram&) = delete;
  CLProgram& operator=(const CLProgram&) = delete;

  ~CLProgram();

  cl_program program() const { return program_; }

  // Return the cl_device_id associated with the program object.
  // This can be the device associated with context on which the program object
  // has been created or can be device that was specified when a program object
  // was created using clCreateProgramWithBinary.
  cl_device_id GetDeviceId() const { return device_id_; }

  absl::Status GetBinary(std::vector<uint8_t>* result) const;

 private:
  void Release();

  cl_program program_ = nullptr;

  // reference
  cl_device_id device_id_ = nullptr;
};

absl::Status CreateCLProgram(const std::string& code,
                             const std::string& compiler_options,
                             const CLContext& context, const CLDevice& device,
                             CLProgram* result);

absl::Status CreateCLProgramFromBinary(const CLContext& context,
                                       const CLDevice& device,
                                       absl::Span<const uint8_t> binary,
                                       CLProgram* result);

}  // namespace cl
}  // namespace gpu
}  // namespace tflite

#endif  // TENSORFLOW_LITE_DELEGATES_GPU_CL_CL_PROGRAM_H_


text:
use Search::Kino03::KinoSearch;

1;

__END__

__AUTO_XS__

my $synopsis = <<END_SYNOPSIS;
    # Abstract base class.
END_SYNOPSIS

my $constructor = <<'END_CONSTRUCTOR';
    my $writer = MyDataWriter->new(
        snapshot   => $snapshot,      # required
        segment    => $segment,       # required
        polyreader => $polyreader,    # required
    );
END_CONSTRUCTOR

{   "Search::Kino03::KinoSearch::Index::DataWriter" => {
        bind_methods => [
            qw(
                Add_Inverted_Doc
                Add_Segment
                Delete_Segment
                Merge_Segment
                Finish
                Format
                Metadata
                Get_Snapshot
                Get_Segment
                Get_PolyReader
                Get_Schema
                Get_Folder
                )
        ],
        make_constructors => ["new"],
        make_pod          => {
            synopsis    => $synopsis,
            constructor => { sample => $constructor },
            methods     => [
                qw(
                    add_inverted_doc
                    add_segment
                    delete_segment
                    merge_segment
                    finish
                    format
                    metadata
                    get_snapshot
                    get_segment
                    get_polyreader
                    get_schema
                    get_folder
                    )
            ],
        },
    }
}

__COPYRIGHT__

Copyright 2005-2009 Marvin Humphrey

This program is free software; you can redistribute it and/or modify
under the same terms as Perl itself.


text:
<PackageItem xmlns:tcm="http://www.tridion.com/ContentManager/5.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.sdltridion.com/ContentManager/ImportExport/Package/2013">
  <Data>
    <tcm:Data>
      <tcm:Title>SmartTarget</tcm:Title>
      <tcm:Type>Normal</tcm:Type>
      <tcm:Schema xlink:type="simple" xlink:title="Module Configuration" xlink:href="/webdav/100%20Master/Building%20Blocks/Framework/Developer/Schemas/Module%20Configuration.xsd" IsMandatory="false" />
      <tcm:Content>
        <ModuleConfiguration xmlns="http://www.sdl.com/web/schemas/core">
          <name>SmartTarget</name>
          <softwareVersion>2.0</softwareVersion>
          <isActive>Yes</isActive>
          <furtherConfiguration xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="/webdav/100%20Master/Building%20Blocks/Settings/ExperienceOptimization/Site%20Manager/Experience%20Optimization%20Configuration.xml" xlink:title="Experience Optimization Configuration" />
        </ModuleConfiguration>
      </tcm:Content>
      <tcm:Metadata />
      <tcm:IsBasedOnTridionWebSchema>true</tcm:IsBasedOnTridionWebSchema>
      <tcm:MultimediaType xlink:type="simple" xlink:title="" xlink:href="tcm:0-0-0" />
    </tcm:Data>
  </Data>
  <Dependencies>
    <Dependency dependencyType="Publication" itemUrl="/webdav/100%20Master" linkName="LocationInfo/ContextRepository" />
    <Dependency dependencyType="OrganizationalItemFolder" itemUrl="/webdav/100%20Master/Building%20Blocks/Modules/ExperienceOptimization/Admin" linkName="LocationInfo/OrganizationalItem" />
    <Dependency dependencyType="LinkedComponent" itemUrl="/webdav/100%20Master/Building%20Blocks/Settings/ExperienceOptimization/Site%20Manager/Experience%20Optimization%20Configuration.xml" linkName="Content" xpath="*[local-name() = 'ModuleConfiguration'][1]/*[local-name() = 'furtherConfiguration'][1]/@xlink:href" />
    <Dependency dependencyType="Schema" itemUrl="/webdav/100%20Master/Building%20Blocks/Framework/Developer/Schemas/Module%20Configuration.xsd" linkName="Schema" />
  </Dependencies>
</PackageItem>


text:
{% load i18n %}
{% load gui_utils %}
<script type="text/javascript">
  HISTORY_GRAPH_OBJECTS = {}; {# Clear object cache #}
  var VM = {
    '{{ vm.hostname }}': {
      'tasks': {} {# Always start with empty task dict, because we are not interested in older running tasks => we do not want to update the graphs for graphs requested in the past #}
    }
  };
  {% if obj_operational %}
  $(document).ready(function() {
    mon_history_init('vm', '{{ vm.hostname }}', {{ graphs|json|safe }});
  });
  {% endif %}
</script>

{% include "gui/vm/monitoring_graph_templates.html" %}


text:
(function (){

  'use strict';

  var module = angular.module('myApp.version', [
    'myApp.version.interpolate-filter',
    'myApp.version.version-directive'
  ]);

  module.constant('AppVersion', '0.4');
  module.constant('serverUrl', 'http://mrjson.com/api');

})();


text:
die()
{
  echo >&2 "$@"
  exit 1
}

isnumber() { test "$1" && printf '%f' "$1" >/dev/null; }

integerregexp='^[0-9]+$'

# Ensure that the user provided the correct number of arguments
if [ "$#" -ne 3 ]; then
  echo "Invalid number of arguments."
  echo "Usage:" $0 "xml_file_name end_time output_frequency"
  exit 1
fi

# Ensure that the user provided valid arguments
[ -e "$1" ] || die "Error, first argument must be a file name. Exiting."
isnumber "$2"
[ $? -eq 0 ] || die "Error, second argument must be a scalar. Exiting." # TODO: Check if this argument is positive
isnumber "$3"
[ $? -eq 0 ] || die "Error, third argument must be a scalar. Exiting." # TODO: Check if this argument is positive

xml_file_name=$1
end_time=$2
output_frequency=$3

output_directory=$(uuidgen)

# Ensure that the data storage directory does not exist
if [ -d $output_directory ]; then
  echo "Failed to execute test. Temporary output directory" $output_directory "already exists."
  exit 1
fi

# Check whether the proper Python modules are installed
python -c "import h5py" 2> /dev/null
if [ $? -ne 0 ] ; then
  echo "Error, static particle test requires the 'h5py' Python module."
  exit 1
fi

# Create a directory to store test output
mkdir $output_directory
if [ $? -ne 0 ] ; then
  echo "Failed to create directory" $output_directory ". Exiting."
  exit 1
fi

# Run an initial, full simulation
./rigidbody2d_cli $xml_file_name -e $end_time -o $output_directory -f $output_frequency > /dev/null
if [ $? -ne 0 ] ; then
  echo "Failed to execute initial simulation run. Exiting."
  rm -rf $output_directory
  exit 1
fi

# For each output file
for output_state_file in $output_directory/*.h5
do
  python assets/shell_scripts/static_particle_test.py -i $output_state_file
  if [ $? -ne 0 ] ; then
    echo "State of file $output_state_file appears incorrect"
    rm -rf $output_directory
    exit 1
  fi
done

# Clean up
rm -rf $output_directory
if [ $? -ne 0 ] ; then
  echo "Failed to clean up after test. Exiting."
  exit 1
fi

exit 0


text:
require 'pathname'
require_relative 'lib/file_parser'

puts 'User Story 4 execution by Liam Lagay'
puts Time.now

file = FileParser.new('/TestFiles/testdata.txt', number_of_lines_per_account:3)
entries = file.load_accounts_from_file

entries.each do |entry|
  puts entry.account.account_number
  puts 'POSSIBLE ACCOUNT NUMBERS ' + entry.possible_account_numbers.inspect unless entry.possible_account_numbers.size < 1
  puts '>>>>>>>>>'
end