text:
package org.wso2.carbon.apimgt.impl.service;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
import org.wso2.carbon.apimgt.impl.utils.APIUtil;

@RunWith(PowerMockRunner.class)
@PrepareForTest(APIUtil.class)
public class TierCacheServiceTestCase {

    @Test
    public void testInvalidateCache() {
        PowerMockito.mockStatic(APIUtil.class);
        TierCacheService tierCacheService = new TierCacheService();
        tierCacheService.invalidateCache("foo.com");
        PowerMockito.verifyStatic(APIUtil.class);
        APIUtil.clearTiersCache("foo.com");
    }
}

redpajama_set_name: RedPajamaGithub


text:
package com.graphhopper.jsprit.core.problem.solution.route.activity;

import org.junit.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

public class EndTest {

    @Test
    public void whenCallingCapacity_itShouldReturnEmptyCapacity() {
        End end = End.newInstance("loc", 0., 0.);
        assertEquals(0, end.getSize().get(0));
    }

    @Test
    public void whenStartIsIniWithEarliestStart_itShouldBeSetCorrectly() {
        End end = End.newInstance("loc", 1., 2.);
        assertEquals(1., end.getTheoreticalEarliestOperationStartTime(), 0.01);
    }

    @Test
    public void whenStartIsIniWithLatestStart_itShouldBeSetCorrectly() {
        End end = End.newInstance("loc", 1., 2.);
        assertEquals(2., end.getTheoreticalLatestOperationStartTime(), 0.01);
    }

    @Test
    public void whenSettingEndTime_itShouldBeSetCorrectly() {
        End end = End.newInstance("loc", 1., 2.);
        end.setEndTime(4.0);
        assertEquals(4., end.getEndTime(), 0.01);
    }

    @Test
    public void whenSettingEarliestStart_itShouldBeSetCorrectly() {
        End end = End.newInstance("loc", 1., 2.);
        end.setTheoreticalEarliestOperationStartTime(5.);
        assertEquals(5., end.getTheoreticalEarliestOperationStartTime(), 0.01);
    }

    @Test
    public void whenSettingLatestStart_itShouldBeSetCorrectly() {
        End end = End.newInstance("loc", 1., 2.);
        end.setTheoreticalLatestOperationStartTime(5.);
        assertEquals(5., end.getTheoreticalLatestOperationStartTime(), 0.01);
    }

    @Test
    public void whenCopyingEnd_itShouldBeDoneCorrectly() {
        End end = End.newInstance("loc", 1., 2.);
        end.setTheoreticalEarliestOperationStartTime(3.);
        end.setTheoreticalLatestOperationStartTime(5.);

        End copy = End.copyOf(end);
        assertEquals(3., copy.getTheoreticalEarliestOperationStartTime(), 0.01);
        assertEquals(5., copy.getTheoreticalLatestOperationStartTime(), 0.01);
        assertEquals("loc", copy.getLocation().getId());
        assertTrue(copy != end);
    }

}


text:
/**
 *
 */
/**
 * @author Utilisateur
 *
 */
package co.projetweb.application.controller;


text:
//  Copyright (c) 2003-2019 Xsens Technologies B.V. or subsidiaries worldwide.
//  All rights reserved.
//
//  Redistribution and use in source and binary forms, with or without modification,
//  are permitted provided that the following conditions are met:
//
//  1.	Redistributions of source code must retain the above copyright notice,
//  	this list of conditions, and the following disclaimer.
//
//  2.	Redistributions in binary form must reproduce the above copyright notice,
//  	this list of conditions, and the following disclaimer in the documentation
//  	and/or other materials provided with the distribution.
//
//  3.	Neither the names of the copyright holders nor the names of their contributors
//  	may be used to endorse or promote products derived from this software without
//  	specific prior written permission.
//
//  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
//  EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
//  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
//  THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
//  SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
//  OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
//  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY OR
//  TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
//  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.THE LAWS OF THE NETHERLANDS
//  SHALL BE EXCLUSIVELY APPLICABLE AND ANY DISPUTES SHALL BE FINALLY SETTLED UNDER THE RULES
//  OF ARBITRATION OF THE INTERNATIONAL CHAMBER OF COMMERCE IN THE HAGUE BY ONE OR MORE
//  ARBITRATORS APPOINTED IN ACCORDANCE WITH SAID RULES.
//

#ifndef XSFILTERPROFILE_H
#define XSFILTERPROFILE_H

#include "xstypesconfig.h"
#include "xsstring.h"
#include "pstdint.h"
#include "xsfilterprofilekind.h"

#ifdef __cplusplus
extern "C" {
#else
#define XSFILTERPROFILE_INITIALIZER {0, 0, {0}, 0, 0, 0}
#endif

struct XsFilterProfile;
XSTYPES_DLL_API void XsFilterProfile_toString(struct XsFilterProfile const* thisPtr, XsString *out);
XSTYPES_DLL_API int XsFilterProfile_empty(struct XsFilterProfile const* thisPtr);
XSTYPES_DLL_API void XsFilterProfile_swap(struct XsFilterProfile* a, struct XsFilterProfile* b);
#ifdef __cplusplus
}
#endif

#define XS_MAX_FILTERPROFILES			254
#define XS_LEN_FILTERPROFILELABEL_TERM	(20+1)
#define XS_LEN_FILTERPROFILEKIND_TERM	(20+1)
#define XS_MAX_FILTERPROFILES_IN_MT		5

struct XsFilterProfile
{
#ifdef __cplusplus
	/*! \brief Construct a filter profile object
		\param type_ the profile type
		\param version_ the profile version
		\param kind_ the kind of profile
		\param label_ the profile name
		\param filterType_ the filter type this profile is for
		\param filterMajor_ the major version of the compatible filter
		\param filterMinor_ the minor version of the compatible filter
	*/
	explicit XsFilterProfile(uint8_t type_ = 0, uint8_t version_ = 0, const char* kind_ = nullptr, const char* label_ = nullptr, char filterType_ = 0, uint8_t filterMajor_ = 0, uint8_t filterMinor_ = 0)
		: m_type(type_)
		, m_version(version_)
		, m_filterType(filterType_)
		, m_filterMajor(filterMajor_)
		, m_filterMinor(filterMinor_)
	{
		setKind(kind_);
		setLabel(label_);
	}

	/*! \brief Copy constructor for a filter profile object
		\param other the filter profile object to construct a copy of
	*/
	XsFilterProfile(const XsFilterProfile& other)
		: m_type(other.m_type)
		, m_version(other.m_version)
		, m_filterType(other.m_filterType)
		, m_filterMajor(other.m_filterMajor)
		, m_filterMinor(other.m_filterMinor)
	{
		setKind(other.m_kind);
		setLabel(other.m_label);
	}

	/*! \brief Destroy the filter profile */
	~XsFilterProfile() {}

	/*! \brief \copybrief XsFilterProfile_empty
		\returns true if the filter profile is empty
		\sa XsFilterProfile_empty
	*/
	inline bool empty()
	{
		return (0 != XsFilterProfile_empty(this));
	}

	/*! \brief \copybrief XsFilterProfile_toString
		\returns a string representation of this filter profile
		\sa XsFilterProfile_toString
	*/
	inline XsString toString()
	{
		XsString out;
		XsFilterProfile_toString(this, &out);
		return out;
	}

	/*! \brief The filter profile type */
	inline uint8_t type() const { return m_type; }

	/*! \brief The filter profile version */
	inline uint8_t version() const { return m_version; }

	/*! \brief The filter profile name */
	inline const char* label() const { return m_label; }

	/*! \brief The filter profile kind */
	inline const char* kind() const { return m_kind; }

	/*! \brief The filter type this filter profile is for */
	inline char filterType() const { return m_filterType; }

	/*! \brief The major version of the compatible filter */
	inline uint8_t filterMajor() const { return m_filterMajor; }

	/*! \brief The minor version of the compatible filter */
	inline uint8_t filterMinor() const { return m_filterMinor; }

	/*! \brief Set the type of the filter profile to \a type_
		\param type_ the new type of the filter profile
	*/
	inline void setType(uint8_t type_)
	{
		m_type = type_;
	}

	/*! \brief Set the version of the filter profile to \a version_
		\param version_ the new label of the filter profile
	*/
	inline void setVersion(uint8_t version_)
	{
		m_version = version_;
	}

	/*! \brief Set the label of the filter profile \a label_
		\param label_ the new label of the filter profile
	*/
	inline void setLabel(const char* label_)
	{
		if (!label_ || label_[0] == 0)
		{
			m_label[0] = 0;
		}
		else
		{
			int i = 0;
			for (; i < 2 * (XS_LEN_FILTERPROFILELABEL_TERM-1); ++i)
			{
				if (label_[i] == '\0' || label_[i] == ' ')
					break;
				m_label[i] = label_[i];
			}
			m_label[i] = 0;
		}
	}

	/*! \brief Set the kind of filter profile \a kind_
	  \param kind_ the new kind of filter profile
	*/
	inline void setKind(const char* kind_)
	{
		if (!kind_ || kind_[0] == 0)
		{
			m_kind[0] = 0;
		}
		else
		{
			int i = 0;
			for (; i < XS_LEN_FILTERPROFILELABEL_TERM-1; ++i)
			{
				if (kind_[i] == '\0' || kind_[i] == ' ')
					break;
				m_kind[i] = kind_[i];
			}
			m_kind[i] = 0;
		}
	}

	/*! \brief Set the filter type of this filter profile to \a filterType_
		\param filterType_ the new filter type
	*/
	inline void setFilterType(char filterType_)
	{
		m_filterType = filterType_;
	}

	/*! \brief Set the filter version of this filter profile to \a major_, \a minor_
		\param major_ the major version number
		\param minor_ the minor version number
	*/
	inline void setFilterVersion(uint8_t major_, uint8_t minor_)
	{
		m_filterMajor = major_;
		m_filterMinor = minor_;
	}

	/*! \brief Swap the contents with \a other
	*/
	inline void swap(XsFilterProfile& other)
	{
		XsFilterProfile_swap(this, &other);
	}

	/*! \brief Return true if the filter profile type and version are identical to those of \a other */
	inline bool operator == (const XsFilterProfile& other) const
	{
		return m_filterMajor == other.m_filterMajor && m_filterMinor == other.m_filterMinor;
	}

protected:
#endif

	uint8_t m_type;								//!< The type of the filter profile. When set to 255 in an operation, the 'current' filter profile is used.
	uint8_t m_version;							//!< The version of the filter profile.
	char m_kind[XS_LEN_FILTERPROFILEKIND_TERM];	//!< The kind of filter profile.
	char m_label[1 + 2 * XS_LEN_FILTERPROFILELABEL_TERM];	//!< The label of the filter profile (Can be 2 names, including separator)
	char m_filterType;							//!< The type of the XKF filter this filter profile is intended for '3': XKF-3, '6': XKF-6. \note The value is a character, so XKF-3 is '3', which is hex 0x33
	uint8_t m_filterMajor;						//!< The major version of the XKF filter this filter profile is intended for
	uint8_t m_filterMinor;						//!< The minor version of the XKF filter this filter profile is intended for
};

typedef struct XsFilterProfile XsFilterProfile;

#endif


text:
<?php

defined('BASEPATH') OR exit('No direct script access allowed');

$lang['profiler_database'] = 'BANCO DE DADOS';
$lang['profiler_controller_info'] = 'CLASSE/MÉTODO';
$lang['profiler_benchmarks'] = 'BENCHMARKS';
$lang['profiler_queries'] = 'CONSULTAS';
$lang['profiler_get_data'] = 'DADOS GET';
$lang['profiler_post_data'] = 'DADOS POST';
$lang['profiler_uri_string'] = 'URI STRING';
$lang['profiler_memory_usage'] = 'USO DE MEMÓRIA';
$lang['profiler_config'] = 'VARIÁVEIS DE CONFIGURAÇÃO';
$lang['profiler_session_data'] = 'DADOS DA SESSÃO';
$lang['profiler_headers'] = 'CABEÇALHOS HTTP';
$lang['profiler_no_db'] = 'Não foi carregado o driver do banco de dados corrente.';
$lang['profiler_no_queries'] = 'Não existe consulta em execução.';
$lang['profiler_no_post'] = 'Não existe dados para postar.';
$lang['profiler_no_get'] = 'Não existe dados para obter.';
$lang['profiler_no_uri'] = 'Não existem dados URI';
$lang['profiler_no_memory'] = 'Uso de memória indisponível';
$lang['profiler_no_profiles'] = 'Não há dados no perfil - Todas as sessões de perfil foram desativados.';
$lang['profiler_section_hide'] = 'Ocultar';
$lang['profiler_section_show'] = 'Exibir';
$lang['profiler_seconds'] = 'segundos';


text:
CFFL_ComboBox::CFFL_ComboBox(CPDFDoc_Environment* pApp, CPDFSDK_Annot* pAnnot)
    : CFFL_FormFiller(pApp, pAnnot), m_pFontMap(NULL) {
  m_State.nIndex = 0;
  m_State.nStart = 0;
  m_State.nEnd = 0;
}

CFFL_ComboBox::~CFFL_ComboBox() {
  for (const auto& it : m_Maps)
    it.second->InvalidateFocusHandler(this);
  delete m_pFontMap;
}

PWL_CREATEPARAM CFFL_ComboBox::GetCreateParam() {
  PWL_CREATEPARAM cp = CFFL_FormFiller::GetCreateParam();

  int nFlags = m_pWidget->GetFieldFlags();
  if (nFlags & FIELDFLAG_EDIT) {
    cp.dwFlags |= PCBS_ALLOWCUSTOMTEXT;
  }

  if (!m_pFontMap)
    m_pFontMap = new CBA_FontMap(m_pWidget, GetSystemHandler());
  cp.pFontMap = m_pFontMap;
  cp.pFocusHandler = this;

  return cp;
}

CPWL_Wnd* CFFL_ComboBox::NewPDFWindow(const PWL_CREATEPARAM& cp,
                                      CPDFSDK_PageView* pPageView) {
  CPWL_ComboBox* pWnd = new CPWL_ComboBox();
  pWnd->AttachFFLData(this);
  pWnd->Create(cp);

  CFFL_IFormFiller* pFormFiller = m_pApp->GetIFormFiller();
  pWnd->SetFillerNotify(pFormFiller);

  int32_t nCurSel = m_pWidget->GetSelectedIndex(0);
  CFX_WideString swText;
  if (nCurSel < 0)
    swText = m_pWidget->GetValue();
  else
    swText = m_pWidget->GetOptionLabel(nCurSel);

  for (int32_t i = 0, sz = m_pWidget->CountOptions(); i < sz; i++) {
    pWnd->AddString(m_pWidget->GetOptionLabel(i).c_str());
  }

  pWnd->SetSelect(nCurSel);
  pWnd->SetText(swText.c_str());
  return pWnd;
}

FX_BOOL CFFL_ComboBox::OnChar(CPDFSDK_Annot* pAnnot,
                              FX_UINT nChar,
                              FX_UINT nFlags) {
  return CFFL_FormFiller::OnChar(pAnnot, nChar, nFlags);
}

FX_BOOL CFFL_ComboBox::IsDataChanged(CPDFSDK_PageView* pPageView) {
  CPWL_ComboBox* pWnd = (CPWL_ComboBox*)GetPDFWindow(pPageView, FALSE);
  if (!pWnd)
    return FALSE;

  int32_t nCurSel = pWnd->GetSelect();
  if (!(m_pWidget->GetFieldFlags() & FIELDFLAG_EDIT))
    return nCurSel != m_pWidget->GetSelectedIndex(0);

  if (nCurSel >= 0)
    return nCurSel != m_pWidget->GetSelectedIndex(0);

  return pWnd->GetText() != m_pWidget->GetValue();
}

void CFFL_ComboBox::SaveData(CPDFSDK_PageView* pPageView) {
  CPWL_ComboBox* pWnd =
      static_cast<CPWL_ComboBox*>(GetPDFWindow(pPageView, FALSE));
  if (!pWnd)
    return;

  CFX_WideString swText = pWnd->GetText();
  int32_t nCurSel = pWnd->GetSelect();

  bool bSetValue = false;

  if (m_pWidget->GetFieldFlags() & FIELDFLAG_EDIT)
    bSetValue = (nCurSel < 0) || (swText != m_pWidget->GetOptionLabel(nCurSel));

  if (bSetValue) {
    m_pWidget->SetValue(swText, FALSE);
  } else {
    m_pWidget->GetSelectedIndex(0);
    m_pWidget->SetOptionSelection(nCurSel, TRUE, FALSE);
  }

  m_pWidget->ResetFieldAppearance(TRUE);
  m_pWidget->UpdateField();
  SetChangeMark();

  m_pWidget->GetPDFPage();
}

void CFFL_ComboBox::GetActionData(CPDFSDK_PageView* pPageView,
                                  CPDF_AAction::AActionType type,
                                  PDFSDK_FieldAction& fa) {
  switch (type) {
    case CPDF_AAction::KeyStroke:
      if (CPWL_ComboBox* pComboBox =
              static_cast<CPWL_ComboBox*>(GetPDFWindow(pPageView, FALSE))) {
        if (CPWL_Edit* pEdit = pComboBox->GetEdit()) {
          fa.bFieldFull = pEdit->IsTextFull();
          int nSelStart = 0;
          int nSelEnd = 0;
          pEdit->GetSel(nSelStart, nSelEnd);
          fa.nSelEnd = nSelEnd;
          fa.nSelStart = nSelStart;
          fa.sValue = pEdit->GetText();
          fa.sChangeEx = GetSelectExportText();

          if (fa.bFieldFull) {
            fa.sChange = L"";
            fa.sChangeEx = L"";
          }
        }
      }
      break;
    case CPDF_AAction::Validate:
      if (CPWL_ComboBox* pComboBox =
              static_cast<CPWL_ComboBox*>(GetPDFWindow(pPageView, FALSE))) {
        if (CPWL_Edit* pEdit = pComboBox->GetEdit()) {
          fa.sValue = pEdit->GetText();
        }
      }
      break;
    case CPDF_AAction::LoseFocus:
    case CPDF_AAction::GetFocus:
      fa.sValue = m_pWidget->GetValue();
      break;
    default:
      break;
  }
}

void CFFL_ComboBox::SetActionData(CPDFSDK_PageView* pPageView,
                                  CPDF_AAction::AActionType type,
                                  const PDFSDK_FieldAction& fa) {
  switch (type) {
    case CPDF_AAction::KeyStroke:
      if (CPWL_ComboBox* pComboBox =
              static_cast<CPWL_ComboBox*>(GetPDFWindow(pPageView, FALSE))) {
        if (CPWL_Edit* pEdit = pComboBox->GetEdit()) {
          pEdit->SetSel(fa.nSelStart, fa.nSelEnd);
          pEdit->ReplaceSel(fa.sChange.c_str());
        }
      }
      break;
    default:
      break;
  }
}

FX_BOOL CFFL_ComboBox::IsActionDataChanged(CPDF_AAction::AActionType type,
                                           const PDFSDK_FieldAction& faOld,
                                           const PDFSDK_FieldAction& faNew) {
  switch (type) {
    case CPDF_AAction::KeyStroke:
      return (!faOld.bFieldFull && faOld.nSelEnd != faNew.nSelEnd) ||
             faOld.nSelStart != faNew.nSelStart ||
             faOld.sChange != faNew.sChange;
    default:
      break;
  }

  return FALSE;
}

void CFFL_ComboBox::SaveState(CPDFSDK_PageView* pPageView) {
  ASSERT(pPageView);

  if (CPWL_ComboBox* pComboBox =
          static_cast<CPWL_ComboBox*>(GetPDFWindow(pPageView, FALSE))) {
    m_State.nIndex = pComboBox->GetSelect();

    if (CPWL_Edit* pEdit = pComboBox->GetEdit()) {
      pEdit->GetSel(m_State.nStart, m_State.nEnd);
      m_State.sValue = pEdit->GetText();
    }
  }
}

void CFFL_ComboBox::RestoreState(CPDFSDK_PageView* pPageView) {
  ASSERT(pPageView);

  if (CPWL_ComboBox* pComboBox =
          static_cast<CPWL_ComboBox*>(GetPDFWindow(pPageView, TRUE))) {
    if (m_State.nIndex >= 0) {
      pComboBox->SetSelect(m_State.nIndex);
    } else {
      if (CPWL_Edit* pEdit = pComboBox->GetEdit()) {
        pEdit->SetText(m_State.sValue.c_str());
        pEdit->SetSel(m_State.nStart, m_State.nEnd);
      }
    }
  }
}

CPWL_Wnd* CFFL_ComboBox::ResetPDFWindow(CPDFSDK_PageView* pPageView,
                                        FX_BOOL bRestoreValue) {
  if (bRestoreValue)
    SaveState(pPageView);

  DestroyPDFWindow(pPageView);

  CPWL_Wnd* pRet = NULL;

  if (bRestoreValue) {
    RestoreState(pPageView);
    pRet = GetPDFWindow(pPageView, FALSE);
  } else {
    pRet = GetPDFWindow(pPageView, TRUE);
  }

  m_pWidget->UpdateField();

  return pRet;
}

#ifdef PDF_ENABLE_XFA
FX_BOOL CFFL_ComboBox::IsFieldFull(CPDFSDK_PageView* pPageView) {
  if (CPWL_ComboBox* pComboBox =
          static_cast<CPWL_ComboBox*>(GetPDFWindow(pPageView, FALSE))) {
    if (CPWL_Edit* pEdit = pComboBox->GetEdit())
      return pEdit->IsTextFull();
  }
  return FALSE;
}
#endif  // PDF_ENABLE_XFA

void CFFL_ComboBox::OnSetFocus(CPWL_Wnd* pWnd) {
  ASSERT(m_pApp);

  if (pWnd->GetClassName() == PWL_CLASSNAME_EDIT) {
    CPWL_Edit* pEdit = (CPWL_Edit*)pWnd;
    pEdit->SetCharSet(134);
    pEdit->SetCodePage(936);

    pEdit->SetReadyToInput();
    CFX_WideString wsText = pEdit->GetText();
    int nCharacters = wsText.GetLength();
    CFX_ByteString bsUTFText = wsText.UTF16LE_Encode();
    unsigned short* pBuffer = (unsigned short*)bsUTFText.c_str();
    m_pApp->FFI_OnSetFieldInputFocus(m_pWidget->GetFormField(), pBuffer,
                                     nCharacters, TRUE);

    pEdit->SetEditNotify(this);
  }
}

void CFFL_ComboBox::OnKillFocus(CPWL_Wnd* pWnd) {
  ASSERT(m_pApp);
}

void CFFL_ComboBox::OnAddUndo(CPWL_Edit* pEdit) {
  ASSERT(pEdit);
}

CFX_WideString CFFL_ComboBox::GetSelectExportText() {
  CFX_WideString swRet;

  int nExport = -1;
  CPDFSDK_PageView* pPageView = GetCurPageView();
  if (CPWL_ComboBox* pComboBox =
          (CPWL_ComboBox*)GetPDFWindow(pPageView, FALSE)) {
    nExport = pComboBox->GetSelect();
  }

  if (nExport >= 0) {
    if (CPDF_FormField* pFormField = m_pWidget->GetFormField()) {
      swRet = pFormField->GetOptionValue(nExport);
      if (swRet.IsEmpty())
        swRet = pFormField->GetOptionLabel(nExport);
    }
  }

  return swRet;
}


text:
package com.softtechlabs.selenquery.core;

import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.Select;

/**
 * Created by MANISH on 05-11-2015.
 */
public class SelenSelect extends Select {
    public SelenSelect(WebElement element) {
        super(element);
    }

    public Dropdown Should() {
        return new Dropdown(true, this.getAllSelectedOptions());
    }

    public Dropdown ShouldNot() {
        return new Dropdown(false, this.getAllSelectedOptions());
    }

}


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

  <modelVersion>4.0.0</modelVersion>
  <groupId>javax.ws.rs</groupId>
  <artifactId>jsr311-api</artifactId>
  <packaging>jar</packaging>
  <version>1.1.1</version>
  <name>jsr311-api</name>
  <url>https://jsr311.dev.java.net</url>

<!--
  <scm>
    <connection>scm:svn:https://jsr311.dev.java.net/svn/jsr311/trunk/src</connection>
    <developerConnection>scm:svn:https://jsr311.dev.java.net/svn/jsr311/trunk/src</developerConnection>
  </scm>
-->

    <organization>
        <name>Sun Microsystems, Inc</name>
        <url>http://www.sun.com/</url>
    </organization>

    <issueManagement>
        <system>bugzilla</system>
        <url>https://jsr311.dev.java.net/servlets/ProjectIssues</url>
    </issueManagement>

    <mailingLists>
        <mailingList>
            <name>JSR311 Dev List</name>
            <archive>dev@jsr311.dev.java.net</archive>
        </mailingList>
        <mailingList>
            <name>JSR311 Users List</name>
            <archive>users@jsr311.dev.java.net</archive>
        </mailingList>
        <mailingList>
            <name>JSR311 Announce List</name>
            <archive>announce@jsr311.dev.java.net</archive>
        </mailingList>
    </mailingLists>

    <licenses>
        <license>
            <name>
                CDDL License
            </name>
            <url>http://www.opensource.org/licenses/cddl1.php</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

  <build>
    <sourceDirectory>src</sourceDirectory>
    <testSourceDirectory>test</testSourceDirectory>

    <plugins>
      <plugin>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>2.0.2</version>
          <configuration>
              <source>1.5</source>
              <target>1.5</target>
          </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>2.2</version>
        <configuration>
          <archive>
            <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
            <manifestEntries>
              <Specification-Title>JAX-RS: Java API for RESTful Web Services</Specification-Title>
              <Specification-Version>${project.version}</Specification-Version>
              <Specification-Vendor>Sun Microsystems, Inc.</Specification-Vendor>
              <Extension-Name>javax.ws.rs</Extension-Name>
              <Build-Id>${buildNumber}</Build-Id>
            </manifestEntries>
          </archive>
        </configuration>
      </plugin>
      <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>buildnumber-maven-plugin</artifactId>
          <configuration>
            <format>{0,date,MM/dd/yyyy hh:mm aa}</format>
            <items>
              <item>timestamp</item>
            </items>
          </configuration>
          <executions>
            <execution>
              <phase>validate</phase>
              <goals>
                <goal>create</goal>
              </goals>
            </execution>
          </executions>
       </plugin>
       <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
          <executions>
            <execution>
              <phase>validate</phase>
              <goals>
                <goal>jar</goal>
              </goals>
            </execution>
          </executions>
       </plugin>
       <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <executions>
          <execution>
            <id>attach-sources</id>
            <phase>validate</phase>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <extensions>true</extensions>
        <executions>
          <execution>
            <id>bundle-manifest</id>
            <phase>process-classes</phase>
            <goals>
              <goal>manifest</goal>
            </goals>
            <configuration>
              <instructions>
                <Export-Package>javax.ws.rs.*</Export-Package>
                <Import-Package></Import-Package>
                <Bundle-Version>1.1.1</Bundle-Version>
              </instructions>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
        <extensions>
          <extension>
            <groupId>org.jvnet.wagon-svn</groupId>
              <artifactId>wagon-svn</artifactId>
              <version>1.8</version>
          </extension>
        </extensions>
  </build>

    <repositories>
        <repository>
            <id>java.net.m2</id>
            <url>http://download.java.net/maven/2</url>
            <layout>default</layout>
        </repository>
    </repositories>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

    <distributionManagement>
      <repository>
        <uniqueVersion>false</uniqueVersion>
        <id>java.net-m2-repository</id>
        <url>java-net:/maven2-repository/trunk/repository/</url>
      </repository>
    </distributionManagement>

</project>


text:
'use strict';

function Physiotherapist(physiotherapist) {
	this.physiotherapist = physiotherapist;
}

module.exports = Physiotherapist;


text:
<ion-view view-title="Tech News">
  <ion-content>

stedr uses several platforms on the Internet. This post describes shortcomings and changes in these platforms that affect stedr. If you notice that a feature ceases to work properly, give us feedback as a comment to this post.

June 2014 - SoundCloud app: The latest version of SoundCloud app on iPhone (version 3.0) does no longer support recording. SoundCloud recommends you to use the AudioCopy application

April 2014 - Retrieving places from Flickr: Places are currently stored in Flickr. The interface to Flickr is unstable and occasionally not available. This is why stedr asks you to refresh the map. We are looking for an alternative to Flickr

  </ion-content>
</ion-view>


text:
<!doctype html>

    <title>Talk - Modular SQL Using SQLAlchemy - PyGotham 2016</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="../../../static/css/app.css">

    <meta name="msapplication-TileColor" content="#182833">
    <meta name="msapplication-TileImage" content="/static/img/metro-icon.png">
    <link rel="apple-touch-icon-precomposed" href="../../../static/img/apple-touch-icon.png">
    <link rel="icon" href="../../../static/img/favicon.png">

          Menu

              About

Code of Conduct

FAQ

Privacy Policy

What is PyGotham?

              Events

Social

Talk List

Talk Schedule

              Registration

Information

              Speaking

Call for Proposals

              Sponsors

Sponsors

Sponsorship Prospectus

              Venue

Hotels

Information

Modular SQL Using SQLAlchemy

      04:00 PM - 04:25 PM on July 16, 2016, Room CR7

        Bo Du

Audience level:

novice

Description

SQLAlchemy is a powerful library which provides a number of powerful abstractions and patterns for SQL.
One of these patterns is the ability to build "composable" queries.

This talk will cover:

When to use SQLAlchemy to modularize your SQL into composable parts

How to reason about the deconstruction of a query

Step by step example of how to write modular SQL using SQLAlchemy

Abstract

Defined Problem:
SQL is difficult to composable. Many applications have conditional logic describing the data they need to fetch from the database.
Piecing together snippets of SQL to satisfy the conditional logic of your application is not optimal.

Solution:
With SQLAlchemy, you can write python code that will transpile into the necessary SQL query.
SQLAlchemy allows you to modularize your SQL and DRY up repetitive lines of raw SQL scattered throughout your code base.
Just rinse and reuse.

When is it Useful:
Any ORM can be used to perform simple CRUD operations.
SQLAlchemy is built around two layers, one mirroring SQL constructs and one being the ORM.
They SQL layer provides both standard and database specific SQL functions, data types and and operators.
This is especially useful when writing advanced queries based on 100 different input parameters.

        PyGotham 2016 is a production of Big Apple Py.

        Artwork by Jessie Sima. UX by Allison Cameron. Hosting provided by Rackspace.

        Questions? Comments? Please contact organizers@pygotham.org.


text:
.. _users-guide-statistics:

Statistics
----------

Now that your varnish is up and running let's have a look at how it is
doing. There are several tools that can help.

varnishtop
~~~~~~~~~~

The varnishtop utility reads the shared memory logs and presents a
continuously updated list of the most commonly occurring log entries.

With suitable filtering using the -I, -i, -X and -x options, it can be
used to display a ranking of requested documents, clients, user
agents, or any other information which is recorded in the log.

``varnishtop -i rxurl`` will show you what URLs are being asked for
by the client. ``varnishtop -i txurl`` will show you what your backend
is being asked the most. ``varnishtop -i RxHeader -I
Accept-Encoding`` will show the most popular Accept-Encoding header
the client are sending you.

varnishhist
~~~~~~~~~~~

The varnishhist utility reads varnishd(1) shared memory logs and
presents a continuously updated histogram showing the distribution of
the last N requests by their processing.  The value of N and the
vertical scale are displayed in the top left corner.  The horizontal
scale is logarithmic.  Hits are marked with a pipe character ("|"),
and misses are marked with a hash character ("#").

varnishsizes
~~~~~~~~~~~~

Varnishsizes does the same as varnishhist, except it shows the size of
the objects and not the time take to complete the request. This gives
you a good overview of how big the objects you are serving are.

varnishstat
~~~~~~~~~~~

Varnish has lots of counters. We count misses, hits, information about
the storage, threads created, deleted objects. Just about
everything. varnishstat will dump these counters. This is useful when
tuning varnish.

There are programs that can poll varnishstat regularly and make nice
graphs of these counters. One such program is Munin. Munin can be
found at http://munin-monitoring.org/ . There is a plugin for munin in
the varnish source code.


text:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Linq;
using CommandLine.OptParse;
using StructureMap;

namespace Sep.Git.Tfs.Commands
{
    [Pluggable("clone")]
    [Description("clone [options] tfs-url repository-path <git-repository-path>")]
    public class Clone : GitTfsCommand
    {
        private readonly Fetch fetch;
        private readonly Init init;
        private readonly Globals globals;

        public Clone(Globals globals, Fetch fetch, Init init)
        {
            this.fetch = fetch;
            this.init = init;
            this.globals = globals;
        }

        public IEnumerable<IOptionResults> ExtraOptions
        {
            get { return this.MakeNestedOptionResults(init, fetch); }
        }

        public int Run(IList<string> args)
        {
            var retVal = 0;
            retVal = init.Run(DeriveRepositoryDirectory(args));
            if (retVal == 0) retVal = fetch.Run(new List<string>());
            if (retVal == 0) globals.Repository.CommandNoisy("merge", globals.Repository.ReadAllTfsRemotes().First().RemoteRef);
            return retVal;
        }

        IList<string> DeriveRepositoryDirectory(IList<string> args)
        {
            if (args.Count == 2)
            {
                args = new List<string>(args);
                args.Add(Path.GetFileName(args[1]));
            }
            return args;
        }
    }
}


text:
/**
 *
 */
package org.esupportail.publisher.repository.predicates;

import org.esupportail.publisher.domain.QReader;
import org.esupportail.publisher.domain.Reader;

import com.querydsl.core.types.Predicate;
import com.querydsl.core.types.dsl.BooleanExpression;

/**
 * @author GIP RECIA - Julien Gribonvald 29 sept. 2014
 */
public final class ReaderPredicates {

	public static Predicate sameName(final Reader reader) {
		final QReader qreader = QReader.reader;
		final BooleanExpression readerExistName = qreader.name.eq(reader
				.getName());
		final BooleanExpression readerExistId = qreader.id.eq(reader.getId());
		if (reader.getId() > 0) {
			return readerExistName.and(readerExistId.not());
		}
		return readerExistName;
	}

}


text:
<!DOCTYPE html>

 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >
 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" >

 <meta name="ROBOTS" content="NOINDEX,NOARCHIVE">

 <link rel="icon" type="image/vnd.microsoft.icon" href="http://www.gstatic.com/codesite/ph/images/phosting.ico">

 <title>

 Google Project Hosting
 </title>
 <link type="text/css" rel="stylesheet" href="http://www.gstatic.com/codesite/ph/1921157816818850314/css/core.css">

 <link type="text/css" rel="stylesheet" href="http://www.gstatic.com/codesite/ph/1921157816818850314/css/ph_list.css" >

 My favorites ▼
 | Sign in

 <link itemprop="url" href="">

 <form action="/hosting/search">
 <input size="40" name="q" value="label:asdasd lkjnhbvcx" type="text">

 <input type="submit" name="projectsearch" value="Search projects" >
 </form>

Your search - label:asdasd lkjnhbvcx - did not generate any results.

 <form action="/hosting/search">
 <input type="text" size="30" name="q" value="label:asdasd lkjnhbvcx">
 <input type="hidden" name="mode" value="list">
 <input type="submit" name="projectsearch" value="Search projects" >
 </form>

 Terms -
 Privacy -
 Project Hosting Help

 Powered by Google Project Hosting


text:
> Grunt plugin for running Symfony2 commands.

[![Build Status](https://travis-ci.org/florianeckerstorfer/grunt-symfony2.svg?branch=master)](https://travis-ci.org/florianeckerstorfer/grunt-symfony2)

## Getting Started
This plugin requires Grunt `~0.4.4`

If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

```shell
npm install grunt-symfony2 --save-dev
```

Once you installed the plugin you can enable it inside your Gruntfile with this line of JavaScript:

```js
grunt.loadNpmTasks('grunt-symfony2');
```

## The "sf2-console" task

The `sf2-console` task let's you execute arbitrary commands of your Symfony2 application.

### Overview
In your project's Gruntfile, add a section named `sf2-console` to the data object passed into `grunt.initConfig()`.

```js
'sf2-console': {
    options: {
        // Task-specific options go here.
    },
    your_target: {
        cmd: 'command:name',
        args: {
            // Arguments
        }
    }
}
```

### Options

#### options.bin
Type: `String`
Default value: `app/console`

Path to console application that you want to use.

### Usage Examples

#### Default Options
`grunt-symfony2` uses by default `app/console` as binary to execute commands.

```js
'sf2-console': {
    options: {},
    cache_clear_prod: {
        cmd: 'cache:clear',
        args: {
            env: 'prod'
        }
    }
}
```

#### Custom Options
If you want to use a custom binary, you can change the `bin` option.

```js
'sf2-console': {
    options: {
        bin: 'app/sf2console'
    },
    cache_clear_prod: {
        cmd: 'cache:clear',
        args: {
            env: 'prod'
        }
    }
}
```

### Environment Auto Detection
The execution environment of a task can be auto detected based on the target. If the targets name is either `prod`,
`dev` or `staging` and the `env` argument is not present the task uses the target name as environment.

#### Example

The following task executes automatically in `prod` environment.

```js
'sf2-cache-clear': {
    options: {},
    prod: {}
}
```

## Other "sf-*" tasks
`grunt-symfony2` contains additional tasks that allow you to quickly execute Symfony2 commands from grunt. The tasks
work exactly like the `sf2-console` task, you just don't need to provide the `cmd` option. Arguments and auto detection
of the environment are also supported. Currently we support the following commands:

- **sf2-assetic-dump**: `assetic:dump`
- **sf2-assets-install**: `assets:install`
- **sf2-cache-clear**: `cache:clear`
- **sf2_cache_warmup**: `cache:warmup`
- **sf2-doctrine-cache-clear-metadata**: `doctrine:cache:clear-metadata`
- **sf2-doctrine-cache-clear-query**: `doctrine:cache:clear-query`
- **sf2-doctrine-cache-clear-result**: `doctrine:cache:clear-result`
- **sf2-doctrine-database-create**: `doctrine:database:create`
- **sf2-doctrine-database-drop**: `doctrine:database:drop`
- **sf2-doctrine-ensure-production-settings**: `doctrine:ensure-production-settings`
- **sf2-doctrine-fixtures-load**: `doctrine:fixtures:load`
- **sf2-doctrine-migrations-diff**: `doctrine:migrations:diff`
- **sf2-doctrine-migrations-execute**: `doctrine:migrations:execute`
- **sf2-doctrine-migrations-generate**: `doctrine:migrations:generate`
- **sf2-doctrine-migrations-latest**: `doctrine:migrations:latest`
- **sf2-doctrine-migrations-migrate**: `doctrine:migrations:migrate`
- **sf2-doctrine-migrations-status**: `doctrine:migrations:status`
- **sf2-doctrine-migrations-version**: `doctrine:migrations:version`
- **sf2-doctrine-schema-create**: `doctrine:schema:create`
- **sf2-doctrine-schema-drop**: `doctrine:schema:drop`
- **sf2-doctrine-schema-update**: `doctrine:schema:update`
- **sf2-doctrine-schema-validate**: `doctrine:schema:validate`
- **sf2-orm-convert-mapping**: `orm:convert:mapping`
- **sf2-translation-update**: `translation:update`
- **sf2-twig-lint**: `twig:lint`

### Examples

Set the value to `true` if you want to use an option without value:

```js
'sf2-doctrine-schema-update': {
    dev: {
        args: { force: true }
    }
}
```

It's a little bit confusing, but you have to put arguments (speaking in Symfony2 console terms) outside of the `args` array.

```js
'sf2-orm-convert-mapping': {
    dev: {
        'to-type': 'xml',
        'dest-path': 'src/Acme/DemoBundle/Entity'
    },
    options: {
        bin: 'test/fixtures/console'
    }
}
```

## Author
- [Florian Eckerstorfer](http://florian.ec) ([Twitter](http://twitter.com/Florian_), [App.net](http://app.net/florian))

## Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/).

## Release History

### Version 0.5 (24 February 2016)

- Add support for Grunt v1.0

### Version 0.4 (11 April 2014)

- Show output of Sculpin in Grunt output

### Version 0.3 (30 March 2014)

- Added support for arguments in tasks

### Version 0.2 (30 March 2014)

- Improved task names
- Additional tests

### Version 0.1 (24 March 2014)

- Initial release


text:
use strict;
use YAML::Syck;

# For documentation, see usage() method, or run with "-h" option

my %selection = ();  # subset of ontologies to run on (defaults to all)
my %omit = ();  # subset of ontologies to omit (defaults to all)
my $dry_run = 0;     # do not deploy if dry run is set
my $target_dir = './deployed-ontologies';  # in a production setting, this would be a path to web-visible area, e.g. berkeley CDN or NFS
my $is_compare_obo = 0;
my $email = '';
my $registry_url = "https://raw.githubusercontent.com/OBOFoundry/OBOFoundry.github.io/master/registry/ontologies.yml";

while ($ARGV[0] && $ARGV[0] =~ /^\-/) {
    my $opt = shift @ARGV;
    print STDERR "OPT: $opt\n";

    if ($opt eq '-h' || $opt eq '--help') {
        print &usage();
        exit 0;
    }
    elsif ($opt eq '-s' || $opt eq '--select') {
        $selection{shift @ARGV} = 1;
    }
    elsif ($opt eq '-x' || $opt eq '--omit') {
        $omit{shift @ARGV} = 1;
    }
    elsif ($opt eq '-t' || $opt eq '--target-dir') {
        $target_dir = shift @ARGV;
    }
    elsif ($opt eq '-d' || $opt eq '--dry-run') {
        $dry_run = 1;
    }
    elsif ($opt eq '-c' || $opt eq '--compare-obo') {
        $is_compare_obo = 1;
    }
    elsif ($opt eq '-r' || $opt eq '--registry') {
        $registry_url = shift @ARGV;

    }
    elsif ($opt eq '-e' || $opt eq '--email') {
        $email = shift @ARGV;
    }
    else {
        die "unknown option: $opt";
    }
}

if (@ARGV) {
    die "unprocessed command line arguments: @ARGV";
}

my %ont_info = ();

# Build-in registry
%ont_info = get_ont_info();

# set up dir structure if not present
if (!(-d 'src')) {
    run("mkdir src");
}
if (!(-d 'failed-builds')) {
    run("mkdir failed-builds");
}
if (!(-d $target_dir)) {
    run("mkdir $target_dir");
}

# --GLOBALS--
my $ont;  # current ontology. Always an ontology ID such as 'go', cl', ...
my $n_errs = 0;   # total errs found
my @errs = ();    # err objects
my @onts_to_deploy = ();   # ont IDs that were successful
my @failed_onts = ();   # ont IDs that fail
my @failed_infallible_onts = ();   # ont IDs that fail that cause an error

# --MAIN--
# Iterate over all ontologies attempting to build or mirror
# - external data is first pulled into a staging area
# - for methods that employ a conversion, a check is perfomed to see if the source has changed
# - if successful, built ontologies are copied to deployment area at end of iteration
foreach my $k (keys %ont_info) {
    $ont = $k;

    if (keys %selection) {
        next unless $selection{$ont};
    }
    if (keys %omit) {
        next if $omit{$ont};
    }
    debug("ONTOLOGY: $ont");

    my $info = $ont_info{$ont};
    my $method = lc($info->{method});
    my $source_url = $info->{source_url};

    my $success = 0;

    # Method: vcs -- Version Control System - mirror package directly from svn/git checkout/update
    if ($method eq 'vcs') {

        my $system = $info->{system} || 'svn';

        # we always checkout into a staging dir
        my $dir = "stage-$system-$ont";

        if (-d $dir) {
            # already checked out - issue update
            my $cmd = $info->{update};
            if (!$cmd) {
                if ($system eq 'svn') {
                    $cmd = 'svn --ignore-externals update';
                }
                elsif ($system eq 'git') {
                    $cmd = 'git pull';
                }
                else {
                    die "$system not known";
                }
            }
            $success = run("cd $dir && $cmd");
        }
        else {
            # initial checkout
            my $cmd = $info->{checkout};
            if ($cmd) {
                if ($cmd =~/svn.*https/) {
                    debug("WARNING: svn URL includes https - possible config error?");
                }
                $success = run("$cmd $dir");
            }
            else {
                $success = 0;
                debug("Config error: checkout not set for $ont");
            }
        }

        # allow optional subdir. E.g. if we check out to project root, we may want to copy from src/ontology to target
        my $srcdir = $dir;
        if ($info->{path}) {
            $srcdir .= "/".$info->{path};
        }

        # post-processing: TODO - add this for other commands
        if ($success && $info->{post_processing_command}) {
            $success = run("cd $srcdir && $info->{post_processing_command}");
        }

        # copy from staging checkout area to target
        if ($success) {
            $success = run("rsync --exclude=.svn -avz --delete $srcdir/ $ont");
        }
        else {
            debug("will not rsync to target as previous steps were not successful");
        }
    }

    # Method: obo2owl -- Build entire package from single obo file using OORT
    if ($method eq 'obo2owl') {
        my $SRC = "src/$ont.obo";
        my @OORT_ARGS = "--no-subsets --reasoner elk";
        if ($info->{oort_args}) {
            @OORT_ARGS = $info->{oort_args};
        }
        my $env = '';
        if ($info->{oort_memory}) {
            $env = "OORT_MEMORY=$info->{oort_memory} ";
        }
        # TODO - no action if unchanged
        $success = wget($source_url, $SRC);
        if ($success) {

            if (is_different("$SRC.prev", $SRC) || !(-f "$ont/$ont.owl")) {

                # If the config states to auto-insert an ontology: header, then do it first
                if ($info->{insert_ontology_id}) {
                    # truly awful hack to insert the ontology id, required in obof1.4 and in particular by Oort;
                    # it would be better to add this as an option to Oort, but Oort development is frozen,
                    # and we will eventually replace the Oort command with ROBOT anyway
                    run("perl -pi -ne 's\@^format-version:\@ontology: $ont\\nformat-version:\@' $SRC");
                }

                # Oort places package files directly in target area, if successful
                my @skips = ('--skip-format owx', '--skip-format metadata');
                if ($ont eq 'pr' || $ont eq 'chebi' || $ont eq 'ncbitaxon') {
                    push(@skips, '--skip-format json');
                }
                $success = run($env."ontology-release-runner --skip-release-folder @skips --ignoreLock --allow-overwrite --outdir $ont @OORT_ARGS --asserted --simple $SRC");
                if ($success) {
                    run("mv $SRC $SRC.prev");
                }
                else {
                    debug("oort failed for: $SRC");
                }
            }
            else {
                debug("obo has not changed for $ont - will not rebuild");
            }

        }
        else {
            debug("will not run Oort as wget was unsuccessful");
        }
    }

    # Method: owl2obo -- Build entire package from single obo file using OORT
    if ($method eq 'owl2obo') {

        # TODO - reuse code with obo2owl. Keep separate for now, as owl2obo may require extra configuration
        my $SRC = "src/$ont.owl";
        my @OORT_ARGS = "--reasoner elk";
        if ($info->{oort_args}) {
            @OORT_ARGS = $info->{oort_args};
        }
        $success = wget($source_url, $SRC);
        # TODO - less strict mode for owl2obo, many ontologies do not conform to obo constraints
        # TODO - allow options including translation of annotation axioms, merging of import closure, etc
        if ($success) {

            if (is_different("$SRC.prev", $SRC) || !(-f "$ont/$ont.obo")) {
                # Oort places package files directly in target area, if successful
                $success = run("ontology-release-runner --repair-cardinality --skip-release-folder --skip-format owx --ignoreLock --allow-overwrite --outdir $ont @OORT_ARGS --asserted --simple $SRC");
                if ($success) {
                    run("mv $SRC $SRC.prev");
                }
            }
            else {
                debug("owl has not changed for $ont - will not rebuild");
            }
        }
        else {
            debug("will not run Oort as wget was unsuccessful");
        }
    }

    # Method: archive -- Mirror package from archive
    if ($method eq 'archive') {
        my $SRC = "src/$ont-archive.zip";
        my $path = $info->{path};
        my $tmpdir = "tmp";
        if (!$path) {
            die "must set path for $ont";
        }
        $success = run("wget --no-check-certificate $source_url -O $SRC");
        if ($success) {
            if (-d $tmpdir) {
                $success = run("rm -rf $tmpdir");
            }
            $success = run("mkdir $tmpdir");
            if (!$success) {
                debug("Could not clear prepare archive dir: $tmpdir");
            }
            else {
                # chmod is necessary because of a weird jenkins bug
                $success = run("(cd $tmpdir && unzip -o ../$SRC && chmod -R 777 *)");
                if ($success) {
                    $success = run("rsync -avz --delete $tmpdir/$path/ $ont");
                    if ($success) {
                        debug("archive successful for $ont");
                    }
                    else {
                        debug("Failed to rsync to $ont");
                    }
                }
                else {
                    debug("unzip failed for $ont");
                }
            }
        }
        else {
            debug("wget failed on $source_url - no further action taken on $ont");
        }
    }

    if ($method eq 'custom') {
        die "not implemented";
    }

    # TEST
    if ((-f "$ont/$ont.obo") && (-f "$ont/$ont.owl")) {
        # ok
    }
    else {
        debug("Missing obo or owl files for $ont");
        $success = 0;
    }

    if ($is_compare_obo && $success) {
        # TODO - use boubastis
        my $this = "$ont/$ont.obo";
        my $last = "$target_dir/$ont/$ont.obo";
        if (is_different($this, $last,"$ont/central-obo-diff.txt")) {

            # central rss
            if (!(-d 'rss')) {
                run("mkdir rss");
            }
            # only compare if there are differences (i.e. cmp "fails")
            my $dargs = "--config 'html/ontology_name=$ont' --rss-path rss -f1 $last -f2 $this -m html text rss";
            if ($email) {
                $dargs .= " email --config email_to=$email";
                if ($info->{email_cc}) {
                    $dargs .= " --config email_cc=$info->{email_cc}";
                }
            }
            run("compare-obo-files.pl $dargs -o $ont/central-obo-diff");
            run("compare-defs.pl $dargs -o $ont/central-def-diff");
            my $date = `date +%Y-%m-%d`;
            chomp $date;
            if (!(-d "$ont/releases")) {
                run("mkdir $ont/releases");
            }
            # we don't create a full set of releases - only
            if (!(-d "$ont/releases/$date")) {
                run("mkdir $ont/releases/$date");
            }
            run("cp $ont/*-diff* $ont/releases/$date");
        }
        else {
            debug("no change in $ont - not creating a diff");
        }
    }

    if ($success) {
        debug("Slated for deployment: $ont");
        push(@onts_to_deploy, $ont);
    }
    else {
        run("rsync -avz $ont failed-builds && rm -rf $ont");
        push(@failed_onts, $ont);
        if ($info->{infallible}) {
            push(@failed_infallible_onts, $ont);
        }
    }
}

# --REPORTING--
print "Build completed\n";
print "N_Errors: $n_errs\n";
foreach my $err (@errs) {
    print "ERROR: $err->{ont} $err->{cmd} $err->{err_text}\n";
}
printf "# Failed ontologies: %d\n", scalar(@failed_onts);
foreach my $font (@failed_onts) {
    print "FAIL: $font\n";
}
my $errcode = 0;

# --DEPLOYMENT--
# each successful ontology is copied to deployment area

$n_errs = 0; # reset
if ($dry_run) {
    debug("dry-run -- no deploy");
}
else {
    foreach my $ont (@onts_to_deploy) {
        debug("deploying $ont");
        # TODO - copy main .obo and .owl to top level
        run("rsync -avz --delete $ont/ $target_dir/$ont");

        deploy($ont, 'obo', $target_dir, 1);
        deploy($ont, 'owl', $target_dir, 1);
        deploy($ont, 'json', $target_dir, 0);
    }
    if (-d 'rss') {
        run("rsync -avz rss/ $target_dir/rss");
    }
}

if ($n_errs > 0) {
    $errcode = 1;
}

if (@failed_infallible_onts) {
    printf "# Failed ontologies: %d\n", scalar(@failed_onts);
    foreach my $font (@failed_infallible_onts) {
        print "FAIL: $font # THIS SHOULD NOT FAIL\n";
        $errcode = 1;
    }
}

if ($errcode) {
    # http://stackoverflow.com/questions/8148122/how-to-mark-a-build-unstable-in-jenkins-when-running-shell-scripts
    print "UNSTABLE: PROBLEMS WITH BUILD\n";
}
else {
    print "COMPLETED SUCCESSFULLY!\n";
}

# note that if we reach this point we want to exit with a successful error code;
# the build may still be marked unstable for jenkins
exit 0;
#exit $errcode;

# --SUBROUTINES--

sub deploy {
    my ($ont, $fmt, $target_dir, $is_forced) = @_;
    my $srcf = "$ont/$ont.$fmt";
    if (! -f $srcf && !$is_forced) {
        print STDERR "NOT FOUND: $srcf\n";
        return;
    }

    run("rsync $srcf $target_dir");
    run("gzip -c $srcf > $srcf.gz && rsync $srcf.gz $target_dir");

}

# Run command in the shell
# globals affected: $n_errs, @errs
# returns non-zero if success
sub run {
    my $cmd = shift @_;
    debug("  RUNNING: $cmd");
    my $err = system("$cmd 2> ERR");
    if ($err) {
        my $err_text = `cat ERR`;
        print STDERR "ERROR RUNNING: $cmd [in $ont ] code: $err\n";
        print STDERR $err_text;
        push(@errs, { ont => $ont,
                      cmd => $cmd,
                      err => $err,
                      err_text => $err_text });
        $n_errs ++;
    }
    return !$err;
}

sub is_different {
    my $this = shift;
    my $last = shift || 'obo';
    my $out = shift || 'diff.tmp';

    my $diffcmd = "diff -b $this $last > $out";
    debug("CMD: $diffcmd");
    my $is_different = system($diffcmd);
    debug("comparing $this to $last == $is_different");
    return $is_different;
}

sub wget {
    my ($url, $tgt) = @_;
    return run("wget -T 300 --no-check-certificate '$url' -O $tgt");
}

sub debug {
    my $t = `date`;
    chomp $t;
    print STDERR "$t :: @_\n";
}

# Each ontology has build metadata in a lookup table. See documentation at bottom of file for overview
#
# Keys:
#  - method : see below. Currently: obo2owl, owl2obo, vcs or archive
#  - source_url : required for obo2owl or owl2obo or archive methods. For obo<->owl the entire package is build from this one file. for archive, this is the location of the archive file.
#  - checkout : required for vcs method. The command to checkout from scratch the repo. Note this is suffixed with a loca dir name - do not add this to the cfg.
#  - system : required for vcs method. Currently one of: git OR svn
#  - path: required for archive, optional for vcs. This is the path in the archive that corresponds to the top level of the package.
#  - infallible : if a build of this ontology fails, the exit code of this script is an error (resulting in red ball if run in jenkins). This should only be set for ontologies with responsive maintainers.
#
# Notes:
#  For VCS, the checkout command should be to what would correspond to the top level of the package.
#  For all wget operations, --no-check-certificate is used
#
# Remember:
#  - For googlecode, anon checkouts should use http, not https
sub get_ont_info {
    my %ont_info = ();

    open(F, "curl $registry_url|");
    my $md = Load(join("", <F>));
    close(F);

    foreach my $ont (@{$md->{ontologies}}) {
        my $k = $ont->{id};
        $ont_info{$k} = $ont->{build};
    }
    return %ont_info;
}

sub usage() {

    <<EOM;
build-obo-ontologies.pl [-d|--dry-run] [-s ONT]* [-t|--target-dir TARGET]

ABOUT

This is the script that builds the contents of http://berkeleybop.org/ontologies/

Each ontology is placed in the top level (e.g. ma.obo, ma.owl), and
also in an ontology specific subdirectory (e.g. ma/ma.obo) along with
other derived artefacts.

The script can be executed locally.

DEPENDENCIES

 * Oort (command line)
 * svn client
 * git client
 * wget

PURPOSE

Builds or mirrors ontologies from the OBO library. After execution,
the directory from which this program was run will contain directories
such as:

  ma/
  fbbt/
  go/

These will also be copied to TARGET (default: "./deployed-ontologies")

Each of these should correspond to the structure of the corresponding obolibrary purl. For example,

  go/
    go.obo
    go.owl
    go-simple.obo
    subsets/
      goslim_plant.obo
      goslim_prok.obo
      ...

This can be used to build local copies of ontologies to be used with
an OWL catalog (TODO: document owltools directory mapper here).

This script is the one used by Jenkins to make a daily build here:

 http://berkeleybop.org/ontologies/

Which is currently the default fallback for unregistered purls (and
registered purls are welcome to redirect here, or to register to their
preferred hosting solution).

HOW IT WORKS

The script uses an internal registry to determine how to build each
ontology. There are currently 3 methods:

  * obo2owl
  * owl2obo
  * archive
  * vcs

The "obo2owl" method is intended for ontologies that publish a single
obo file, and do not take control of building owl or other derived
files in a obolibrary compliant way. It runs Oort to produce a
standard layout.

The owl2obo method also runs oort.

The vcs method is used when an ontology publishes release and derived
files in a consistent directory structure. It simply checks out the
project and rsyncs the specified subdirectory to the target. Currently
this is git or svn only.

The archive method is used when an ontology publishes the standard
files in a standard structure as an archive file (currently zip only,
but easily extended to tgz). This is currently used for ontologies
that are built via Jenkins, as jenkins publishes targets in a zip
archive.

HISTORY AND COORDINATION WITH OBO-REGISTRY

Historically, the Berkeley obo2owl pipeline consumed the
ontologies.txt file and generated owl for all obo ontologies, using
the "source" or "download" tag. This caused a number of problems - the
same field was used by some legacy applications that could not consume
more "advanced" obo meaning the build pipeline produced owl from
"dumbed down" versions of ontologies.

The ontologies.txt registry method is being overhauled, but there is
still a need for a build pipeline that handles some of the
peculiarities of each ontology, and can handle the many legacy obo
ontologies. In the future every ontology should use oort or a similar
tool to publish the full package, but an interim solution is
required. Even then, some ontologies require a place to distribute
their package (historically VCS has been used as the download
mechanism but this can be slow, and it can be inefficient to manage
multiple derived rdf/xml owl files in a VCS).

Once this new script is in place, the contents of
berkeleybop.org/ontologies/ will be populated using one of the above
methods for each ontology. Each ontology is free to either ignore this
and redirect their purls as they please, or alternatively, point their
purls at the central berkeley location.

The decision to keep the registry as a hash embedded in this script
allows for programmatic configurability, which is good for a lot of
important ontologies that do not yet publish their entire package in a
library-compliant way. In future this script should become less
necessary.

SEE ALSO

This may be a better long term approach for publishing ontologies:

 * http://gitorious.org/ontology-maven-plugins/ninox-maven-plugin

EOM
}


text:
package collate

// Collation of utf8mb4_zh_pinyin_tidb_as_cs
type zhPinyinTiDBASCSCollator struct {
}

// Collator interface, no implements now.
func (py *zhPinyinTiDBASCSCollator) Compare(a, b string) int {
	panic("implement me")
}

// Collator interface, no implements now.
func (py *zhPinyinTiDBASCSCollator) Key(str string) []byte {
	panic("implement me")
}

// Collator interface, no implements now.
func (py *zhPinyinTiDBASCSCollator) Pattern() WildcardPattern {
	panic("implement me")
}


text:
/*
Theme Name: Evolved Child
Description: The Child for Evolved
Author: WP-Evolved
Author URI: https://github.com/wp-evolved/
Version: 1.0.0
Template: evolved-parent-theme
*/

/* File only for displaying theme info in Wordpress. CSS styles are located in this child theme at assets/dist/style.min.css and are compiled from assets/src/scss/ */


text:
#region copyright

/* * * * * * * * * * * * * * * * * * * * * * * * * */
/* Carl Zeiss IMT (IZfM Dresden)                   */
/* Softwaresystem PiWeb                            */
/* (c) Carl Zeiss 2021                             */
/* * * * * * * * * * * * * * * * * * * * * * * * * */

#endregion

namespace Zeiss.PiWeb.Api.Rest.Tests.Contracts
{
	#region usings

	using System;
	using System.Collections.Generic;
	using System.Linq;
	using FluentAssertions;
	using NUnit.Framework;
	using Zeiss.PiWeb.Api.Rest.Contracts;
	using Zeiss.PiWeb.Api.Rest.Dtos;

	#endregion

	[TestFixture]
	public class FeatureMatrixTest
	{
		#region methods

		[Test]
		[TestCase( "1.3", new[] { 1 }, "1.3" )]
		[TestCase( "1.3, 1.5, 2.0, 2.2", new[] { 1 }, "1.5" )]
		[TestCase( "1.3, 1.5, 2.0, 2.2", new[] { 1, 2 }, "2.2" )]
		[TestCase( "1.3, 1.5, 2.0, 2.2", new[] { 2 }, "2.2" )]
		public void Test_GetBestKnownVersion_ReturnsCorrectVersion( string interfaceVersions, int[] supportedMajorVersions, string expectedBestKnownVersion )
		{
			// Given
			var interfaceVersionRange = new InterfaceVersionRange { SupportedVersions = ParseVersions( interfaceVersions ) };
			var expectedVersion = new Version( expectedBestKnownVersion );

			// When
			var bestKnownVersion = FeatureMatrix.GetBestKnownVersion( interfaceVersionRange, supportedMajorVersions );

			// Then
			bestKnownVersion.Should().Be( expectedVersion );
		}

		[Test]
		[TestCase( "1.3", new[] { 2 }, ServerApiNotSupportedReason.VersionsTooLow )]
		[TestCase( "2.0, 2.2", new[] { 1 }, ServerApiNotSupportedReason.VersionsTooHigh )]
		[TestCase( "1.3, 3.2", new[] { 2 }, ServerApiNotSupportedReason.VersionsNotSupported )]
		[TestCase( "", new[] { 1, 2 }, ServerApiNotSupportedReason.VersionsNotSupported )]
		[TestCase( "1.3, 3.2", new int[ 0 ], ServerApiNotSupportedReason.VersionsNotSupported )]
		public void Test_GetBestKnownVersion_ThrowsServerApiNotSupportedException(
			string interfaceVersions,
			int[] supportedMajorVersions,
			ServerApiNotSupportedReason reason )
		{
			// Given
			var interfaceVersionRange = new InterfaceVersionRange { SupportedVersions = ParseVersions( interfaceVersions ) };
			var expectedException = new ServerApiNotSupportedException( interfaceVersionRange, supportedMajorVersions, reason );

			// When
			Action getBestKnownVersion = () => FeatureMatrix.GetBestKnownVersion( interfaceVersionRange, supportedMajorVersions );

			// Then
			getBestKnownVersion.Should().Throw<ServerApiNotSupportedException>()
				.Which.Should().BeEquivalentTo( expectedException, options => options
					.Including( ex => ex.Versions )
					.Including( ex => ex.SupportedMajorVersions )
					.Including( ex => ex.Reason ) );
		}

		private static IEnumerable<Version> ParseVersions( string versionsString )
		{
			var versions = string.IsNullOrEmpty( versionsString )
				? Enumerable.Empty<Version>()
				: versionsString.Split( ',' )
					.Select( versionString => new Version( versionString.Trim() ) );

			return versions;
		}

		#endregion
	}
}


text:
<?php

namespace App\Ship\Parents\Providers;

use Apiato\Core\Abstracts\Providers\MiddlewareProvider as AbstratMiddlewareProvider;

/**
 * Class MiddlewareProvider
 *
 * @author  Mahmoud Zalt  <mahmoud@zalt.me>
 */
abstract class MiddlewareProvider extends AbstratMiddlewareProvider
{

    /**
     * Perform post-registration booting of services.
     */
    public function boot()
    {
        parent::boot();
    }

    /**
     * Register anything in the container.
     */
    public function register()
    {
        parent::register();
    }

}


text:
package org.cinnamon.apps.repository;

import org.cinnamon.apps.domain.Application;
import org.springframework.data.jpa.repository.JpaRepository;

/**
 *
 *
 * created date: 2015. 9. 30.
 * @author 신동성
 */
public interface ApplicationRepository extends JpaRepository<Application, Long> {

}


text:
package org.ini4j.sample;

import java.beans.PropertyChangeListener;
import java.beans.PropertyVetoException;
import java.beans.VetoableChangeListener;

import java.net.URI;

//<editor-fold defaultstate="collapsed" desc="apt documentation">
//|
//|                ---------------
//|                Dwarf interface
//|
//|Dwarf interface
//|
//| This is a very simple bean interface with a few getter and setter. Some of
//| the properties are java primitive types. The <<<homePage>>> property has a
//| complex type (java.net.URI). It is not a problem for \[ini4j\] to do the
//| required type conversion automatically between java.lang.String and the tpye
//| of the given property. The <<<fortuneNumber>>> property is indexed, just to
//| show you may use indexed properties as well.
//|
//</editor-fold>
//{
public interface Dwarf
{
    String PROP_AGE = "age";
    String PROP_FORTUNE_NUMBER = "fortuneNumber";
    String PROP_HEIGHT = "height";
    String PROP_HOME_DIR = "homeDir";
    String PROP_HOME_PAGE = "homePage";
    String PROP_WEIGHT = "weight";

    int getAge();

    void setAge(int age);

    int[] getFortuneNumber();

    void setFortuneNumber(int[] value);

    double getHeight();

    void setHeight(double height) throws PropertyVetoException;

    String getHomeDir();

    void setHomeDir(String dir);

    URI getHomePage();

    void setHomePage(URI location);

    double getWeight();

    void setWeight(double weight);

    void addPropertyChangeListener(String property, PropertyChangeListener listener);

    void addVetoableChangeListener(String property, VetoableChangeListener listener);

    boolean hasAge();

    boolean hasHeight();

    boolean hasHomePage();

    boolean hasWeight();

    void removePropertyChangeListener(String property, PropertyChangeListener listener);

    void removeVetoableChangeListener(String property, VetoableChangeListener listener);
}
//}


text:
package com.javatao.jkami.annotations;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * 注解sql
 *
 * @author tao
 */
@Documented
@Inherited
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.METHOD, ElementType.FIELD })
public @interface Sql {
    /**
     * sql 语句
     *
     * @return sql
     */
    String value();

    /**
     * 强制每次都查询
     *
     * @return true/false
     */
    boolean force() default false;
}


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

       Copyright 2010-2017 the original author or authors.

       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.

-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">

<mapper namespace="org.mybatis.jpetstore.mapper.AccountMapper">

  <cache />

  <select id="getAccountByUsername" resultType="Account">
    SELECT
          SIGNON.USERNAME,
          ACCOUNT.EMAIL,
          ACCOUNT.FIRSTNAME,
          ACCOUNT.LASTNAME,
          ACCOUNT.STATUS,
          ACCOUNT.ADDR1 AS address1,
          ACCOUNT.ADDR2 AS address2,
          ACCOUNT.CITY,
          ACCOUNT.STATE,
          ACCOUNT.ZIP,
          ACCOUNT.COUNTRY,
          ACCOUNT.PHONE,
          PROFILE.LANGPREF AS languagePreference,
          PROFILE.FAVCATEGORY AS favouriteCategoryId,
          PROFILE.MYLISTOPT AS listOption,
          PROFILE.BANNEROPT AS bannerOption,
          BANNERDATA.BANNERNAME
    FROM ACCOUNT, PROFILE, SIGNON, BANNERDATA
    WHERE ACCOUNT.USERID = #{username}
      AND SIGNON.USERNAME = ACCOUNT.USERID
      AND PROFILE.USERID = ACCOUNT.USERID
      AND PROFILE.FAVCATEGORY = BANNERDATA.FAVCATEGORY
  </select>

  <select id="getAccountByUsernameAndPassword" resultType="Account">
    SELECT
      SIGNON.USERNAME,
      ACCOUNT.EMAIL,
      ACCOUNT.FIRSTNAME,
      ACCOUNT.LASTNAME,
      ACCOUNT.STATUS,
      ACCOUNT.ADDR1 AS address1,
      ACCOUNT.ADDR2 AS address2,
      ACCOUNT.CITY,
      ACCOUNT.STATE,
      ACCOUNT.ZIP,
      ACCOUNT.COUNTRY,
      ACCOUNT.PHONE,
      PROFILE.LANGPREF AS languagePreference,
      PROFILE.FAVCATEGORY AS favouriteCategoryId,
      PROFILE.MYLISTOPT AS listOption,
      PROFILE.BANNEROPT AS bannerOption,
      BANNERDATA.BANNERNAME
    FROM ACCOUNT, PROFILE, SIGNON, BANNERDATA
    WHERE ACCOUNT.USERID = #{param1}
      AND SIGNON.PASSWORD = #{param2}
      AND SIGNON.USERNAME = ACCOUNT.USERID
      AND PROFILE.USERID = ACCOUNT.USERID
      AND PROFILE.FAVCATEGORY = BANNERDATA.FAVCATEGORY
  </select>

  <update id="updateAccount" parameterType="Account">
    UPDATE ACCOUNT SET
      EMAIL = #{email},
      FIRSTNAME = #{firstName},
      LASTNAME = #{lastName},
      STATUS = #{status},
      ADDR1 = #{address1},
      ADDR2 = #{address2,jdbcType=VARCHAR},
      CITY = #{city},
      STATE = #{state},
      ZIP = #{zip},
      COUNTRY = #{country},
      PHONE = #{phone}
    WHERE USERID = #{username}
  </update>

  <insert id="insertAccount" parameterType="Account">
    INSERT INTO ACCOUNT
      (EMAIL, FIRSTNAME, LASTNAME, STATUS, ADDR1, ADDR2, CITY, STATE, ZIP, COUNTRY, PHONE, USERID)
    VALUES
      (#{email}, #{firstName}, #{lastName}, #{status}, #{address1},  #{address2,jdbcType=VARCHAR}, #{city}, #{state}, #{zip}, #{country}, #{phone}, #{username})
  </insert>

  <update id="updateProfile" parameterType="Account">
    <bind name="listOptionValue" value="_parameter.isListOption() ? 1 : 0" />
    <bind name="bannerOptionValue" value="_parameter.isBannerOption() ? 1 : 0" />

    UPDATE PROFILE SET
    LANGPREF = #{languagePreference},
    FAVCATEGORY = #{favouriteCategoryId},
    MYLISTOPT = #{listOptionValue},
    BANNEROPT = #{bannerOptionValue}
    WHERE USERID = #{username}
  </update>

  <insert id="insertProfile" parameterType="Account">
    <bind name="listOptionValue" value="_parameter.isListOption() ? 1 : 0" />
    <bind name="bannerOptionValue" value="_parameter.isBannerOption() ? 1 : 0" />

    INSERT INTO PROFILE (LANGPREF, FAVCATEGORY, MYLISTOPT, BANNEROPT, USERID)
    VALUES (#{languagePreference}, #{favouriteCategoryId}, #{listOptionValue}, #{bannerOptionValue}, #{username})
  </insert>

  <update id="updateSignon" parameterType="Account">
    UPDATE SIGNON SET PASSWORD = #{password}
    WHERE USERNAME = #{username}
  </update>

  <insert id="insertSignon" parameterType="Account">
    INSERT INTO SIGNON (PASSWORD,USERNAME)
    VALUES (#{password}, #{username})
  </insert>

</mapper>


text:
{% if role in allowed_admin_roles %}

  {% if display_view == "student_view" %}
  Edit Activity
  {% else %}
  Go to Student View
  {% endif %}

{% endif %}


text:
package model

import "github.com/af83/edwig/logger"

type ModelId string

type ModelInstance interface {
	ObjectIDConsumerInterface

	modelId() ModelId
}

type Model interface {
	Date() Date
	Lines() Lines
	Situations() Situations
	StopAreas() StopAreas
	StopVisits() StopVisits
	VehicleJourneys() VehicleJourneys
	Operators() Operators
}

type MemoryModel struct {
	stopAreas       *MemoryStopAreas
	stopVisits      *MemoryStopVisits
	vehicleJourneys *MemoryVehicleJourneys
	lines           *MemoryLines
	date            Date
	situations      *MemorySituations
	operators       *MemoryOperators

	SMEventsChan chan StopMonitoringBroadcastEvent
	GMEventsChan chan GeneralMessageBroadcastEvent
}

func NewMemoryModel() *MemoryModel {
	model := &MemoryModel{}

	model.date = NewDate(DefaultClock().Now())

	lines := NewMemoryLines()
	lines.model = model
	model.lines = lines

	situations := NewMemorySituations()
	situations.model = model
	model.situations = situations
	model.situations.broadcastEvent = model.broadcastGMEvent

	stopAreas := NewMemoryStopAreas()
	stopAreas.model = model
	model.stopAreas = stopAreas
	model.stopAreas.broadcastEvent = model.broadcastSMEvent

	stopVisits := NewMemoryStopVisits()
	stopVisits.model = model
	model.stopVisits = stopVisits
	model.stopVisits.broadcastEvent = model.broadcastSMEvent

	vehicleJourneys := NewMemoryVehicleJourneys()
	vehicleJourneys.model = model
	model.vehicleJourneys = vehicleJourneys

	operators := NewMemoryOperators()
	operators.model = model
	model.operators = operators

	return model
}

func (model *MemoryModel) SetBroadcastSMChan(broadcastSMEventChan chan StopMonitoringBroadcastEvent) {
	model.SMEventsChan = broadcastSMEventChan
}

func (model *MemoryModel) SetBroadcastGMChan(broadcastGMEventChan chan GeneralMessageBroadcastEvent) {
	model.GMEventsChan = broadcastGMEventChan
}

func (model *MemoryModel) broadcastSMEvent(event StopMonitoringBroadcastEvent) {
	select {
	case model.SMEventsChan <- event:
	default:
		logger.Log.Debugf("BrocasterManager StopMonitoringBroadcastEvent queue is full")
	}
}

func (model *MemoryModel) broadcastGMEvent(event GeneralMessageBroadcastEvent) {
	select {
	case model.GMEventsChan <- event:
	default:
		logger.Log.Debugf("BrocasterManager GeneralMessageBroadcastEvent queue is full")
	}
}

func (model *MemoryModel) Reload(referentialSlug string) *MemoryModel {
	model = NewMemoryModel()
	model.date = NewDate(DefaultClock().Now())
	model.stopAreas.Load(referentialSlug)
	model.lines.Load(referentialSlug)
	model.operators.Load(referentialSlug)
	return model
}

func (model *MemoryModel) Clone() *MemoryModel {
	clone := NewMemoryModel()
	clone.stopAreas = model.stopAreas.Clone(clone)
	clone.lines = model.lines.Clone(clone)
	clone.date = NewDate(DefaultClock().Now())
	return clone
}

func (model *MemoryModel) Date() Date {
	return model.date
}

func (model *MemoryModel) Situations() Situations {
	return model.situations
}

func (model *MemoryModel) StopAreas() StopAreas {
	return model.stopAreas
}

func (model *MemoryModel) StopVisits() StopVisits {
	return model.stopVisits
}

func (model *MemoryModel) VehicleJourneys() VehicleJourneys {
	return model.vehicleJourneys
}

func (model *MemoryModel) Lines() Lines {
	return model.lines
}

func (model *MemoryModel) Operators() Operators {
	return model.operators
}

func (model *MemoryModel) NewTransaction() *Transaction {
	return NewTransaction(model)
}

// TEMP: See what to do with errors
func (model *MemoryModel) Load(referentialSlug string) error {
	err := model.stopAreas.Load(referentialSlug)
	if err != nil {
		logger.Log.Debugf("Error while loading StopAreas: %v", err)
	}
	err = model.lines.Load(referentialSlug)
	if err != nil {
		logger.Log.Debugf("Error while loading Lines: %v", err)
	}
	err = model.vehicleJourneys.Load(referentialSlug)
	if err != nil {
		logger.Log.Debugf("Error while loading VehicleJourneys: %v", err)
	}
	err = model.stopVisits.Load(referentialSlug)
	if err != nil {
		logger.Log.Debugf("Error while loading StopVisits: %v", err)
	}
	err = model.operators.Load(referentialSlug)
	if err != nil {
		logger.Log.Debugf("Error while loading Operators: %v", err)
	}
	return nil
}


text:
""" This file contains defines parameters for nipy that we use to fill
settings in setup.py, the nipy top-level docstring, and for building the
docs.  In setup.py in particular, we exec this file, so it cannot import nipy
"""

# nipy version information.  An empty _version_extra corresponds to a
# full release.  '.dev' as a _version_extra string means this is a development
# version
_version_major = 0
_version_minor = 4
_version_micro = 0
_version_extra = '.dev' # For development
#_version_extra = '' # For release

# Format expected by setup.py and doc/source/conf.py: string of form "X.Y.Z"
__version__ = "%s.%s.%s%s" % (_version_major,
                              _version_minor,
                              _version_micro,
                              _version_extra)

CLASSIFIERS = ["Development Status :: 3 - Alpha",
               "Environment :: Console",
               "Intended Audience :: Science/Research",
               "License :: OSI Approved :: BSD License",
               "Operating System :: OS Independent",
               "Programming Language :: Python",
               "Topic :: Scientific/Engineering"]

description  = 'A python package for analysis of neuroimaging data'

# Note: this long_description is the canonical place to edit this text.
# It also appears in README.rst, but it should get there by running
# ``tools/refresh_readme.py`` which pulls in this version.
long_description = \
"""
====
NIPY
====

Neuroimaging tools for Python.

The aim of NIPY is to produce a platform-independent Python environment for
the analysis of functional brain imaging data using an open development model.

In NIPY we aim to:

1. Provide an open source, mixed language scientific programming environment
   suitable for rapid development.

2. Create software components in this environment to make it easy to develop
   tools for MRI, EEG, PET and other modalities.

3. Create and maintain a wide base of developers to contribute to this
   platform.

4. To maintain and develop this framework as a single, easily installable
   bundle.

NIPY is the work of many people. We list the main authors in the file
``AUTHOR`` in the NIPY distribution, and other contributions in ``THANKS``.

Website
=======

Current information can always be found at the `NIPY project website
<http://nipy.org/nipy>`_.

Mailing Lists
=============

For questions on how to use nipy or on making code contributions, please see
the ``neuroimaging`` mailing list:

    https://mail.python.org/mailman/listinfo/neuroimaging

Please report bugs at github issues:

    https://github.com/nipy/nipy/issues

You can see the list of current proposed changes at:

    https://github.com/nipy/nipy/pulls

Code
====

You can find our sources and single-click downloads:

* `Main repository`_ on Github;
* Documentation_ for all releases and current development tree;
* Download the `current development version`_ as a tar/zip file;
* Downloads of all `available releases`_.

.. _main repository: http://github.com/nipy/nipy
.. _Documentation: http://nipy.org/nipy
.. _current development version: https://github.com/nipy/nipy/archive/master.zip
.. _available releases: http://pypi.python.org/pypi/nipy

Dependencies
============

To run NIPY, you will need:

* python_ >= 2.6 (tested with 2.6, 2.7, 3.2, 3.3, 3.4)
* numpy_ >= 1.6.0
* scipy_ >= 0.9.0
* sympy_ >= 0.7.0
* nibabel_ >= 1.2

You will probably also like to have:

* ipython_ for interactive work
* matplotlib_ for 2D plotting
* mayavi_ for 3D plotting

.. _python: http://python.org
.. _numpy: http://numpy.scipy.org
.. _scipy: http://www.scipy.org
.. _sympy: http://sympy.org
.. _nibabel: http://nipy.org/nibabel
.. _ipython: http://ipython.org
.. _matplotlib: http://matplotlib.org
.. _mayavi: http://code.enthought.com/projects/mayavi/

License
=======

We use the 3-clause BSD license; the full license is in the file ``LICENSE``
in the nipy distribution.
"""

# minimum versions
# Update in readme text above
NUMPY_MIN_VERSION='1.6.0'
SCIPY_MIN_VERSION = '0.9.0'
NIBABEL_MIN_VERSION = '1.2'
SYMPY_MIN_VERSION = '0.7.0'
MAYAVI_MIN_VERSION = '3.0'
CYTHON_MIN_VERSION = '0.12.1'

NAME                = 'nipy'
MAINTAINER          = "nipy developers"
MAINTAINER_EMAIL    = "nipy-devel@neuroimaging.scipy.org"
DESCRIPTION         = description
LONG_DESCRIPTION    = long_description
URL                 = "http://nipy.org/nipy"
DOWNLOAD_URL        = "http://github.com/nipy/nipy/archives/master"
LICENSE             = "BSD license"
CLASSIFIERS         = CLASSIFIERS
AUTHOR              = "nipy developmers"
AUTHOR_EMAIL        = "nipy-devel@neuroimaging.scipy.org"
PLATFORMS           = "OS Independent"
MAJOR               = _version_major
MINOR               = _version_minor
MICRO               = _version_micro
ISRELEASE           = _version_extra == ''
VERSION             = __version__
REQUIRES            = ["numpy", "scipy", "sympy", "nibabel"]
STATUS              = 'beta'

# Versions and locations of optional data packages
NIPY_DATA_URL= 'http://nipy.org/data-packages/'
DATA_PKGS = {'nipy-data': {'min version':'0.2',
                           'relpath':'nipy/data'},
             'nipy-templates': {'min version':'0.2',
                                'relpath':'nipy/templates'}
            }
NIPY_INSTALL_HINT = \
"""You can download and install the package from:

%s

Check the instructions in the ``doc/users/install_data.rst`` file in the nipy
source tree, or online at http://nipy.org/nipy/stable/users/install_data.html

If you have the package, have you set the path to the package correctly?"""

for key, value in DATA_PKGS.items():
    url = '%s%s-%s.tar.gz' % (NIPY_DATA_URL,
                              key,
                              value['min version'])
    value['name'] = key
    value['install hint'] = NIPY_INSTALL_HINT % url

del key, value, url


text:
#ifndef VIX_GAMECONFIG_H
#define VIX_GAMECONFIG_H

#include <vix_platform.h>
#include <vix_noncopy.h>
#include <vix_stringutil.h>
#include <vix_errglobals.h>
#include <vix_tinyxml.h>
#include <vix_sdlwindow.h>

namespace Vixen {

	class VIX_API GameConfig : public INonCopy
	{
	public:
		GameConfig(const UString& path);

		/*Accessors for loaded data*/

		SDL_GW_Params WindowArgs() const;

	private:
		ErrCode       LoadConfig(const UString& path);
		ErrCode       ParseConfig(const XMLDOC& doc);
		SDL_GW_Params ParseWindow(const XMLDOC& doc);

	private:
		SDL_GW_Params m_windowArgs;
		UString       m_path;
	};
}

#endif