text:
<link rel="import" href="data-header/data-header.html">
<link rel="import" href="build-process/build-process.html">
<link rel="import" href="create-config/create-config.html">
<link rel="import" href="error-page/error-page.html">
<link rel="import" href="show-issues/show-issues.html">

<dom-module id="main-page">
  <template>

    <app-location route="{{route}}"></app-location>
          <app-route
            route="{{route}}"
            pattern="/:page"
            data="{{routeData}}"
            tail="{{subroute}}"></app-route>
           <app-route
            route="{{subroute}}"
            pattern="build_process/:subPage"
            data="{{subrouteData}}"
            tail="{{tail}}"></app-route>

    <app-drawer-layout>

      <app-drawer slot="drawer" align="right">

Menu

        <iron-selector selected="{{page}}" attr-for-selected="name" class="drawer-list" role="navigation">
          Create Config
          Build Process
          Show Issues
        </iron-selector>
      </app-drawer>

      <app-toolbar>

Linterhub build info

        <paper-icon-button icon="menu" drawer-toggle></paper-icon-button>
      </app-toolbar>

      <sample-content size="100">

        <data-header></data-header>

        <iron-pages
          selected="{{page}}"
          attr-for-selected="name"
          fallback-selection="view404"
          role="navigation">

          <build-process
            subroute="{{subroute}}"
            name="build_process"/></build-process >

          <create-config name="create_config"></create-config>

          <show-issues name="show_issues"></show-issues>

        </iron-pages>

      </sample-content>

    </app-drawer-layout>

  </template>

</dom-module>


text:
[MVN Plugins][1]
================

Description
-----------

MVN Plugins holds a handy collection of maven plugins.

Plugins
-------

* Maven Graph Plugin: Uses the  graphviz command line tool 'dot' to generate a graphical representation of the project dependencies.
* Maven Uberize Plugin:  Provides the capability to package the artifact in an uber-jar, including its dependencies and
  to shade/rename/relocate the packages of some of the dependencies.
* Maven Avro Plugin:  Compiles Avro definition files see: http://hadoop.apache.org/avro/

... that's it (for now) ...

Project Links
-------------

* [Project Home][1]
* [GitHub](http://github.com/chirino/mvnplugins/tree/master)
* Source: `git clone git://forge.fusesource.com/mvnplugins.git`

[1]: http://mvnplugins.fusesource.org "Project Home Page"

redpajama_set_name: RedPajamaGithub


text:
package cloudstack44

import (
	"encoding/json"
	"fmt"
	"net/url"
	"strconv"
	"strings"
)

type CreateSecurityGroupParams struct {
	p map[string]interface{}
}

func (p *CreateSecurityGroupParams) toURLValues() url.Values {
	u := url.Values{}
	if p.p == nil {
		return u
	}
	if v, found := p.p["account"]; found {
		u.Set("account", v.(string))
	}
	if v, found := p.p["description"]; found {
		u.Set("description", v.(string))
	}
	if v, found := p.p["domainid"]; found {
		u.Set("domainid", v.(string))
	}
	if v, found := p.p["name"]; found {
		u.Set("name", v.(string))
	}
	if v, found := p.p["projectid"]; found {
		u.Set("projectid", v.(string))
	}
	return u
}

func (p *CreateSecurityGroupParams) SetAccount(v string) {
	if p.p == nil {
		p.p = make(map[string]interface{})
	}
	p.p["account"] = v
	return
}

func (p *CreateSecurityGroupParams) SetDescription(v string) {
	if p.p == nil {
		p.p = make(map[string]interface{})
	}
	p.p["description"] = v
	return
}

func (p *CreateSecurityGroupParams) SetDomainid(v string) {
	if p.p == nil {
		p.p = make(map[string]interface{})
	}
	p.p["domainid"] = v
	return
}

func (p *CreateSecurityGroupParams) SetName(v string) {
	if p.p == nil {
		p.p = make(map[string]interface{})
	}
	p.p["name"] = v
	return
}

func (p *CreateSecurityGroupParams) SetProjectid(v string) {
	if p.p == nil {
		p.p = make(map[string]interface{})
	}
	p.p["projectid"] = v
	return
}

// You should always use this function to get a new CreateSecurityGroupParams instance,
// as then you are sure you have configured all required params
func (s *SecurityGroupService) NewCreateSecurityGroupParams(name string) *CreateSecurityGroupParams {
	p := &CreateSecurityGroupParams{}
	p.p = make(map[string]interface{})
	p.p["name"] = name
	return p
}

// Creates a security group
func (s *SecurityGroupService) CreateSecurityGroup(p *CreateSecurityGroupParams) (*CreateSecurityGroupResponse, error) {
	resp, err := s.cs.newRequest("createSecurityGroup", p.toURLValues())
	if err != nil {
		return nil, err
	}

	var r CreateSecurityGroupResponse
	if err := json.Unmarshal(resp, &r); err != nil {
		return nil, err
	}
	return &r, nil
}

type CreateSecurityGroupResponse struct {
	Account     string `json:"account,omitempty"`
	Description string `json:"description,omitempty"`
	Domain      string `json:"domain,omitempty"`
	Domainid    string `json:"domainid,omitempty"`
	Egressrule  []struct {
		Account           string `json:"account,omitempty"`
		Cidr              string `json:"cidr,omitempty"`
		Endport           int    `json:"endport,omitempty"`
		Icmpcode          int    `json:"icmpcode,omitempty"`
		Icmptype          int    `json:"icmptype,omitempty"`
		Protocol          string `json:"protocol,omitempty"`
		Ruleid            string `json:"ruleid,omitempty"`
		Securitygroupname string `json:"securitygroupname,omitempty"`
		Startport         int    `json:"startport,omitempty"`
		Tags              []struct {
			Account      string `json:"account,omitempty"`
			Customer     string `json:"customer,omitempty"`
			Domain       string `json:"domain,omitempty"`
			Domainid     string `json:"domainid,omitempty"`
			Key          string `json:"key,omitempty"`
			Project      string `json:"project,omitempty"`
			Projectid    string `json:"projectid,omitempty"`
			Resourceid   string `json:"resourceid,omitempty"`
			Resourcetype string `json:"resourcetype,omitempty"`
			Value        string `json:"value,omitempty"`
		} `json:"tags,omitempty"`
	} `json:"egressrule,omitempty"`
	Id          string `json:"id,omitempty"`
	Ingressrule []struct {
		Account           string `json:"account,omitempty"`
		Cidr              string `json:"cidr,omitempty"`
		Endport           int    `json:"endport,omitempty"`
		Icmpcode          int    `json:"icmpcode,omitempty"`
		Icmptype          int    `json:"icmptype,omitempty"`
		Protocol          string `json:"protocol,omitempty"`
		Ruleid            string `json:"ruleid,omitempty"`
		Securitygroupname string `json:"securitygroupname,omitempty"`
		Startport         int    `json:"startport,omitempty"`
		Tags              []struct {
			Account      string `json:"account,omitempty"`
			Customer     string `json:"customer,omitempty"`
			Domain       string `json:"domain,omitempty"`
			Domainid     string `json:"domainid,omitempty"`
			Key          string `json:"key,omitempty"`
			Project      string `json:"project,omitempty"`
			Projectid    string `json:"projectid,omitempty"`
			Resourceid   string `json:"resourceid,omitempty"`
			Resourcetype string `json:"resourcetype,omitempty"`
			Value        string `json:"value,omitempty"`
		} `json:"tags,omitempty"`
	} `json:"ingressrule,omitempty"`
	Name      string `json:"name,omitempty"`
	Project   string `json:"project,omitempty"`
	Projectid string `json:"projectid,omitempty"`
	Tags      []struct {
		Account      string `json:"account,omitempty"`
		Customer     string `json:"customer,omitempty"`
		Domain       string `json:"domain,omitempty"`
		Domainid     string `json:"domainid,omitempty"`
		Key          string `json:"key,omitempty"`
		Project      string `json:"project,omitempty"`
		Projectid    string `json:"projectid,omitempty"`
		Resourceid   string `json:"resourceid,omitempty"`
		Resourcetype string `json:"resourcetype,omitempty"`
		Value        string `json:"value,omitempty"`
	} `json:"tags,omitempty"`
}

type DeleteSecurityGroupParams struct {
	p map[string]interface{}
}

func (p *DeleteSecurityGroupParams) toURLValues() url.Values {
	u := url.Values{}
	if p.p == nil {
		return u
	}
	if v, found := p.p["account"]; found {
		u.Set("account", v.(string))
	}
	if v, found := p.p["domainid"]; found {
		u.Set("domainid", v.(string))
	}
	if v, found := p.p["id"]; found {
		u.Set("id", v.(string))
	}
	if v, found := p.p["name"]; found {
		u.Set("name", v.(string))
	}
	if v, found := p.p["projectid"]; found {
		u.Set("projectid", v.(string))
	}
	return u
}

func (p *DeleteSecurityGroupParams) SetAccount(v string) {
	if p.p == nil {
		p.p = make(map[string]interface{})
	}
	p.p["account"] = v
	return
}

func (p *DeleteSecurityGroupParams) SetDomainid(v string) {
	if p.p == nil {
		p.p = make(map[string]interface{})
	}
	p.p["domainid"] = v
	return
}

func (p *DeleteSecurityGroupParams) SetId(v string) {
	if p.p == nil {
		p.p = make(map[string]interface{})
	}
	p.p["id"] = v
	return
}

func (p *DeleteSecurityGroupParams) SetName(v string) {
	if p.p == nil {
		p.p = make(map[string]interface{})
	}
	p.p["name"] = v
	return
}

func (p *DeleteSecurityGroupParams) SetProjectid(v string) {
	if p.p == nil {
		p.p = make(map[string]interface{})
	}
	p.p["projectid"] = v
	return
}

// You should always use this function to get a new DeleteSecurityGroupParams instance,
// as then you are sure you have configured all required params
func (s *SecurityGroupService) NewDeleteSecurityGroupParams() *DeleteSecurityGroupParams {
	p := &DeleteSecurityGroupParams{}
	p.p = make(map[string]interface{})
	return p
}

// Deletes security group
func (s *SecurityGroupService) DeleteSecurityGroup(p *DeleteSecurityGroupParams) (*DeleteSecurityGroupResponse, error) {
	resp, err := s.cs.newRequest("deleteSecurityGroup", p.toURLValues())
	if err != nil {
		return nil, err
	}

	var r DeleteSecurityGroupResponse
	if err := json.Unmarshal(resp, &r); err != nil {
		return nil, err
	}
	return &r, nil
}

type DeleteSecurityGroupResponse struct {
	Displaytext string `json:"displaytext,omitempty"`
	Success     string `json:"success,omitempty"`
}

type AuthorizeSecurityGroupIngressParams struct {
	p map[string]interface{}
}

func (p *AuthorizeSecurityGroupIngressParams) toURLValues() url.Values {
	u := url.Values{}
	if p.p == nil {
		return u
	}
	if v, found := p.p["account"]; found {
		u.Set("account", v.(string))
	}
	if v, found := p.p["cidrlist"]; found {
		vv := strings.Join(v.([]string), ", ")
		u.Set("cidrlist", vv)
	}
	if v, found := p.p["domainid"]; found {
		u.Set("domainid", v.(string))
	}
	if v, found := p.p["endport"]; found {
		vv := strconv.Itoa(v.(int))
		u.Set("endport", vv)
	}
	if v, found := p.p["icmpcode"]; found {
		vv := strconv.Itoa(v.(int))
		u.Set("icmpcode", vv)
	}
	if v, found := p.p["icmptype"]; found {
		vv := strconv.Itoa(v.(int))
		u.Set("icmptype", vv)
	}
	if v, found := p.p["projectid"]; found {
		u.Set("projectid", v.(string))
	}
	if v, found := p.p["protocol"]; found {
		u.Set("protocol", v.(string))
	}
	if v, found := p.p["securitygroupid"]; found {
		u.Set("securitygroupid", v.(string))
	}
	if v, found := p.p["securitygroupname"]; found {
		u.Set("securitygroupname", v.(string))
	}
	if v, found := p.p["startport"]; found {
		vv := strconv.Itoa(v.(int))
		u.Set("startport", vv)
	}
	if v, found := p.p["usersecuritygrouplist"]; found {
		i := 0
		for k, vv := range v.(map[string]string) {
			u.Set(fmt.Sprintf("usersecuritygrouplist[%d].key", i), k)
			u.Set(fmt.Sprintf("usersecuritygrouplist[%d].value", i), vv)
			i++
		}
	}
	return u
}

func (p *AuthorizeSecurityGroupIngressParams) SetAccount(v string) {
	if p.p == nil {
		p.p = make(map[string]interface{})
	}
	p.p["account"] = v
	return
}

func (p *AuthorizeSecurityGroupIngressParams) SetCidrlist(v []string) {
	if p.p == nil {
		p.p = make(map[string]interface{})
	}
	p.p["cidrlist"] = v
	return
}

func (p *AuthorizeSecurityGroupIngressParams) SetDomainid(v string) {
	if p.p == nil {
		p.p = make(map[string]interface{})
	}
	p.p["domainid"] = v
	return
}

func (p *AuthorizeSecurityGroupIngressParams) SetEndport(v int) {
	if p.p == nil {
		p.p = make(map[string]interface{})
	}
	p.p["endport"] = v
	return
}

func (p *AuthorizeSecurityGroupIngressParams) SetIcmpcode(v int) {
	if p.p == nil {
		p.p = make(map[string]interface{})
	}
	p.p["icmpcode"] = v
	return
}

func (p *AuthorizeSecurityGroupIngressParams) SetIcmptype(v int) {
	if p.p == nil {
		p.p = make(map[string]interface{})
	}
	p.p["icmptype"] = v
	return
}

func (p *AuthorizeSecurityGroupIngressParams) SetProjectid(v string) {
	if p.p == nil {
		p.p = make(map[string]interface{})
	}
	p.p["projectid"] = v
	return
}

func (p *AuthorizeSecurityGroupIngressParams) SetProtocol(v string) {
	if p.p == nil {
		p.p = make(map[string]interface{})
	}
	p.p["protocol"] = v
	return
}

func (p *AuthorizeSecurityGroupIngressParams) SetSecuritygroupid(v string) {
	if p.p == nil {
		p.p = make(map[string]interface{})
	}
	p.p["securitygroupid"] = v
	return
}

func (p *AuthorizeSecurityGroupIngressParams) SetSecuritygroupname(v string) {
	if p.p == nil {
		p.p = make(map[string]interface{})
	}
	p.p["securitygroupname"] = v
	return
}

func (p *AuthorizeSecurityGroupIngressParams) SetStartport(v int) {
	if p.p == nil {
		p.p = make(map[string]interface{})
	}
	p.p["startport"] = v
	return
}

func (p *AuthorizeSecurityGroupIngressParams) SetUsersecuritygrouplist(v map[string]string) {
	if p.p == nil {
		p.p = make(map[string]interface{})
	}
	p.p["usersecuritygrouplist"] = v
	return
}

// You should always use this function to get a new AuthorizeSecurityGroupIngressParams instance,
// as then you are sure you have configured all required params
func (s *SecurityGroupService) NewAuthorizeSecurityGroupIngressParams() *AuthorizeSecurityGroupIngressParams {
	p := &AuthorizeSecurityGroupIngressParams{}
	p.p = make(map[string]interface{})
	return p
}

// Authorizes a particular ingress rule for this security group
func (s *SecurityGroupService) AuthorizeSecurityGroupIngress(p *AuthorizeSecurityGroupIngressParams) (*AuthorizeSecurityGroupIngressResponse, error) {
	resp, err := s.cs.newRequest("authorizeSecurityGroupIngress", p.toURLValues())
	if err != nil {
		return nil, err
	}

	var r AuthorizeSecurityGroupIngressResponse
	if err := json.Unmarshal(resp, &r); err != nil {
		return nil, err
	}

	// If we have a async client, we need to wait for the async result
	if s.cs.async {
		b, warn, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout)
		if err != nil {
			return nil, err
		}
		// If 'warn' has a value it means the job is running longer than the configured
		// timeout, the resonse will contain the jobid of the running async job
		if warn != nil {
			return &r, warn
		}

		b, err = getRawValue(b)
		if err != nil {
			return nil, err
		}

		if err := json.Unmarshal(b, &r); err != nil {
			return nil, err
		}
	}
	return &r, nil
}

type AuthorizeSecurityGroupIngressResponse struct {
	JobID             string `json:"jobid,omitempty"`
	Account           string `json:"account,omitempty"`
	Cidr              string `json:"cidr,omitempty"`
	Endport           int    `json:"endport,omitempty"`
	Icmpcode          int    `json:"icmpcode,omitempty"`
	Icmptype          int    `json:"icmptype,omitempty"`
	Protocol          string `json:"protocol,omitempty"`
	Ruleid            string `json:"ruleid,omitempty"`
	Securitygroupname string `json:"securitygroupname,omitempty"`
	Startport         int    `json:"startport,omitempty"`
	Tags              []struct {
		Account      string `json:"account,omitempty"`
		Customer     string `json:"customer,omitempty"`
		Domain       string `json:"domain,omitempty"`
		Domainid     string `json:"domainid,omitempty"`
		Key          string `json:"key,omitempty"`
		Project      string `json:"project,omitempty"`
		Projectid    string `json:"projectid,omitempty"`
		Resourceid   string `json:"resourceid,omitempty"`
		Resourcetype string `json:"resourcetype,omitempty"`
		Value        string `json:"value,omitempty"`
	} `json:"tags,omitempty"`
}

type RevokeSecurityGroupIngressParams struct {
	p map[string]interface{}
}

func (p *RevokeSecurityGroupIngressParams) toURLValues() url.Values {
	u := url.Values{}
	if p.p == nil {
		return u
	}
	if v, found := p.p["id"]; found {
		u.Set("id", v.(string))
	}
	return u
}

func (p *RevokeSecurityGroupIngressParams) SetId(v string) {
	if p.p == nil {
		p.p = make(map[string]interface{})
	}
	p.p["id"] = v
	return
}

// You should always use this function to get a new RevokeSecurityGroupIngressParams instance,
// as then you are sure you have configured all required params
func (s *SecurityGroupService) NewRevokeSecurityGroupIngressParams(id string) *RevokeSecurityGroupIngressParams {
	p := &RevokeSecurityGroupIngressParams{}
	p.p = make(map[string]interface{})
	p.p["id"] = id
	return p
}

// Deletes a particular ingress rule from this security group
func (s *SecurityGroupService) RevokeSecurityGroupIngress(p *RevokeSecurityGroupIngressParams) (*RevokeSecurityGroupIngressResponse, error) {
	resp, err := s.cs.newRequest("revokeSecurityGroupIngress", p.toURLValues())
	if err != nil {
		return nil, err
	}

	var r RevokeSecurityGroupIngressResponse
	if err := json.Unmarshal(resp, &r); err != nil {
		return nil, err
	}

	// If we have a async client, we need to wait for the async result
	if s.cs.async {
		b, warn, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout)
		if err != nil {
			return nil, err
		}
		// If 'warn' has a value it means the job is running longer than the configured
		// timeout, the resonse will contain the jobid of the running async job
		if warn != nil {
			return &r, warn
		}

		if err := json.Unmarshal(b, &r); err != nil {
			return nil, err
		}
	}
	return &r, nil
}

type RevokeSecurityGroupIngressResponse struct {
	JobID       string `json:"jobid,omitempty"`
	Displaytext string `json:"displaytext,omitempty"`
	Success     bool   `json:"success,omitempty"`
}

type AuthorizeSecurityGroupEgressParams struct {
	p map[string]interface{}
}

func (p *AuthorizeSecurityGroupEgressParams) toURLValues() url.Values {
	u := url.Values{}
	if p.p == nil {
		return u
	}
	if v, found := p.p["account"]; found {
		u.Set("account", v.(string))
	}
	if v, found := p.p["cidrlist"]; found {
		vv := strings.Join(v.([]string), ", ")
		u.Set("cidrlist", vv)
	}
	if v, found := p.p["domainid"]; found {
		u.Set("domainid", v.(string))
	}
	if v, found := p.p["endport"]; found {
		vv := strconv.Itoa(v.(int))
		u.Set("endport", vv)
	}
	if v, found := p.p["icmpcode"]; found {
		vv := strconv.Itoa(v.(int))
		u.Set("icmpcode", vv)
	}
	if v, found := p.p["icmptype"]; found {
		vv := strconv.Itoa(v.(int))
		u.Set("icmptype", vv)
	}
	if v, found := p.p["projectid"]; found {
		u.Set("projectid", v.(string))
	}
	if v, found := p.p["protocol"]; found {
		u.Set("protocol", v.(string))
	}
	if v, found := p.p["securitygroupid"]; found {
		u.Set("securitygroupid", v.(string))
	}
	if v, found := p.p["securitygroupname"]; found {
		u.Set("securitygroupname", v.(string))
	}
	if v, found := p.p["startport"]; found {
		vv := strconv.Itoa(v.(int))
		u.Set("startport", vv)
	}
	if v, found := p.p["usersecuritygrouplist"]; found {
		i := 0
		for k, vv := range v.(map[string]string) {
			u.Set(fmt.Sprintf("usersecuritygrouplist[%d].key", i), k)
			u.Set(fmt.Sprintf("usersecuritygrouplist[%d].value", i), vv)
			i++
		}
	}
	return u
}

func (p *AuthorizeSecurityGroupEgressParams) SetAccount(v string) {
	if p.p == nil {
		p.p = make(map[string]interface{})
	}
	p.p["account"] = v
	return
}

func (p *AuthorizeSecurityGroupEgressParams) SetCidrlist(v []string) {
	if p.p == nil {
		p.p = make(map[string]interface{})
	}
	p.p["cidrlist"] = v
	return
}

func (p *AuthorizeSecurityGroupEgressParams) SetDomainid(v string) {
	if p.p == nil {
		p.p = make(map[string]interface{})
	}
	p.p["domainid"] = v
	return
}

func (p *AuthorizeSecurityGroupEgressParams) SetEndport(v int) {
	if p.p == nil {
		p.p = make(map[string]interface{})
	}
	p.p["endport"] = v
	return
}

func (p *AuthorizeSecurityGroupEgressParams) SetIcmpcode(v int) {
	if p.p == nil {
		p.p = make(map[string]interface{})
	}
	p.p["icmpcode"] = v
	return
}

func (p *AuthorizeSecurityGroupEgressParams) SetIcmptype(v int) {
	if p.p == nil {
		p.p = make(map[string]interface{})
	}
	p.p["icmptype"] = v
	return
}

func (p *AuthorizeSecurityGroupEgressParams) SetProjectid(v string) {
	if p.p == nil {
		p.p = make(map[string]interface{})
	}
	p.p["projectid"] = v
	return
}

func (p *AuthorizeSecurityGroupEgressParams) SetProtocol(v string) {
	if p.p == nil {
		p.p = make(map[string]interface{})
	}
	p.p["protocol"] = v
	return
}

func (p *AuthorizeSecurityGroupEgressParams) SetSecuritygroupid(v string) {
	if p.p == nil {
		p.p = make(map[string]interface{})
	}
	p.p["securitygroupid"] = v
	return
}

func (p *AuthorizeSecurityGroupEgressParams) SetSecuritygroupname(v string) {
	if p.p == nil {
		p.p = make(map[string]interface{})
	}
	p.p["securitygroupname"] = v
	return
}

func (p *AuthorizeSecurityGroupEgressParams) SetStartport(v int) {
	if p.p == nil {
		p.p = make(map[string]interface{})
	}
	p.p["startport"] = v
	return
}

func (p *AuthorizeSecurityGroupEgressParams) SetUsersecuritygrouplist(v map[string]string) {
	if p.p == nil {
		p.p = make(map[string]interface{})
	}
	p.p["usersecuritygrouplist"] = v
	return
}

// You should always use this function to get a new AuthorizeSecurityGroupEgressParams instance,
// as then you are sure you have configured all required params
func (s *SecurityGroupService) NewAuthorizeSecurityGroupEgressParams() *AuthorizeSecurityGroupEgressParams {
	p := &AuthorizeSecurityGroupEgressParams{}
	p.p = make(map[string]interface{})
	return p
}

// Authorizes a particular egress rule for this security group
func (s *SecurityGroupService) AuthorizeSecurityGroupEgress(p *AuthorizeSecurityGroupEgressParams) (*AuthorizeSecurityGroupEgressResponse, error) {
	resp, err := s.cs.newRequest("authorizeSecurityGroupEgress", p.toURLValues())
	if err != nil {
		return nil, err
	}

	var r AuthorizeSecurityGroupEgressResponse
	if err := json.Unmarshal(resp, &r); err != nil {
		return nil, err
	}

	// If we have a async client, we need to wait for the async result
	if s.cs.async {
		b, warn, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout)
		if err != nil {
			return nil, err
		}
		// If 'warn' has a value it means the job is running longer than the configured
		// timeout, the resonse will contain the jobid of the running async job
		if warn != nil {
			return &r, warn
		}

		b, err = getRawValue(b)
		if err != nil {
			return nil, err
		}

		if err := json.Unmarshal(b, &r); err != nil {
			return nil, err
		}
	}
	return &r, nil
}

type AuthorizeSecurityGroupEgressResponse struct {
	JobID             string `json:"jobid,omitempty"`
	Account           string `json:"account,omitempty"`
	Cidr              string `json:"cidr,omitempty"`
	Endport           int    `json:"endport,omitempty"`
	Icmpcode          int    `json:"icmpcode,omitempty"`
	Icmptype          int    `json:"icmptype,omitempty"`
	Protocol          string `json:"protocol,omitempty"`
	Ruleid            string `json:"ruleid,omitempty"`
	Securitygroupname string `json:"securitygroupname,omitempty"`
	Startport         int    `json:"startport,omitempty"`
	Tags              []struct {
		Account      string `json:"account,omitempty"`
		Customer     string `json:"customer,omitempty"`
		Domain       string `json:"domain,omitempty"`
		Domainid     string `json:"domainid,omitempty"`
		Key          string `json:"key,omitempty"`
		Project      string `json:"project,omitempty"`
		Projectid    string `json:"projectid,omitempty"`
		Resourceid   string `json:"resourceid,omitempty"`
		Resourcetype string `json:"resourcetype,omitempty"`
		Value        string `json:"value,omitempty"`
	} `json:"tags,omitempty"`
}

type RevokeSecurityGroupEgressParams struct {
	p map[string]interface{}
}

func (p *RevokeSecurityGroupEgressParams) toURLValues() url.Values {
	u := url.Values{}
	if p.p == nil {
		return u
	}
	if v, found := p.p["id"]; found {
		u.Set("id", v.(string))
	}
	return u
}

func (p *RevokeSecurityGroupEgressParams) SetId(v string) {
	if p.p == nil {
		p.p = make(map[string]interface{})
	}
	p.p["id"] = v
	return
}

// You should always use this function to get a new RevokeSecurityGroupEgressParams instance,
// as then you are sure you have configured all required params
func (s *SecurityGroupService) NewRevokeSecurityGroupEgressParams(id string) *RevokeSecurityGroupEgressParams {
	p := &RevokeSecurityGroupEgressParams{}
	p.p = make(map[string]interface{})
	p.p["id"] = id
	return p
}

// Deletes a particular egress rule from this security group
func (s *SecurityGroupService) RevokeSecurityGroupEgress(p *RevokeSecurityGroupEgressParams) (*RevokeSecurityGroupEgressResponse, error) {
	resp, err := s.cs.newRequest("revokeSecurityGroupEgress", p.toURLValues())
	if err != nil {
		return nil, err
	}

	var r RevokeSecurityGroupEgressResponse
	if err := json.Unmarshal(resp, &r); err != nil {
		return nil, err
	}

	// If we have a async client, we need to wait for the async result
	if s.cs.async {
		b, warn, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout)
		if err != nil {
			return nil, err
		}
		// If 'warn' has a value it means the job is running longer than the configured
		// timeout, the resonse will contain the jobid of the running async job
		if warn != nil {
			return &r, warn
		}

		if err := json.Unmarshal(b, &r); err != nil {
			return nil, err
		}
	}
	return &r, nil
}

type RevokeSecurityGroupEgressResponse struct {
	JobID       string `json:"jobid,omitempty"`
	Displaytext string `json:"displaytext,omitempty"`
	Success     bool   `json:"success,omitempty"`
}

type ListSecurityGroupsParams struct {
	p map[string]interface{}
}

func (p *ListSecurityGroupsParams) toURLValues() url.Values {
	u := url.Values{}
	if p.p == nil {
		return u
	}
	if v, found := p.p["account"]; found {
		u.Set("account", v.(string))
	}
	if v, found := p.p["domainid"]; found {
		u.Set("domainid", v.(string))
	}
	if v, found := p.p["id"]; found {
		u.Set("id", v.(string))
	}
	if v, found := p.p["isrecursive"]; found {
		vv := strconv.FormatBool(v.(bool))
		u.Set("isrecursive", vv)
	}
	if v, found := p.p["keyword"]; found {
		u.Set("keyword", v.(string))
	}
	if v, found := p.p["listall"]; found {
		vv := strconv.FormatBool(v.(bool))
		u.Set("listall", vv)
	}
	if v, found := p.p["page"]; found {
		vv := strconv.Itoa(v.(int))
		u.Set("page", vv)
	}
	if v, found := p.p["pagesize"]; found {
		vv := strconv.Itoa(v.(int))
		u.Set("pagesize", vv)
	}
	if v, found := p.p["projectid"]; found {
		u.Set("projectid", v.(string))
	}
	if v, found := p.p["securitygroupname"]; found {
		u.Set("securitygroupname", v.(string))
	}
	if v, found := p.p["tags"]; found {
		i := 0
		for k, vv := range v.(map[string]string) {
			u.Set(fmt.Sprintf("tags[%d].key", i), k)
			u.Set(fmt.Sprintf("tags[%d].value", i), vv)
			i++
		}
	}
	if v, found := p.p["virtualmachineid"]; found {
		u.Set("virtualmachineid", v.(string))
	}
	return u
}

func (p *ListSecurityGroupsParams) SetAccount(v string) {
	if p.p == nil {
		p.p = make(map[string]interface{})
	}
	p.p["account"] = v
	return
}

func (p *ListSecurityGroupsParams) SetDomainid(v string) {
	if p.p == nil {
		p.p = make(map[string]interface{})
	}
	p.p["domainid"] = v
	return
}

func (p *ListSecurityGroupsParams) SetId(v string) {
	if p.p == nil {
		p.p = make(map[string]interface{})
	}
	p.p["id"] = v
	return
}

func (p *ListSecurityGroupsParams) SetIsrecursive(v bool) {
	if p.p == nil {
		p.p = make(map[string]interface{})
	}
	p.p["isrecursive"] = v
	return
}

func (p *ListSecurityGroupsParams) SetKeyword(v string) {
	if p.p == nil {
		p.p = make(map[string]interface{})
	}
	p.p["keyword"] = v
	return
}

func (p *ListSecurityGroupsParams) SetListall(v bool) {
	if p.p == nil {
		p.p = make(map[string]interface{})
	}
	p.p["listall"] = v
	return
}

func (p *ListSecurityGroupsParams) SetPage(v int) {
	if p.p == nil {
		p.p = make(map[string]interface{})
	}
	p.p["page"] = v
	return
}

func (p *ListSecurityGroupsParams) SetPagesize(v int) {
	if p.p == nil {
		p.p = make(map[string]interface{})
	}
	p.p["pagesize"] = v
	return
}

func (p *ListSecurityGroupsParams) SetProjectid(v string) {
	if p.p == nil {
		p.p = make(map[string]interface{})
	}
	p.p["projectid"] = v
	return
}

func (p *ListSecurityGroupsParams) SetSecuritygroupname(v string) {
	if p.p == nil {
		p.p = make(map[string]interface{})
	}
	p.p["securitygroupname"] = v
	return
}

func (p *ListSecurityGroupsParams) SetTags(v map[string]string) {
	if p.p == nil {
		p.p = make(map[string]interface{})
	}
	p.p["tags"] = v
	return
}

func (p *ListSecurityGroupsParams) SetVirtualmachineid(v string) {
	if p.p == nil {
		p.p = make(map[string]interface{})
	}
	p.p["virtualmachineid"] = v
	return
}

// You should always use this function to get a new ListSecurityGroupsParams instance,
// as then you are sure you have configured all required params
func (s *SecurityGroupService) NewListSecurityGroupsParams() *ListSecurityGroupsParams {
	p := &ListSecurityGroupsParams{}
	p.p = make(map[string]interface{})
	return p
}

// This is a courtesy helper function, which in some cases may not work as expected!
func (s *SecurityGroupService) GetSecurityGroupID(keyword string) (string, error) {
	p := &ListSecurityGroupsParams{}
	p.p = make(map[string]interface{})

	p.p["keyword"] = keyword

	l, err := s.ListSecurityGroups(p)
	if err != nil {
		return "", err
	}

	if l.Count == 0 {
		return "", fmt.Errorf("No match found for %s: %+v", keyword, l)
	}

	if l.Count == 1 {
		return l.SecurityGroups[0].Id, nil
	}

	if l.Count > 1 {
		for _, v := range l.SecurityGroups {
			if v.Name == keyword {
				return v.Id, nil
			}
		}
	}
	return "", fmt.Errorf("Could not find an exact match for %s: %+v", keyword, l)
}

// This is a courtesy helper function, which in some cases may not work as expected!
func (s *SecurityGroupService) GetSecurityGroupByName(name string) (*SecurityGroup, int, error) {
	id, err := s.GetSecurityGroupID(name)
	if err != nil {
		return nil, -1, err
	}

	r, count, err := s.GetSecurityGroupByID(id)
	if err != nil {
		return nil, count, err
	}
	return r, count, nil
}

// This is a courtesy helper function, which in some cases may not work as expected!
func (s *SecurityGroupService) GetSecurityGroupByID(id string) (*SecurityGroup, int, error) {
	p := &ListSecurityGroupsParams{}
	p.p = make(map[string]interface{})

	p.p["id"] = id

	l, err := s.ListSecurityGroups(p)
	if err != nil {
		if strings.Contains(err.Error(), fmt.Sprintf(
			"Invalid parameter id value=%s due to incorrect long value format, "+
				"or entity does not exist", id)) {
			return nil, 0, fmt.Errorf("No match found for %s: %+v", id, l)
		}
		return nil, -1, err
	}

	if l.Count == 0 {
		// If no matches, search all projects
		p.p["projectid"] = "-1"

		l, err = s.ListSecurityGroups(p)
		if err != nil {
			if strings.Contains(err.Error(), fmt.Sprintf(
				"Invalid parameter id value=%s due to incorrect long value format, "+
					"or entity does not exist", id)) {
				return nil, 0, fmt.Errorf("No match found for %s: %+v", id, l)
			}
			return nil, -1, err
		}
	}

	if l.Count == 0 {
		return nil, l.Count, fmt.Errorf("No match found for %s: %+v", id, l)
	}

	if l.Count == 1 {
		return l.SecurityGroups[0], l.Count, nil
	}
	return nil, l.Count, fmt.Errorf("There is more then one result for SecurityGroup UUID: %s!", id)
}

// Lists security groups
func (s *SecurityGroupService) ListSecurityGroups(p *ListSecurityGroupsParams) (*ListSecurityGroupsResponse, error) {
	resp, err := s.cs.newRequest("listSecurityGroups", p.toURLValues())
	if err != nil {
		return nil, err
	}

	var r ListSecurityGroupsResponse
	if err := json.Unmarshal(resp, &r); err != nil {
		return nil, err
	}
	return &r, nil
}

type ListSecurityGroupsResponse struct {
	Count          int              `json:"count"`
	SecurityGroups []*SecurityGroup `json:"securitygroup"`
}

type SecurityGroup struct {
	Account     string `json:"account,omitempty"`
	Description string `json:"description,omitempty"`
	Domain      string `json:"domain,omitempty"`
	Domainid    string `json:"domainid,omitempty"`
	Egressrule  []struct {
		Account           string `json:"account,omitempty"`
		Cidr              string `json:"cidr,omitempty"`
		Endport           int    `json:"endport,omitempty"`
		Icmpcode          int    `json:"icmpcode,omitempty"`
		Icmptype          int    `json:"icmptype,omitempty"`
		Protocol          string `json:"protocol,omitempty"`
		Ruleid            string `json:"ruleid,omitempty"`
		Securitygroupname string `json:"securitygroupname,omitempty"`
		Startport         int    `json:"startport,omitempty"`
		Tags              []struct {
			Account      string `json:"account,omitempty"`
			Customer     string `json:"customer,omitempty"`
			Domain       string `json:"domain,omitempty"`
			Domainid     string `json:"domainid,omitempty"`
			Key          string `json:"key,omitempty"`
			Project      string `json:"project,omitempty"`
			Projectid    string `json:"projectid,omitempty"`
			Resourceid   string `json:"resourceid,omitempty"`
			Resourcetype string `json:"resourcetype,omitempty"`
			Value        string `json:"value,omitempty"`
		} `json:"tags,omitempty"`
	} `json:"egressrule,omitempty"`
	Id          string `json:"id,omitempty"`
	Ingressrule []struct {
		Account           string `json:"account,omitempty"`
		Cidr              string `json:"cidr,omitempty"`
		Endport           int    `json:"endport,omitempty"`
		Icmpcode          int    `json:"icmpcode,omitempty"`
		Icmptype          int    `json:"icmptype,omitempty"`
		Protocol          string `json:"protocol,omitempty"`
		Ruleid            string `json:"ruleid,omitempty"`
		Securitygroupname string `json:"securitygroupname,omitempty"`
		Startport         int    `json:"startport,omitempty"`
		Tags              []struct {
			Account      string `json:"account,omitempty"`
			Customer     string `json:"customer,omitempty"`
			Domain       string `json:"domain,omitempty"`
			Domainid     string `json:"domainid,omitempty"`
			Key          string `json:"key,omitempty"`
			Project      string `json:"project,omitempty"`
			Projectid    string `json:"projectid,omitempty"`
			Resourceid   string `json:"resourceid,omitempty"`
			Resourcetype string `json:"resourcetype,omitempty"`
			Value        string `json:"value,omitempty"`
		} `json:"tags,omitempty"`
	} `json:"ingressrule,omitempty"`
	Name      string `json:"name,omitempty"`
	Project   string `json:"project,omitempty"`
	Projectid string `json:"projectid,omitempty"`
	Tags      []struct {
		Account      string `json:"account,omitempty"`
		Customer     string `json:"customer,omitempty"`
		Domain       string `json:"domain,omitempty"`
		Domainid     string `json:"domainid,omitempty"`
		Key          string `json:"key,omitempty"`
		Project      string `json:"project,omitempty"`
		Projectid    string `json:"projectid,omitempty"`
		Resourceid   string `json:"resourceid,omitempty"`
		Resourcetype string `json:"resourcetype,omitempty"`
		Value        string `json:"value,omitempty"`
	} `json:"tags,omitempty"`
}


text:
layout: faqs
faqs_id: custom software development 6
name: custom software development 6
slug: custom-software-development-for-healthcare
question: What is custom software development for healthcare?
answer: Building a custom healthcare app is all about understanding the needs of
  end-users. In terms of the healthcare sector, these users are often patients
  with chronic diseases. You have to deeply research their needs and come up
  with the solution that they truly need. No brainstorming will be enough if you
  simply don't ask your users-to-be what software they need to manage their
  disease. We wrote more about [custom software development in
  healthcare](/blog/how-to-develop-a-healthcare-app-startup-owner-perspective/)
  on our blog.
published: true
---


text:
package com.netflix.genie.core.util;

import com.netflix.genie.test.categories.UnitTest;
import org.junit.Assert;
import org.junit.Test;
import org.junit.experimental.categories.Category;

/**
 * Tests for the metrics constants class.
 *
 * @author tgianos
 * @since 3.0.0
 */
@Category(UnitTest.class)
public class MetricsConstantsUnitTests {

    /**
     * Dummy test.
     */
    @Test
    public void canConstruct() {
        Assert.assertNotNull(new MetricsConstants());
    }
}


text:
@interface TestFile : TestFixtureBase
- (bool) simpleUpload:(NSInteger)mb
            cloudPath:(NSString *)cloudPath
        cloudFilename:(NSString *)cloudFilename
             uploadId:(NSString **)uploadId;
@end

@implementation TestFile

- (void)setUp { [super setUp]; }

- (void)tearDown { [super tearDown]; }

long createFile(const char * in_path, int64_t in_size)
{
    FILE* fp = NULL;
    fp = fopen(in_path, "w");
    if (fp == NULL)
    {
        return -1;
    }
    for (int i = 0; i < in_size; ++i)
    {
        fputc('!', fp);
    }
    fseek(fp, 0, SEEK_END);
    long fileLen = ftell(fp);
    fclose(fp);
    fp = NULL;
    return fileLen;
}

- (bool) simpleUpload:(NSInteger)mb
            cloudPath:(NSString *)cloudPath
        cloudFilename:(NSString *)cloudFilename
             uploadId:(NSString **)uploadId
{
    *uploadId = nil;

    const char * localPath = [cloudFilename UTF8String];
    createFile(localPath, mb*1024LL*1024LL);

    [[m_client fileService] uploadFile:cloudPath
                         cloudFilename:cloudFilename
                             shareable:true
                       replaceIfExists:true
                             localPath:cloudFilename
                       completionBlock:successBlock
                  errorCompletionBlock:failureBlock
                              cbObject:nil];

    [self waitForResult];

    *uploadId = [[[TestFixtureBase getDataFromResponse:self.jsonResponse] valueForKey:@"fileDetails"] valueForKey:@"uploadId"];

    [m_client registerFileUploadCallback:fileUploadCompletedBlock failedBlock:fileUploadFailedBlock];
    while ([_fileUploadCompletedReceived count] == 0 && [_fileUploadFailedReceived count] == 0)
    {
        int64_t transferred = [[m_client fileService] getUploadBytesTransferred:*uploadId];
        int64_t total = [[m_client fileService] getUploadTotalBytesToTransfer:*uploadId];
        double progress = [[m_client fileService] getUploadProgress:*uploadId];
        NSLog(@"%lld transfered %lld total %f progress\n", transferred, total, progress);

        [NSThread sleepForTimeInterval:0.3f];
        [m_client runCallBacks];
    }
    [m_client deregisterFileUploadCallback];

    return true;
}

- (void)testUploadSimpleFile
{
    NSString * uploadId = nil;
    if (![self simpleUpload:2 cloudPath:@"" cloudFilename:@"uploadsimplefile.txt" uploadId:&uploadId])
    {
        return;
    }

    if ([_fileUploadCompletedReceived count] != 1)
    {
        _XCTPrimitiveFail(self, @"Uploads completed not 1");
    }
    if ([_fileUploadFailedReceived count] != 0)
    {
        _XCTPrimitiveFail(self, @"Uploads failed not 0");
    }
}

- (void)testUploadSimpleFileAndCancel
{
    NSString * cloudFilename = @"uploadsimplefile.txt";
    const char * localPath = [cloudFilename UTF8String];
    createFile(localPath, 8*1024*1024);

    [[m_client fileService] uploadFile:@"a/b"
                         cloudFilename:cloudFilename
                             shareable:true
                       replaceIfExists:true
                             localPath:cloudFilename
                       completionBlock:successBlock
                  errorCompletionBlock:failureBlock
                              cbObject:nil];
    [self waitForResult];

    NSString * uploadId = [[[TestFixtureBase getDataFromResponse:self.jsonResponse] valueForKey:@"fileDetails"] valueForKey:@"uploadId"];

    [m_client registerFileUploadCallback:fileUploadCompletedBlock failedBlock:fileUploadFailedBlock];
    bool transferHasStarted = false;
    while(!transferHasStarted)
    {
        int64_t transferred = [[m_client fileService] getUploadBytesTransferred:uploadId];
        int64_t total = [[m_client fileService] getUploadTotalBytesToTransfer:uploadId];
        double progress = [[m_client fileService] getUploadProgress:uploadId];
        NSLog(@"%lld transfered %lld total %f progress\n", transferred, total, progress);

        if (transferred > 0)
        {
            transferHasStarted = true;
        }
        else
        {
            [NSThread sleepForTimeInterval:0.3f];
            [m_client runCallBacks];
        }
    }

    NSLog(@"Cancelling upload...");

    [[m_client fileService] cancelUpload:uploadId];
    while ([_fileUploadCompletedReceived count] == 0 && [_fileUploadFailedReceived count] == 0)
    {
        [NSThread sleepForTimeInterval:0.3f];
        [m_client runCallBacks];
    }
    [m_client deregisterFileUploadCallback];

    if ([_fileUploadCompletedReceived count] != 0)
    {
        _XCTPrimitiveFail(self, @"Uploads completed not 0");
    }
    if ([_fileUploadFailedReceived count] != 1)
    {
        _XCTPrimitiveFail(self, @"Uploads failed not 1");
    }

    if ([(FileUploadFailedDetails*)[_fileUploadFailedReceived objectAtIndex:0] status] != HTTP_CUSTOM)
    {
        _XCTPrimitiveFail(self, @"Wrong http status");
    }
    if ([(FileUploadFailedDetails*)[_fileUploadFailedReceived objectAtIndex:0] reasonCode] != CLIENT_UPLOAD_FILE_CANCELLED)
    {
        _XCTPrimitiveFail(self, @"Wrong reason code");
    }
}

- (void)testListUserFiles
{
    [[m_client fileService] listUserFiles:successBlock
                     errorCompletionBlock:failureBlock
                                 cbObject:nil];
    [self waitForResult];
}

- (void)testUploadMultipleFiles
{
    NSString * cloudFilename = @"uploadsimplefile.txt";
    const char * localPath = [cloudFilename UTF8String];
    createFile(localPath, 2*1024*1024);

    int numTransfers = 3;
    NSMutableArray * uploadIds = [[NSMutableArray alloc] init];
    for (int i = 0; i < numTransfers; ++i)
    {
        [[m_client fileService] uploadFile:@""
                             cloudFilename:[NSString stringWithFormat:@"%@_%d", cloudFilename, i]
                                 shareable:true
                           replaceIfExists:true
                                 localPath:cloudFilename
                           completionBlock:successBlock
                      errorCompletionBlock:failureBlock
                                  cbObject:nil];
        [self waitForResult];
        NSString * uploadId = [[[TestFixtureBase getDataFromResponse:self.jsonResponse] valueForKey:@"fileDetails"] valueForKey:@"uploadId"];
        if (uploadId == nil)
        {
            _XCTPrimitiveFail(self, @"Upload id not present in return JSON!");
            return;
        }
        [uploadIds addObject:uploadId];
    }

    [m_client registerFileUploadCallback:fileUploadCompletedBlock failedBlock:fileUploadFailedBlock];
    while ([_fileUploadCompletedReceived count] + [_fileUploadFailedReceived count] < numTransfers)
    {
        for (int i = 0; i < numTransfers; ++i)
        {
            int64_t transferred = [[m_client fileService] getUploadBytesTransferred:[uploadIds objectAtIndex:i]];
            int64_t total = [[m_client fileService] getUploadTotalBytesToTransfer:[uploadIds objectAtIndex:i]];
            double progress = [[m_client fileService] getUploadProgress:[uploadIds objectAtIndex:i]];
            if (transferred >= 0)
            {
                NSLog(@"File%d %lld transfered %lld total %f progress\n", i, transferred, total, progress);
            }
        }
        [NSThread sleepForTimeInterval:0.3f];
        [m_client runCallBacks];
    }
    [m_client deregisterFileUploadCallback];

    if ([_fileUploadCompletedReceived count] != numTransfers)
    {
        _XCTPrimitiveFail(self, @"Not all uploads succeeded");
    }
    if ([_fileUploadFailedReceived count] != 0)
    {
        _XCTPrimitiveFail(self, @"Uploads failed not 0");
    }
}

- (void)testDeleteFile
{
    NSString * filename = @"uploadsimplefile.txt";
    NSString * uploadId = nil;
    if (![self simpleUpload:2 cloudPath:@"" cloudFilename:filename uploadId:&uploadId])
    {
        return;
    }

    if ([_fileUploadCompletedReceived count] != 1)
    {
        _XCTPrimitiveFail(self, @"Uploads completed not 1");
        return;
    }
    if ([_fileUploadFailedReceived count] != 0)
    {
        _XCTPrimitiveFail(self, @"Uploads failed not 0");
        return;
    }

    [[m_client fileService] deleteUserFile:@""
                             cloudFilename:filename
                           completionBlock:successBlock
                      errorCompletionBlock:failureBlock
                                  cbObject:nil];
    [self waitForResult];
}

- (void)testGetCDNUrl
{
    NSString * filename = @"uploadsimplefile.txt";
    NSString * uploadId = nil;
    if (![self simpleUpload:2 cloudPath:@"" cloudFilename:filename uploadId:&uploadId])
    {
        return;
    }

    if ([_fileUploadCompletedReceived count] != 1)
    {
        _XCTPrimitiveFail(self, @"Uploads completed not 1");
        return;
    }
    if ([_fileUploadFailedReceived count] != 0)
    {
        _XCTPrimitiveFail(self, @"Uploads failed not 0");
        return;
    }

    [[m_client fileService] getCDNUrl:@""
                             cloudFileName:filename
                           completionBlock:successBlock
                      errorCompletionBlock:failureBlock
                                  cbObject:nil];
    [self waitForResult];

    [[m_client fileService] deleteUserFile:@""
                             cloudFilename:filename
                           completionBlock:successBlock
                      errorCompletionBlock:failureBlock
                                  cbObject:nil];
    [self waitForResult];
}

@end


text:
package org.mn.dropzone.crypto;

/**
 * Signals a problem with the file.
 */
public class BadFileException extends CryptoException {

    private static final long serialVersionUID = 6541184110536021381L;

    public BadFileException() {

    }

    public BadFileException(String message) {
        super(message);
    }

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

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

}


text:
A Simple Download Manager library

# Target

- Easy to setup:
  - Save directory
  - Cache directory (optional, use default Cache dir if not set)
  - ...
- Multithreading (OkHttp)
- Multipart downloading
- Auto Content-type recognition

# LICENSE

Copyright 2015 eneim

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.


text:
"""
Caching and Loading the Coherence Dataset
"""
# Author: Valerio Maggio <valeriomaggio@gmail.com>
# Copyright (c) 2015 Valerio Maggio <valeriomaggio@gmail.com>
# License: BSD 3 clause

from os.path import join, abspath, curdir, exists
from operator import or_
from functools import reduce
from itertools import chain

from sklearn.pipeline import Pipeline
from sklearn.feature_extraction.text import CountVectorizer, TfidfTransformer
from sklearn.datasets.base import Bunch
from scipy.sparse import csr_matrix
import numpy as np

try:
    from coherence_dataset.settings import COHERENT, NOT_COHERENT
    from coherence_dataset.models import Example
    from source_code_analysis.models import SoftwareProject
    from django.db.models import Q
except ImportError:
    pass

import codecs
import pickle
from sklearn.externals import joblib

TARGET_PROJECTS = (
    ('CoffeeMaker', '1.0'),
    ('Jfreechart', '0.6.0'),
    ('Jfreechart', '0.7.1'),
    ('JHotDraw', '7.4.1'),
)

TARGET_FOLDER = join(abspath(curdir), 'data', 'dataset')
TARGET_METADATA_FILENAME = 'coherence_meta.pkz'
TARGET_DATA_FILENAME = 'coherence_data.pkz'
DATASET_DESCRIPTION_FILENAME = 'coherence.rst'

def fetch_coherence_dataset():
    """Fetch the Coherence dataset from the database
    (leveraging on Django ORM settings and connection) and
    returns data ready to be stored locally on cache files.
    Additional *metadata* about the dataset are collected, and
    returned as well.

    Returns
    -------
    data: numpy ndarray of shape (2881, 5642)
        The (dense) array structure containing all the representation of
        methods (i.e. code and comment) in the feature space (VSM).
        Methods are gathered from all the considered software projects and
        are stored in "(class, project)" order - positive ("COHERENT")
        examples first.

    targets: numpy ndarray of shape (2881, )
        The array of targets, stored according to the organization
        of documents/methods in the `data` matrix, namely
        "Coherent" method first, and then "Non Coherent" ones.

    metadata: Bunch  (`sklearn.datasets.base.Bunch`)
        Dictionary-like object containing dataset metadata.
        Stored information (key/value pairs) are:
        'N' : integer
            number of samples (methods)
        'D' : integer
            number of features
        'code' : list
            list of terms extracted from body of methods
        'comments' : list
            list of terms extracted from comments of methods
        'features' : list
            list of feature names (terms) / IR vocabulary
        'target_names' : tuple
            tuple containing the label associated to each class
        'examples_per_classes' : tuple
            tuple containing the numbers of examples in each class
        'projects' : dictionary
            dictionary containing information about the analysed
            software projects (i.e. name, version, offset indices in
            the data matrix, number of examples per target class).
    """
    # --------------------------------------
    # Gather `Example` instances from the Db
    # --------------------------------------
    per_project_filters = list()
    for name, version in TARGET_PROJECTS:
        try:
            project = SoftwareProject.objects.get(name__iexact=name, version__exact=version)
            per_project_filters.append(Q(method__project__id=project.id))
        except SoftwareProject.DoesNotExist:
            continue
    projects_filters = reduce(or_, per_project_filters)
    positive_exs = Example.objects.filter(target=COHERENT).filter(projects_filters)
    negative_exs = Example.objects.filter(target=NOT_COHERENT).filter(projects_filters)
    # Create the Document Collection
    # NOTE: (All) documents of *positive* examples first.
    doc_collection = list()
    for example in chain(positive_exs, negative_exs):
        doc_collection.append(example.method.lexical_info.normalized_comment)
        doc_collection.append(example.method.lexical_info.normalized_code)

    # (META) Textual Data
    comments = doc_collection[::2]  # odd elements correspond to comments
    code = doc_collection[1::2]  # even elements correspond to code

    # Set up the processing pipeline to `fit_transform` data
    pipeline = Pipeline([
        ('vect', CountVectorizer(input='content', lowercase=False)),
        ('tfidf', TfidfTransformer(sublinear_tf=True, norm='l2', use_idf=True)),
    ])
    all_data = pipeline.fit_transform(doc_collection)
    nrows, ncols = all_data.shape

    # Compacting data to (methods, (comment, code)) features
    data = all_data.toarray().reshape(nrows // 2, -1)

    # (META) Textual Feature representation
    # The list of indexed terms
    vectorizer = pipeline.named_steps['vect']
    features = vectorizer.get_feature_names()

    # (META) Count Examples per Classes
    positive_ex_count = positive_exs.count()
    negative_ex_count = negative_exs.count()

    # Create target array, according to examples distribution
    targets = np.hstack((np.ones(positive_ex_count),
                         np.zeros(negative_ex_count)))

    # -----------------------------------
    # Get and Save additional (Meta)data
    # -----------------------------------
    # Per-project information:
    #    - project name
    #    - project version
    #    - Offset of projects entries in dataset
    #    - Examples count (positive and negative)
    #    - "names" : list of keys (name-version) to access
    #                single project data
    projects_info = dict()
    projects_info.setdefault('names', list())

    pos_start = pos_end = 0
    neg_start = neg_end = positive_exs.count()
    for name, version in TARGET_PROJECTS:
        try:
            # 0. Set project key (i.e. `pkey`)
            pkey = '{0}-{1}'.format(name, version)
            projects_info['names'].append(pkey)
            # 1. get project examples
            project = SoftwareProject.objects.get(name__iexact=name, version__exact=version)
            project_examples = Example.objects.filter(method__project__id=project.id)
            # 2. count positive and negative ones,
            # and update the ending coordinates of offsets (positive, and negative)
            pos_count = project_examples.filter(target=COHERENT).count()
            neg_count = project_examples.filter(target=NOT_COHERENT).count()
            pos_end += pos_count
            neg_end += neg_count
            # 3. Store metadata for current project
            projects_info[pkey] = {'name': name, 'version': version,
                                   'positive_examples': (pos_start, pos_end),
                                   'negative_examples': (neg_start, neg_end),
                                   'positive_count': pos_count,
                                   'negative_count': neg_count}
            # 4. Update the starting coordinates for the next offsets count
            pos_start = pos_end
            neg_start = neg_end
        except SoftwareProject.DoesNotExist:
            continue

    # *. Dataset (meta)data descriptors
    #     - N, D --> no. of examples, and no. of features
    #     - Class names and no. of instances per classes
    #     - Project names and versions, along with corresponding offsets
    #     - Target (class) names.
    metadata = Bunch(code=code, comments=comments, features=features,
                     N=nrows, D=ncols, target_names=('COHERENT', 'NOT COHERENT'),
                     examples_per_classes=(positive_ex_count, negative_ex_count),
                     projects=projects_info)
    return data, targets, metadata

def load_coherence_dataset():
    """Load and returns the coherence dataset (classification)

    The Coherence dataset contains information about the
    coherence between the head comment and the implementation
    of a source code methods.

    =================   ==============
    Classes                          2
    Samples per class       (Pos) 1713
                            (Neg) 1168
    Samples total           (Tot) 2881
    Dimensionality                5642
    Unique Terms                  2821
    Features            real, positive
    =================   ==============

    Note:
    -----
    Since methods are gathered from different software projects, to ease data
    analysis (e.g. slicing, splitting or extracting data of a single software project),
    data are stored according to class and project, respectively.
    In particular, data are primarily grouped by classes (all positive instances, first), and then
    further organized per project.

    So far, these are the distribution of examples per software project:
    ======================   ===========================
        Project              Positive | Negative | Total
        CoffeeMaker (1.0)       27    |    20    |   47
        JFreeChart (0.6.0)     406    |    55    |   461
        JFreeChart (0.7.1)     520    |    68    |   588
        JHotDraw (7.4.1)       760    |  1025    |  1785
    ======================   ===========================

    Returns
    -------
    data: Bunch
        Dictionary-like object, the intersting attributes (keys) are:
        'data', the actual data to learn, 'target', 'the classification labels,
        'target_names', the meaning of the labels, 'feature_names', the
        meaning of features (i.e. the `n_features` terms extracted), and
        'DESCR', the full description of the dataset.
    """

    # Setup target (cache) path(s)
    cache_data_path = join(TARGET_FOLDER, TARGET_DATA_FILENAME)
    cache_metadata_path = join(TARGET_FOLDER, TARGET_METADATA_FILENAME)

    if not exists(cache_data_path):
        # get data from db and save files

        data, target, metadata = fetch_coherence_dataset()
        data_sparse = csr_matrix(data, shape=data.shape, dtype=np.float64)

        # Cache Dataset to disk, namely:
        # 1. Dump Data (numpy ndarray file)

        joblib.dump(data, cache_data_path, compress=6)

        # 2. Dump Metadata
        compressed_meta = codecs.encode(pickle.dumps(metadata), 'zlib_codec')

        with open(cache_metadata_path, 'wb') as cache_metadata_file:
            cache_metadata_file.write(compressed_meta)
    else:
        # load data from file
        data = joblib.load(cache_data_path)
        data_sparse = csr_matrix(data, shape=data.shape, dtype=np.float64)

        # load metadata from file
        with open(cache_metadata_path, 'rb') as f:
            compressed_content = f.read()
        uncompressed_content = codecs.decode(
            compressed_content, 'zlib_codec')
        cache_metadata = pickle.loads(uncompressed_content)
        # Store metadata in a Bunch object
        metadata = Bunch()
        metadata.update(cache_metadata)

    # return the Bunch object

    # load Dataset description
    with open(join(TARGET_FOLDER, DATASET_DESCRIPTION_FILENAME)) as rst_file:
        fdescr = rst_file.read()

    # Create target array, according to examples distribution
    positive_ex_count, negative_ex_count = metadata.examples_per_classes
    target = np.hstack((np.ones(positive_ex_count),
                         np.zeros(negative_ex_count)))

    return Bunch(data=data_sparse, target=target,
                 target_names=metadata.target_names,
                 N=metadata.N, D=metadata.D,
                 features=metadata.features, code=metadata.code,
                 comments=metadata.comments, DESCR=fdescr,
                 target_counts = (positive_ex_count, negative_ex_count),
                 projects=metadata.projects)


text:
<?xml version="1.0" encoding="utf-8"?>
<!-- File created by the Android Action Bar Style Generator

     Copyright (C) 2011 The Android Open Source Project
     Copyright (C) 2012 readyState Software Ltd

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<resources>

    <style name="Theme.Storycheck" parent="@android:style/Theme.Holo.Light.DarkActionBar">
        <item name="android:actionBarItemBackground">@drawable/selectable_background_storycheck</item>
        <item name="android:popupMenuStyle">@style/PopupMenu.Storycheck</item>
        <item name="android:dropDownListViewStyle">@style/DropDownListView.Storycheck</item>
        <item name="android:actionBarTabStyle">@style/ActionBarTabStyle.Storycheck</item>
        <item name="android:actionDropDownStyle">@style/DropDownNav.Storycheck</item>
        <item name="android:actionBarStyle">@style/ActionBar.Solid.Storycheck</item>
        <item name="android:actionModeBackground">@drawable/cab_background_top_storycheck</item>
        <item name="android:actionModeSplitBackground">@drawable/cab_background_bottom_storycheck</item>
        <item name="android:actionModeCloseButtonStyle">@style/ActionButton.CloseMode.Storycheck</item>
        <item name="android:textAppearance">@style/Theme.Storycheck.Text</item>

        <!-- Light.DarkActionBar specific -->
        <item name="android:actionBarWidgetTheme">@style/Theme.Storycheck.Widget</item>

    </style>

    <style name="ActionBar.Solid.Storycheck" parent="@android:style/Widget.Holo.Light.ActionBar.Solid.Inverse">
        <item name="android:background">@drawable/ab_solid_storycheck</item>
        <item name="android:backgroundStacked">@drawable/ab_stacked_solid_storycheck</item>
        <item name="android:backgroundSplit">@drawable/ab_bottom_solid_storycheck</item>
        <item name="android:progressBarStyle">@style/ProgressBar.Storycheck</item>
    </style>

    <style name="ActionBar.Transparent.Storycheck" parent="@android:style/Widget.Holo.ActionBar">
        <item name="android:background">@drawable/ab_transparent_storycheck</item>
        <item name="android:progressBarStyle">@style/ProgressBar.Storycheck</item>
    </style>

    <style name="PopupMenu.Storycheck" parent="@android:style/Widget.Holo.ListPopupWindow">
        <item name="android:popupBackground">@drawable/menu_dropdown_panel_storycheck</item>
    </style>

    <style name="DropDownListView.Storycheck" parent="@android:style/Widget.Holo.ListView.DropDown">
        <item name="android:listSelector">@drawable/selectable_background_storycheck</item>
    </style>

    <style name="ActionBarTabStyle.Storycheck" parent="@android:style/Widget.Holo.ActionBar.TabView">
        <item name="android:background">@drawable/tab_indicator_ab_storycheck</item>
    </style>

    <style name="DropDownNav.Storycheck" parent="@android:style/Widget.Holo.Spinner">
        <item name="android:background">@drawable/spinner_background_ab_storycheck</item>
        <item name="android:popupBackground">@drawable/menu_dropdown_panel_storycheck</item>
        <item name="android:dropDownSelector">@drawable/selectable_background_storycheck</item>
    </style>

    <style name="ProgressBar.Storycheck" parent="@android:style/Widget.Holo.ProgressBar.Horizontal">
        <item name="android:progressDrawable">@drawable/progress_horizontal_storycheck</item>
    </style>

    <style name="ActionButton.CloseMode.Storycheck" parent="@android:style/Widget.Holo.ActionButton.CloseMode">
        <item name="android:background">@drawable/btn_cab_done_storycheck</item>
    </style>

    <!-- this style is only referenced in a Light.DarkActionBar based theme -->
    <style name="Theme.Storycheck.Widget" parent="@android:style/Theme.Holo">
        <item name="android:popupMenuStyle">@style/PopupMenu.Storycheck</item>
        <item name="android:dropDownListViewStyle">@style/DropDownListView.Storycheck</item>
    </style>
    <style name="Theme.Storycheck.TextView">
        <item name="android:textColor">@color/note_no_text</item>
    </style>
    <style name="Theme.Storycheck.Text">
        <item name="android:textColor">@color/note_no_text</item>
    </style>

</resources>


text:
#ifndef __FORK_GL_SHADER_BASE_H__
#define __FORK_GL_SHADER_BASE_H__

#include "Video/RenderSystem/Shader/Shader.h"
#include "../GLImport.h"

namespace Fork
{

namespace Video
{

//! OpenGL shader base class.
class GLShaderBase
{

    public:

        virtual ~GLShaderBase();

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

    protected:

        friend class GLShaderComposition;

        GLShaderBase(const Shader::Types type);

        bool Compile(const std::vector<std::string>& shaderSource, std::string& infoLog);

        inline GLuint GetShaderID() const
        {
            return shaderID_;
        }

    private:

        void SetupShaderSource(const std::vector<std::string>& shaderSource);
        void Compile();
        bool QueryInfoLog(std::string& infoLog);

        GLuint shaderID_ = 0;

};

} // /namespace Video

} // /namespace Fork

#endif

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


text:
package org.datasays.util;

import jodd.props.Props;
import jodd.typeconverter.Convert;
import jodd.util.StringUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.File;
import java.io.IOException;
import java.util.Map;

public class WCfg {
	private static final Logger LOG = LoggerFactory.getLogger(WCfg.class);
	public static String PropsFile = ".\\project.props";
	private static Props cfg = null;

	public static Props getCfg() {
		if (cfg == null) {
			try {
				cfg = new Props();
				cfg.load(new File(PropsFile));
			} catch (IOException e) {
				LOG.error(e.getMessage(), e);
			}
		}
		return cfg;
	}

	public static String getValue(final String key, final String... profiles) {
		return getCfg().getValue(key, profiles);
	}

	public static String[] getValues(final String key, final String... profiles) {
		String value = getValue(key, profiles);
		return StringUtil.split(value, ";");
	}

	public static int getIntValue(final String key, final String... profiles) {
		return Integer.parseInt(getValue(key, profiles));
	}

	public static double getDoubleValue(final String key, final String... profiles) {
		return Convert.toDoubleValue(getValue(key, profiles));
	}

	public static boolean getBoolValue(final String key, final String... profiles) {
		return Convert.toBooleanValue(getValue(key, profiles));
	}

	public static Map<String, Object> getMap(String prefix) {
		return getCfg().innerMap(prefix);
	}

	public static String getPath(final String key, final String... profiles) {
		String path = getValue(key, profiles);
		path = path.trim();
		path = StringUtil.replace(path, "\\", File.separator);
		path = StringUtil.replace(path, "//", File.separator);
		if (!path.endsWith(File.separator)) {
			path += File.separator;
		}
		return getCfg().getValue(key, profiles);
	}

}


text:
package com.lxj.zhiwuvsani;

import org.cocos2d.layers.CCScene;
import org.cocos2d.nodes.CCDirector;
import org.cocos2d.opengl.CCGLSurfaceView;

import com.lxj.layer.WelComeLayer;

import android.os.Bundle;
import android.os.Process;
import android.app.Activity;
import android.view.KeyEvent;
import android.view.Menu;

public class MainActivity extends Activity {
	private CCDirector director;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		CCGLSurfaceView surfaceView = new CCGLSurfaceView(this);
		setContentView(surfaceView);
		director = CCDirector.sharedDirector();
		director.attachInView(surfaceView);//¿ªÏß³Ì
		director.setScreenSize(480, 320);
		director.setDeviceOrientation(CCDirector.kCCDeviceOrientationLandscapeLeft);//ºáÆÁ
		director.setDisplayFPS(true);//²»ÏÔʾ֡ÂÊ
		CCScene scene = CCScene.node();
		scene.addChild(new WelComeLayer());
		//µ¼ÑݹÜÀí³¡¾°
		director.runWithScene(scene);
	}

	@Override
	protected void onResume() {
		director.onResume();
		super.onResume();
	}

	@Override
	protected void onPause() {
		director.onPause();
		super.onPause();
	}

	@Override
	protected void onDestroy() {
		director.end();
		super.onDestroy();
	}

	@Override
	public boolean onKeyDown(int keyCode, KeyEvent event) {
		Process.killProcess(Process.myPid());
		return super.onKeyDown(keyCode, event);
	}
}


text:
(function($,$$) {

//set the events
window.store('hashchange:interval',300);
window.store('hashchange:ieframe-src','./blank.html');
window.store('hashchange:implemented',!!('onhashchange' in window));

Element.Events.hashchange = {
  onAdd:function(fn) {
          //clear the event
          Element.Events.hashchange.onAdd = Function.from;

          //check the element
          var self = $(this);
          var checker = Function.from;
          if(typeOf(self) != 'window') {
            return; //the window object only supports this
          }

          //this will prevent the browser from firing the url when the page loads (native onhashchange doesn't do this)
          window.store('hashchange:changed',false);

          //this global method gets called when the hash value changes for all browsers
          var hashchanged = function(hash,tostore) {
            window.store('hashchange:current',tostore || hash);
            if(window.retrieve('hashchange:changed')) {
              hash = hash.trim();
              if(hash.length==0) {
                var url = new String(window.location);
                if(url.indexOf('#')>=0)
                  hash = '#';
              }
              window.fireEvent('hashchange',[hash]);
            }
            else {
              window.store('hashchange:changed',true);
            }
          };

          //this is used for when a hash change method has already been defined (futureproof)
          if(typeof window.onhashchange == 'function' && fn !== window.onhashchange) {
            //bind the method to the mootools method stack
            window.addEvent('hashchange',window.onhashchange);

            //remove the event
            window.onhashchange = null;
          }

          //Oldschool IE browsers
          if(Browser.ie6 || Browser.ie7) {

            //IE6 and IE7 require an empty frame to relay the change (back and forward buttons)
            //custom IE method
            checker = function(url,frame) {

              //clear the timer
              var checker = window.retrieve('hashchange:checker');
              var timer = window.retrieve('hashchange:timer');
              clearTimeout(timer); //just incase
              timer = null;

              //IE may give a hash value, a path value or a url
              var isNull = frame && url.length == 0;
              var isEmpty = url == '#';
              var hash, compare, cleanurl = unescape(new String(window.location));

              if(isEmpty) {
                compare = hash = '#';
              }
              else if(isNull) {
                compare = hash = '';
              }
              else {

                //setup the url
                url = url != null ? url : cleanurl;
                hash = url;

                if(url.length>0) { //not an empty hash
                  var index = url.indexOf('#');
                  if(index>=0)
                    hash = url.substr(index);
                }

                //check the hash
                compare = hash.toLowerCase();
              }

              //if the hash value is different, then it has changed
              var current = window.retrieve('hashchange:current');
              if(current != compare) {

                //update the url
                if(frame) {
                  url = cleanurl;
                  if(current) {
                    url = url.replace(current,hash);
                  }
                  else {
                    url += hash;
                  }
                  window.location = url;
                }

                //check the flag
                var hasChanged = !frame && window.retrieve('hashchange:changed');

                //change the hash
                hashchanged(hash,compare);

                if(hasChanged) {
                  //this will prevent the frame from changing the first time
                  window.retrieve('hashchange:ieframe').setPath(hash);
                }
              }

              //reset the timer
              timer = checker.delay(window.retrieve('hashchange:interval'));
              window.store('hashchange:timer',timer);

            };

            //create the frame
            var src = window.retrieve('hashchange:ieframe-src');
            var ieframe = new Element('iframe', {
              'id':'hashchange-ie-frame',
                'src':src+'?start',
                'styles':{
                  'width':0,
                'height':0,
                'position':'absolute',
                'top':-9999,
                'left':-9999
                },
                'onload':function() {
                  //this shouldn't exist when a hash is changed, if it does then the frame has just loaded
                  var self = $('hashchange-ie-frame');
                  if(self.retrieve('loaded')) {
                    //examine the url
                    var url = unescape(new String(ieframe.contentWindow.location));
                    var index = url.indexOf('?');
                    if(index>=0) {
                      var path = '', empty = false;
                      if(url.indexOf('?empty')>=0) {
                        path = '#';
                      }
                      else {
                        index = url.indexOf('?!');
                        if(index>=0) {
                          path = url.substr(index+2);
                          path = '#' + path;
                        }
                      }

                      var current = window.retrieve('hashchange:current');
                      if(current != path) {
                        window.retrieve('hashchange:checker')(path,true);
                      }
                    }
                  }
                  else {
                    self.store('loaded',true);
                  }
                }.bind(window)
            });

            //save the frame
            window.store('hashchange:ieframe',ieframe);
            ieframe.inject(document.body,'inside');

            ieframe.setPath = function(path) {
              if(path.charAt(0)=='#') {
                path = path.substr(1);
                if(path.length==0) {
                  ieframe.contentWindow.location = src + '?empty';
                  return;
                }
              }
              ieframe.contentWindow.location = src + '?!' + escape(path);
            };
          }
          else if(window.retrieve('hashchange:implemented')) { //Firefox 3.6, Chrome 5, IE8 and Safari 5 all support the event natively

            //check the hashcheck
            checker = window.onhashchange = function(hash) {

              //make sure the hash is a string
              hash = hash && typeof hash == 'string' ? hash : new String(window.location.hash);

              //this is important so that the URL hash has changed BEFORE this is fired
              hashchanged.delay(1,window,[hash]);

            }
          }
          else { //Others
            //opera requires a history mode to be set so that #hash values are recorded in history (back and forward buttons)
            if(Browser.opera) {
              history.navigationMode='compatible';
            }

            //set the inteval method
            checker = function(hash) {

              //clear the timer
              var checker = window.retrieve('hashchange:checker');
              var timer = window.retrieve('hashchange:timer');
              clearTimeout(timer); //just incase
              timer = null;

              //compare the hash
              var hash = hash || new String(window.location.hash);
              var compare = hash.toLowerCase();
              if(hash.length==0 && new String(window.location).indexOf('#')>=0) {
                compare = '#';
              }
              var current = window.retrieve('hashchange:current');
              if(current != compare) {
                hashchanged(hash,compare);
              }

              //reset the timer
              timer = checker.delay(window.retrieve('hashchange:interval'));
              window.store('hashchange:timer',timer);

            }
          }

          //run the loop
          window.store('hashchange:checker',checker);
          checker();

          //setup a custom go event
          var sethash = function(hash) {
            if(hash.charAt(0)!='#')
              hash = '#' + hash;
            if(Browser.ie6 || Browser.ie7) { //ie6 and ie7
              var url = new String(window.location);
              var current = url.match(/#.*?$/);
              current = current && current[0] ? current[0] : '';
              if(current.length>0) {
                window.location = url.replace(current,hash);
              }
              else {
                window.location += hash;
              }
            }
            else { //other, more advanced browsers
              window.location.hash = hash;
            }

            //check the hash right away
            if(!window.retrieve('hashchange:implemented')) {
              window.retrieve('hashchange:checker')();
            }
          }

          //check ie browsers
          window.sethash = sethash;
        },

  onDelete:function() {
             if(typeOf(this) == 'window') {
               var timer = window.retrieve('hashchange:timer');
               if(timer) {
                 clearTimeout(timer); timer = null;
                 window.store('hashchange:timer',null);
               }
             }
           }
}

})(document.id,$$);