text:
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/cloud/dataplex/v1/tasks.proto

package com.google.cloud.dataplex.v1;

public interface JobOrBuilder
    extends
    // @@protoc_insertion_point(interface_extends:google.cloud.dataplex.v1.Job)
    com.google.protobuf.MessageOrBuilder {

  /**
   *
   *
   *

   * Output only. The relative resource name of the job, of the form:
   * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/tasks/{task_id}/jobs/{job_id}`.
   *

   *
   *
   * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... }
   *
   *
   * @return The name.
   */
  java.lang.String getName();
  /**
   *
   *
   *

   * Output only. The relative resource name of the job, of the form:
   * `projects/{project_number}/locations/{location_id}/lakes/{lake_id}/tasks/{task_id}/jobs/{job_id}`.
   *

   *
   *
   * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... }
   *
   *
   * @return The bytes for name.
   */
  com.google.protobuf.ByteString getNameBytes();

  /**
   *
   *
   *

   * Output only. System generated globally unique ID for the job.
   *

   *
   * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
   *
   * @return The uid.
   */
  java.lang.String getUid();
  /**
   *
   *
   *

   * Output only. System generated globally unique ID for the job.
   *

   *
   * string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
   *
   * @return The bytes for uid.
   */
  com.google.protobuf.ByteString getUidBytes();

  /**
   *
   *
   *

   * Output only. The time when the job was started.
   *

   *
   * .google.protobuf.Timestamp start_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
   *
   *
   * @return Whether the startTime field is set.
   */
  boolean hasStartTime();
  /**
   *
   *
   *

   * Output only. The time when the job was started.
   *

   *
   * .google.protobuf.Timestamp start_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
   *
   *
   * @return The startTime.
   */
  com.google.protobuf.Timestamp getStartTime();
  /**
   *
   *
   *

   * Output only. The time when the job was started.
   *

   *
   * .google.protobuf.Timestamp start_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
   *
   */
  com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder();

  /**
   *
   *
   *

   * Output only. The time when the job ended.
   *

   *
   * .google.protobuf.Timestamp end_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
   *
   *
   * @return Whether the endTime field is set.
   */
  boolean hasEndTime();
  /**
   *
   *
   *

   * Output only. The time when the job ended.
   *

   *
   * .google.protobuf.Timestamp end_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
   *
   *
   * @return The endTime.
   */
  com.google.protobuf.Timestamp getEndTime();
  /**
   *
   *
   *

   * Output only. The time when the job ended.
   *

   *
   * .google.protobuf.Timestamp end_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
   *
   */
  com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder();

  /**
   *
   *
   *

   * Output only. Execution state for the job.
   *

   *
   *
   * .google.cloud.dataplex.v1.Job.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
   *
   *
   * @return The enum numeric value on the wire for state.
   */
  int getStateValue();
  /**
   *
   *
   *

   * Output only. Execution state for the job.
   *

   *
   *
   * .google.cloud.dataplex.v1.Job.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
   *
   *
   * @return The state.
   */
  com.google.cloud.dataplex.v1.Job.State getState();

  /**
   *
   *
   *

   * Output only. The number of times the job has been retried (excluding the
   * initial attempt).
   *

   *
   * uint32 retry_count = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
   *
   * @return The retryCount.
   */
  int getRetryCount();

  /**
   *
   *
   *

   * Output only. The underlying service running a job.
   *

   *
   *
   * .google.cloud.dataplex.v1.Job.Service service = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
   *
   *
   * @return The enum numeric value on the wire for service.
   */
  int getServiceValue();
  /**
   *
   *
   *

   * Output only. The underlying service running a job.
   *

   *
   *
   * .google.cloud.dataplex.v1.Job.Service service = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
   *
   *
   * @return The service.
   */
  com.google.cloud.dataplex.v1.Job.Service getService();

  /**
   *
   *
   *

   * Output only. The full resource name for the job run under a particular service.
   *

   *
   * string service_job = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
   *
   * @return The serviceJob.
   */
  java.lang.String getServiceJob();
  /**
   *
   *
   *

   * Output only. The full resource name for the job run under a particular service.
   *

   *
   * string service_job = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
   *
   * @return The bytes for serviceJob.
   */
  com.google.protobuf.ByteString getServiceJobBytes();

  /**
   *
   *
   *

   * Output only. Additional information about the current state.
   *

   *
   * string message = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
   *
   * @return The message.
   */
  java.lang.String getMessage();
  /**
   *
   *
   *

   * Output only. Additional information about the current state.
   *

   *
   * string message = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
   *
   * @return The bytes for message.
   */
  com.google.protobuf.ByteString getMessageBytes();
}


text:
require 'rubygems'
require 'httparty'
require 'digest/md5'
require 'rest_client'

$:.unshift(File.dirname(__FILE__))
require 'oauth_client'
require 'vimeo/simple'
require 'vimeo/advanced'

module Vimeo
end

redpajama_set_name: RedPajamaGithub


text:
The purpose of this ARM Template is **simple Ubuntu Server Virtual Machine** inserting a few parameters.

## The Template

Don't let the size of the template scares you. The structure is very intuitive and once that you get the gist of it, you will see how easier your life will be regarding deploying resources to Azure.

Those are the parameters on the template, most of them are already with the values, the ones that you need to inform are: **adminUsername**, **adminPassword** and **resourceGroup**. All the other parameters will be already informed.

Don't worry about changing anything on the file, either on the portal or using Azure CLI, you need to inform just the following parameters.

- *adminUsername:* Usernames can be a maximum of 20 characters and cannot end in a period (".").

- *adminPassword:* Password requirements between 12 to 72 characters and have lower and upper characters, a digit and a special character (Regex match [\W_])

- *resourceGroup:* The Resource Group that will have your deployment. We go in detail in the next section.

Let's rock with the Deployment.

## Deployment

There are a few ways to deploy your template.
You can use [PowerShell](https://docs.microsoft.com/azure/azure-resource-manager/resource-group-template-deploy), [Azure CLI](https://docs.microsoft.com/azure/azure-resource-manager/resource-group-template-deploy-cli), [Azure Portal](https://docs.microsoft.com/azure/azure-resource-manager/resource-group-template-deploy-portal) or your favorite SDK.

For this task, we going to deploy using Visual Code and the portal and a little surprise for you at the end. :D

For Azure CLI I choose to use the Visual Code with Azure CLI extensions, if you like, you can find more information [here](https://code.visualstudio.com/docs/azure/extensions). But bare in mind that you don't need to use the Visual Code, you can stick with the old good always present **Command Line** on Windows or any **bash terminal**.

### Using Azure CLI with Visual Code

type on the terminal window: **az login**

![Screen](./images/azlogin.png)

You will be redirected to the Azure Portal where you can insert your credentials and log in.

After logged in, you will see your credentials on the terminal.

To set the right subscription, type following command:

#### az account set --subscription "your subscription id"

![Screen](./images/azsetsub.png)

### Resource Group

Now you need a Resource Group for our deployment. If you haven't yet created a Resource Group, you can do it now. If you are new on Azure and wonder what is a Resource Group? Bare with me! A Resource Group is a container that holds related resources for an Azure solution. The resource group includes those resources that you want to manage as a group. Simply saying, it's like a folder that contains files. Simple as that.

To create a Resource Group, you need a name and a location for your Resource Group.

For a list of locations, type: **az account list-locations**

To create the Resource group, type the command:

#### az group create --name "resource-group" --location "your location"

![Screen](./images/azgroup.png)

Super simple, right? Now that you have your **Resource Group** created, let's deploy the Virtual Machine.

#### az group deployment create --name "name of your deployment" --resource-group "resource-group" --template-file "./azuredeploy.json"

![Screen](./images/azdeploy.png)

As you can see, it's running. Go grab a cup of coffee, have some fresh air and I'm sure that before you come back you will have your Virtual Machine ready.

And there we go, the deployment is succeeded:

![Screen](./images/azdeploy2.png)

Let's go and check the resource at the Azure Portal:
Go the Resource Group, find the Resource group you've created.
And there it's your brand new **Virtual Machine**:

Open your Virtual Machine and then click on the button **connect**.

Where you have **Login using VM Local account** copy the ssh command and open your terminal.

![Screen](./images/azdeployportal3.png)

Paste the command and press **Enter**.

Insert the password you've created.

![Screen](./images/azssh.png)

And Voilà, there you have a brandy new Ubuntu Virtual Machine.

![Screen](./images/azubuntu.png)

Have fun!

Once the VM is successfully provisioned, tomcat installation can be verified by accessing the link http://<FQDN name or public IP>:8080/

### Using the Portal

At the Portal, in All Services look for **Templates**, you can favorite this service.

Click in **Add** to add your template:

![Screen](./images/azportal.png)

On General, type a name and a description for your template, and click on [OK].

![Screen](./images/aztemplate.png)

On ARM Template, replace the contents of the template with your template, and click on [OK].

![Screen](./images/aztemplate2.png)

Click on the refresh button and there is your template:

![Screen](./images/aztemplate3.png)

Open the template and click in [Deploy]

On the screen Custom Deployment, insert the information that you must be already familiar with.

Select [I agree] and click on [Purchase].

![Screen](./images/azportaldepoy3.png)

And voilà, you have your new VM deployed.

To connect with the Virtual Machine you can repeat the same process as before, connecting through the terminal.

Now is time to get your hands dirty, don't forget that you are in the cloud :D

Once the VM is successfully provisioned, tomcat installation can be verified by accessing the link http://<FQDN name or public IP>:8080/

**p.s.: Pretty easy to create resources on Azure, right? But if you are the sort of IT guy that always loves automation, here is the surprise. Just click on the button below and it will automatically deploy the VM through the  Azure Portal.**

#### Important disclaimer: Azure charges you for the resources you are using, and you don't want to finish all your credits immediately, right? So, for not running out of credit, don't forget to stop the VM at the portal or even delete the Resource Group you create to avoid any unnecessary charges

### How to shutdown your resources

#### Using the portal

On the portal, open your Resource Group, if you will not use the service or VM anymore, you can just click on the [Delete] Button.

![Screen](./images/off1.png)

You can also just stop the service or the Virtual Machine in case you need the resource. Open the resource and click on Stop.

![Screen](./images/off2.png)

Just refresh your screen and you are good to go.


text:
<?php
namespace Account\Db;

class DbFunctions
{
  /**
   * @param $sql
   * @param $countReturn
   * @return array
   */
  public static function sql($sql, $countReturn = 0)
  {
    $Adapter = MyDbAdapter::getDbAdapter();
    return ($countReturn !== 1)
      ? iterator_to_array($Adapter->query($sql, $Adapter::QUERY_MODE_EXECUTE))
      : $Adapter->query($sql, $Adapter::QUERY_MODE_EXECUTE)->current();
  }

  /**
   * @param $entity String
   * @param int $id
   * @return array
   */
  public static function getEntity($entity, $id = 0)
  {
    $Adapter = MyDbAdapter::getDbAdapter();
    $sql = 'SELECT * FROM users';

    if ($id !== 0) {
      $sql = 'SELECT * FROM ' . $entity . 's WHERE ' . $entity . '_id = ' . $id;
      return $Adapter->query($sql, $Adapter::QUERY_MODE_EXECUTE)->current();
    }
    return iterator_to_array($Adapter->query($sql, $Adapter::QUERY_MODE_EXECUTE));
  }

  /**
   * @param $entity
   * @param $fields
   * @param null $id
   * @return array|\ArrayObject|null
   */
  public static function getFieldEntity($entity, $fields, $id = null)
  {
    $Adapter = MyDbAdapter::getDbAdapter();
    //make fields list
    $sqlField = '';
    if ($fields == null){
      $sqlField = '*';
    } else {
      $arrayCount = count($fields);
      $currentField = 1;
      foreach ($fields AS $field)
      {
        $sqlField .= ($arrayCount != $currentField) ? '`' . $field . '`, ' : '`' . $field . '`';
        ++$currentField;
      }
    }

    $sql = ($id !== null)
      ? 'SELECT ' . $sqlField . ' FROM ' . $entity . 's WHERE ' . $entity . '_id = ' . $id
      : 'SELECT ' . $sqlField . ' FROM ' . $entity . 's';

    if ($id !== null){
      return $Adapter->query($sql, $Adapter::QUERY_MODE_EXECUTE)->current();
    }
    return iterator_to_array($Adapter->query($sql, $Adapter::QUERY_MODE_EXECUTE));
  }

  /**
   * @param $entity String
   * @param $setField String
   * @return mixed
   */
  public static function insertEntity($entity, $setField)
  {
    $Adapter = MyDbAdapter::getDbAdapter();
    $sql = "INSERT INTO " . $entity . "s VALUES (DEFAULT, " . $setField . ")";
    return $Adapter->query($sql, $Adapter::QUERY_MODE_EXECUTE);
  }

  /**
   * @param $name
   * @param $pass
   * @return mixed
   */
  public static function authenticateUser($name, $pass)
  {
    $Adapter = MyDbAdapter::getDbAdapter();
    $sql = "SELECT * FROM `users` "
         . "WHERE user_name = '" . $name . "' "
         . "AND user_pass = '" . $pass . "'";
    $result = $Adapter->query($sql, $Adapter::QUERY_MODE_EXECUTE);
    $row = $result->current();
    if ($row === false){
      return false;
    }
    return $row;
  }
}


text:
<md-card>
    <md-card-title>
        <md-card-title-text>
            News:
        </md-card-title-text>
    </md-card-title>
    <md-card-content layout="column" flex>

                2022-03-15:The platform has a new version at https://v2.laqv-ucibio.info.

                From now on you must use that version!

    </md-card-content>
</md-card>


text:
package com.fonoster.astive.server.test;

import java.io.File;
import junit.framework.TestCase;
import com.fonoster.astive.AstiveException;
import com.fonoster.astive.astivlet.Astivlet;
import com.fonoster.astive.server.AstObj;
import org.eclipse.jetty.toolchain.test.MavenTestingUtils;

/**
 * Test case for {@link com.fonoster.astive.server.AstObj}.
 *
 * @since 1.0
 */
public class AppObjTest extends TestCase {

    /**
     * Creates a new AppObjTest object.
     *
     * @param testName {@inheritDoc}.
     */
    public AppObjTest(String testName) {
        super(testName);
    }

    /**
     * Test method.
     */
    public void testAppObj() throws AstiveException {
        File file = MavenTestingUtils.getProjectFile("/src/test/resources/helloworld.jar");
        AstObj astObj = new AstObj("helloworld.jar", file.getAbsolutePath());
        Astivlet ast = astObj.getAstivletByURLPattern("/examples/HelloWorld");
        assertNotNull(ast);

        ast = astObj.getAstivletByURLPattern("/wha?");
        assertNull(ast);
    }
}


text:
package ru.job4j.search;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

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

import static org.junit.Assert.*;

/**
 * Class to test class Find.
 *
 * @author Tolstonogov Alexey
 * @version 1.0
 */
public class FindTest {
    File parent;
    File file1;
    File file2;
    File file3;
    File dir1;
    File file4;
    File file5;

    /**
     * MyDir/file1.txt
     * MyDir/file2.log
     * MyDir/file3.class
     * MyDir/dir1.txt/file4.log
     * MyDir/dir1.txt/file3.class
     */
    @Before
    public void setBefore() {
        parent = new File(System.getProperty("java.io.tmpdir"), "MyDir");
        file1 = new File(parent, "file1.txt");
        file2 = new File(parent, "file2.log");
        file3 = new File(parent, "file3.class");
        dir1 = new File(parent, "dir1.txt");
        file4 = new File(dir1, "file4.log");
        file5 = new File(dir1, "file3.class");
        try {
            parent.mkdir();
            file1.createNewFile();
            file2.createNewFile();
            file3.createNewFile();
            dir1.mkdir();
            file4.createNewFile();
            file5.createNewFile();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    @After
    public void setAfter() {
        file4.delete();
        file5.delete();
        dir1.delete();
        file1.delete();
        file2.delete();
        file3.delete();
        parent.delete();
    }

    /**
     * Search by name "file3.class":
     *
     * MyDir/file3.class
     * MyDir/dir1.txt/file3.class
     */
    @Test
    public void whenSearchByNameThenResultFilesEqualsName() {
        String[] args = {
                "-d", parent.getPath(),
                "-n", "file3.class",
                "-f",
                "-o", "search.log"};
        List<File> result = new Find().startSearch(args);
        assertTrue(result.size() == 2
                && result.contains(file3)
                && result.contains(file5));
    }

    /**
     * Search by mask "file*.log":
     *
     * MyDir/file1.txt
     */
    @Test
    public void whenSearchByMaskThenResultFilesEqualsMask() {
        String[] args = {
                "-d", parent.getPath(),
                "-n", "file*.log",
                "-m",
                "-o", "search.log"};
        List<File> result = new Find().startSearch(args);
        assertTrue(result.size() == 2
                && result.contains(file2)
                && result.contains(file4));
    }

    /**
     * Search by regular expression "f.*\\.txt$":
     *
     * MyDir/file3.class
     * MyDir/dir1.txt/file3.class
     */
    @Test
    public void whenSearchByRegThenResultFilesEqualsReg() {
        String[] args = {
                "-d", parent.getPath(),
                "-n", "f.*\\.txt$",
                "-r",
                "-o", "search.log"};
        List<File> result = new Find().startSearch(args);
        assertTrue(result.size() == 1
                && result.contains(file1));
    }
}


text:
/* eslint-disable react/no-multi-comp */
import React, { PropTypes } from 'react'
import dateFormat from 'dateformat'

import { TRACK_UNLOCKED } from 'src/core/journal/types'

import { trackTitles } from 'src/constants'

const EntryContent = (props) => {
  const { entry } = props
  const { milestone, type, dateCreated } = entry
  const entryDate = formatDate(dateCreated)

  let header
  if (type === TRACK_UNLOCKED) {
    const { index } = entry
    header = (

          {`Track ${index + 1} unlocked!`}

          {getTrackTitle(index)}

    )
  }

  return (

      { header }

        { milestone }

        { entryDate }

  )
}

function getTrackTitle(index) {
  return trackTitles[index]
}

function formatDate(dateString) {
  const date = new Date(dateString)
  return dateFormat(date, 'mmm dS, yyyy h:MM TT')
}

EntryContent.propTypes = {
  entry: PropTypes.object.isRequired,
}

export default EntryContent


text:
'use strict';

module.exports = function(ngModule) {
  require('./header/header.module')(ngModule);
  require('./example-container/example-container.module')(ngModule);
  require('./mobile-menu/mobile-menu.module')(ngModule);
}


text:
set -e

err_report() {
   >&2 echo "Error -  on line $1 caused a code $2 exit - $3"
   echo "Error -  on line $1 caused a code $2 exit - $3"
}
trap 'err_report $LINENO $? $(basename $0)' ERR

FILE=$1
SOURCE=$2
IGNORE_FILTER=$3
xserv=""

# Loading cfg vars
CFG_PATMAN=${SOURCE}"/config/patman_genome.cfg"
CFG=${SOURCE}"/config/wbench_mirprof.cfg"
. ${SOURCE}"/config/wbench_mirprof.cfg"
. ${SOURCE}"/config/software_dirs.cfg"
. ${SOURCE}"/config/workdirs.cfg"
. ${SOURCE}"/config/term-colors.cfg"
. $CFG_PATMAN

err_report() {
   >&2 echo -e "${red}Error${NC} -  on line $1 caused a code $2 exit"
   echo -e "${red}Error${NC} -  on line $1 caused a code $2 exit"
}
trap 'err_report $LINENO $?' ERR

if [[ $HEADLESS == "TRUE" ]]; then
  xserv=${SOURCE}"/./xvfb-run-safe"
fi

#Rename workdir var because of re-config
WORKDIR=$workdir

printf "\nRan with these vars:\n####################\n#wbench_mirprof.cfg#\n####################\n"
cat $CFG
printf "\n\n"

# define input directory and get input filename(s)
IN_FILE=$(basename ${FILE})
IN_ROOT=${IN_FILE%.*}

GENOME_BASENAME=$(basename ${GENOME})
GENOME_ROOT=${GENOME_BASENAME%.*}
echo $(date +"%y/%m/%d-%H:%M:%S")" -Using ${GENOME_BASENAME} as the reference genome"

# create patman dir and file
FILTER_GENOME=${WORKDIR}/data/"filter_genome/"
mkdir -p ${FILTER_GENOME}

# create output file
OUT_FILT_GENOME=${FILTER_GENOME}${IN_ROOT}"_"${GENOME_ROOT}".fa"
OUT_CONS=${WORKDIR}/data/${IN_ROOT}"_"${GENOME_ROOT}"_mirbase_cons.fa"
OUT_NONCONS=${WORKDIR}/data/${IN_ROOT}"_"${GENOME_ROOT}"_mirbase_noncons.fa"
OUT_REPORT=${FILTER_GENOME}${IN_ROOT}"_${GENOME_ROOT}_REPORT.csv"

MPF_DIR=${WORKDIR}"/data/mirprof/"
mkdir -p ${MPF_DIR}
MPF_FILE=${MPF_DIR}${IN_ROOT}"_"${GENOME_ROOT}"_mirbase"
MPF_FILE_UNIQ=${MPF_DIR}${IN_ROOT}"_"${GENOME_ROOT}"_mirbase.uniq"

echo $(date +"%y/%m/%d-%H:%M:%S")" - ${IN_ROOT} genome filtering"

# align bowtie2 with genome
#bowtie ${GENOME} -f ${FILE} -v 0 --best --al ${OUT_FILT_GENOME} -p ${THREADS} > ${OUT_REPORT}

#Testing if file exists and script has permissions to run it.
testPatman=$(which patman)
echo "testPatman: "$testPatman
checkPatman="TRUE"
command -v patman >/dev/null 2>&1 || { echo "PatMaN required.";checkPatman="FALSE"; }
if [[ -e "$testPatman" && -x "$testPatman" ]]; then

################ADDD IF to skip Patman

	if [[ "${IGNORE_FILTER}" == "TRUE" ]]; then
		##Copy files to genome filter as if they had been filtered
		echo -e "Genome filtering was ignored\n\n" > ${OUT_REPORT}
		cp ${FILE} ${OUT_FILT_GENOME}
	else
		#######################################
		 #Patman command
		 run="patman -D ${GENOME} -e ${EDITS} -P ${FILE} -o ${OUT_REPORT} -g ${GAPS} -p ${PREFETCH}"
		if [[ ${SINGLESTRAND} == "TRUE" ]]; then
			printf $(date +"%y/%m/%d-%H:%M:%S")" - Runnin:qg PatMaN with following command:\n\t${run} -s\n"
			$run -s
		else
		 	printf $(date +"%y/%m/%d-%H:%M:%S")" - Running PatMaN with following command:\n\t${run}\n"
		 	$run
		fi
		#Patman sorting
		awk -F "\t" '{print $2}' ${OUT_REPORT}| sort | uniq | awk -F "[(]" '{ print ">"$0; newline; print $1}' > ${OUT_FILT_GENOME}
	fi
else
 	##This is not printing out to user?? Fix this
 	>&2 echo -e "${red}Error${NC} - PatMaN is no properly installed. Either it is not in path or this script doesn't have permission to run it. If you just installed sRNA-workflow with install script please restart terminal to update path. $0:::Line:$LINENO"
 	exit 127
fi

#Even if patman doesn't find anything this it still makes an empty file.
output_size=$(wc -l ${OUT_REPORT} | awk '{print $1}')
if [[ ${output_size} == 0 ]]; then
	printf "###################\n##   ATTENTION ! ##\n###################\n###################\n"
	printf $(date +"%y/%m/%d-%H:%M:%S")" - Filtering ${IN_ROOT} with genome generated no reads\n\tResults for this library ${IN_ROOT} will be irrelevant from this point on.\n"
	>&2 echo ""
	>&2 echo -e "${red}Attention${NC} - Filtering ${IN_ROOT} with genome generated no reads but program will continue."
	>&2 echo ""
else
	echo $(date +"%y/%m/%d-%H:%M:%S")" - ${IN_ROOT} genome filtered"
fi
echo ""
echo $(date +"%y/%m/%d-%H:%M:%S")" - ${IN_ROOT} mirbase filtering"

# align mirprof
##Don't filter genome activate below (Used for testing or others)
##cp ${FILE} ${OUT_FILT_GENOME}
mismatches=$(echo "${mismatches}" | tr -d '\r' )
only_keep_best=$(echo "${only_keep_best}" | tr -d '\r' )

function runMiRProf {
	#This function runs miRProf
	#runMiRProf [sRNA file] [output file]

	sRNAfile=$1 #${OUT_FILT_GENOME}
	MPF_FILE_FUNC=$2 #${MPF_FILE}
	match=$3

	#Save miRProf files for backtracking
	MPF_FASTA=${MPF_FILE_FUNC/_mirbase/_mirbase_srnas.fa}
	MPF_CSV=${MPF_FILE_FUNC/_mirbase/_mirbase_profile.csv}

	run="${xserv} ${JAVA_DIR}/java -jar ${WBENCH_DIR}/Workbench.jar -tool mirprof -srna_file_list ${sRNAfile} -mirbase_db ${MIRBASE} -out_file ${MPF_FILE_FUNC} -params ${CFG}"
	printf $(date +"%y/%m/%d-%H:%M:%S")" - Ran miRProf with this command: \n\t${run}\n"
	#Run miRProf
	$run

	MPF_FASTA=${MPF_FILE_FUNC/_mirbase/_mirbase_srnas.fa}
	if [[ -e ${MPF_FASTA} ]]; then
		#Create a list of conserved sequences
		grep -v ">" ${MPF_FASTA} > ${MPF_FILE_UNIQ}
		if [[ match -eq 0 ]]; then
			cat ${MPF_FASTA} > ${OUT_CONS}
		else
			cat ${MPF_FASTA} >> ${OUT_CONS}
		fi
	else
		#if there are no results create an empty file to avoid errors. The program can still continue
		#Can still be interesting (Should it warn that no cons sRNAs where found?)
		#For example in fungi there are still few or none sRNA documented.
		touch ${MPF_FILE_UNIQ}
		touch ${OUT_CONS}
	fi

	#Create a file with the sequences that didn't align with miRProf
	OUT_NONCONS_TMP=${OUT_NONCONS/.fa/.tmp}
	grep -wvf ${MPF_FILE_UNIQ} ${sRNAfile} > ${OUT_NONCONS_TMP}
	mv ${OUT_NONCONS_TMP} ${OUT_NONCONS}

	if [[ -e ${MPF_FASTA} ]]; then
		#If files already exist save them with the appropriate number of mismatches
		mv ${MPF_FILE_UNIQ} ${MPF_FILE_UNIQ/_mirbase/_mismatch${match}_mirbase}
		mv ${MPF_FASTA} ${MPF_FASTA/_mirbase_/_mismatch${match}_mirbase_}
		mv ${MPF_CSV} ${MPF_CSV/_mirbase_/_mismatch${match}_mirbase_}
	fi

}

function combineMir {
	# Function to aggregate miRNAs that were identified more than once due to mismatches
	#
	MPF_CONS=$1

	#needed to parse the headers, spaces all split of strings into diff vars.
        sed -ri "s:>all combined:>all_combined:g" ${MPF_CONS}
        #list of sequences that appear more then once in the list of conserved miR
        duplicateSeqs=$(grep -v ">" ${MPF_CONS} | sort | uniq -c | sort | awk '{if($1 > 1){print $2}}' | tr -s "\r\n" " " )
        for seq in $duplicateSeqs; do
                #Removal of the sequences that repeat
		headers_del=$(grep -wB1 "${seq}" ${MPF_CONS} | sed /--/d | sed /$seq/d)
		headers_add=$(grep -wB1 "${seq}" ${MPF_CONS} | sed /--/d | sed /$seq/d | awk -F "mir" '{print $2}')
		echo $headers_del
		for header in $headers_del; do
			sed -i /^$header$/d ${MPF_CONS}
		done
		sed -i /^$seq$/d ${MPF_CONS}
		#Reintroduction of combined header sequences
		printf ">all combined-mir"$(echo ${headers_add} | sed -r "s:_Abundance\([0-9]+\) :|:g")"\n${seq}\n" >> ${MPF_CONS}
		printf ">all combined-mir"$(echo ${headers_add} | sed -r "s:_Abundance\([0-9]+\) :|:g")"\n${seq}\n"
	done
        sed -ri "s:>all_combined:>all combined:g" ${MPF_CONS}
}

if [[ ${mismatches} -eq 0 ]]; then
	runMiRProf ${OUT_FILT_GENOME} ${MPF_FILE} 0
else
	if [[ ${only_keep_best} == "true" ]]; then
		#Run with mismatch 0
		i=0
		sed -ri "s:^(mismatches=)[0-9]+:\1$i:g" ${CFG}
		runMiRProf ${OUT_FILT_GENOME} ${MPF_FILE} ${i}

		max=0
		if [[ ${mismatches} -gt 3 ]]; then
			printf $(date +"%y/%m/%d-%H:%M:%S")" - Max mismatches is 3. Mismatches have been set to 3. \n"
			max=3
		else
			max=${mismatches}
		fi

		for (( i=1; i<=${max}; i++ ));do

			#Change the mismatch in config file
			sed -ri "s:^(mismatches=)[0-9]+:\1$i:g" ${CFG}

			runMiRProf ${OUT_NONCONS} ${MPF_FILE} ${i}
			#now deal with multiple families.
			#1)- miR156_x|157_x_abundance(xx)
			# Merged header for the same sequence
			#
			# Build a by family merger in something other then R. Bash or Python if simpler
			#2)- Only miR156_x|157_x_abundance(xx) but for that I would have to parse the hole thing to merge all that are of a single family
		done
		combineMir ${OUT_CONS}
	else
		runMiRProf ${OUT_FILT_GENOME} ${MPF_FILE} ${mismatches}
	fi
fi

echo $(date +"%y/%m/%d-%H:%M:%S")" - ${IN_ROOT} mirbase filtered"

exit 0


text:
#region copyright
// Copyright 2017 Habart Thierry
//
// 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.
#endregion

namespace SimpleIdentityServer.EF.Models
{
    public enum SecretTypes
    {
        SharedSecret,
        X509Thumbprint,
        X509Name
    }

    public class ClientSecret
    {
        public string Id { get; set; }
        public SecretTypes Type { get; set; }
        public string Value { get; set; }
        public string ClientId { get; set; }
        public virtual Client Client { get; set; }
    }
}


text:
.class Lcom/android/server/AppOpsService$2;
.super Ljava/lang/Object;
.source "AppOpsService.java"

# interfaces
.implements Landroid/os/storage/MountServiceInternal$ExternalStorageMountPolicy;

# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/android/server/AppOpsService;->systemReady()V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation

# instance fields
.field final synthetic this$0:Lcom/android/server/AppOpsService;

# direct methods
.method constructor <init>(Lcom/android/server/AppOpsService;)V
    .locals 0
    .param p1, "this$0"    # Lcom/android/server/AppOpsService;

    .prologue
    .line 292
    iput-object p1, p0, Lcom/android/server/AppOpsService$2;->this$0:Lcom/android/server/AppOpsService;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

# virtual methods
.method public getMountMode(ILjava/lang/String;)I
    .locals 3
    .param p1, "uid"    # I
    .param p2, "packageName"    # Ljava/lang/String;

    .prologue
    const/4 v2, 0x0

    .line 295
    invoke-static {p1}, Landroid/os/Process;->isIsolated(I)Z

    move-result v0

    if-eqz v0, :cond_0

    .line 296
    return v2

    .line 298
    :cond_0
    iget-object v0, p0, Lcom/android/server/AppOpsService$2;->this$0:Lcom/android/server/AppOpsService;

    const/16 v1, 0x3b

    invoke-virtual {v0, v1, p1, p2}, Lcom/android/server/AppOpsService;->noteOperation(IILjava/lang/String;)I

    move-result v0

    if-eqz v0, :cond_1

    .line 300
    return v2

    .line 302
    :cond_1
    iget-object v0, p0, Lcom/android/server/AppOpsService$2;->this$0:Lcom/android/server/AppOpsService;

    const/16 v1, 0x3c

    invoke-virtual {v0, v1, p1, p2}, Lcom/android/server/AppOpsService;->noteOperation(IILjava/lang/String;)I

    move-result v0

    if-eqz v0, :cond_2

    .line 304
    const/4 v0, 0x2

    return v0

    .line 306
    :cond_2
    const/4 v0, 0x3

    return v0
.end method

.method public hasExternalStorage(ILjava/lang/String;)Z
    .locals 3
    .param p1, "uid"    # I
    .param p2, "packageName"    # Ljava/lang/String;

    .prologue
    const/4 v1, 0x1

    .line 311
    invoke-virtual {p0, p1, p2}, Lcom/android/server/AppOpsService$2;->getMountMode(ILjava/lang/String;)I

    move-result v0

    .line 312
    .local v0, "mountMode":I
    const/4 v2, 0x2

    if-eq v0, v2, :cond_0

    .line 313
    const/4 v2, 0x3

    if-ne v0, v2, :cond_1

    .line 312
    :cond_0
    :goto_0
    return v1

    .line 313
    :cond_1
    const/4 v1, 0x0

    goto :goto_0
.end method


text:
package com.baomidou.mybatisplus.test.sqlrunner;

import lombok.Data;

/**
 * @author miemie
 * @since 2021-03-16
 */
@Data
public class Entity {

    private Long id;

    private String name;
}


text:
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements.  The ASF licenses this file to You
* 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.
*/
package org.apache.jackrabbit.webdav.client.methods;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.jackrabbit.webdav.DavMethods;
import org.apache.jackrabbit.webdav.DavServletResponse;
import org.apache.jackrabbit.webdav.observation.ObservationConstants;

/**
 * UnSubscribeMethod...
 */
public class UnSubscribeMethod extends DavMethodBase {

    private static Logger log = LoggerFactory.getLogger(UnSubscribeMethod.class);

    public UnSubscribeMethod(String uri, String subscriptionId) {
        super(uri);
        setRequestHeader(ObservationConstants.HEADER_SUBSCRIPTIONID, subscriptionId);
    }

    //---------------------------------------------------------< HttpMethod >---
    @Override
    public String getName() {
        return DavMethods.METHOD_UNSUBSCRIBE;
    }

    //------------------------------------------------------< DavMethodBase >---
    @Override
    protected boolean isSuccess(int statusCode) {
        return DavServletResponse.SC_NO_CONTENT == statusCode;
    }
}


text:
Login and Pay with Amazon API Integration

## Requirements

* Login and Pay With Amazon account - [Register here](https://payments.amazon.com/signup)
* PHP 5.3 or higher
* Curl 7.18 or higher

## Documentation

* The Integration steps can be found [here](https://payments.amazon.com/documentation)

## Sample

* View the sample integration demo [here](https://amzn.github.io/login-and-pay-with-amazon-sdk-samples/)

## Quick Start

Instantiating the client:
Client Takes in parameters in the following format

1. Associative array
2. Path to the JSON file containing configuration information.

## Installing using Composer
```
composer create-project amzn/login-and-pay-with-amazon-sdk-php --prefer-dist
```
## Directory Tree
```
.
├── composer.json - Configuration for composer
├── LICENSE.txt
├── NOTICE.txt
├── PayWithAmazon
│   ├── Client.php - Main class with the API calls
│   ├── HttpCurl.php -  Client class uses this file to execute the GET/POST
│   ├── Interface.php - Shows the public function definitions in the Client.php
│   ├── IpnHandler.php - Class handles verification of the IPN
│   ├── Regions.php -  Defines the regions that is supported
│   └── ResponseParser.php -  Parses the API call response
├── README.md
└── UnitTests
    ├── ClientTest.php
    ├── config.json
    ├── coverage.txt
    ├── IpnHandlerTest.php
    └── Signature.php
```
##Parameters List

####Mandatory Parameters
| Parameter    | variable name | Values          				|
|--------------|---------------|------------------------------------------------|
| Merchant Id  | `merchant_id` | Default : `null`				|
| Access Key   | `access_key`  | Default : `null`				|
| Secret Key   | `secret_key`  | Default : `null`				|
| Region       | `region`      | Default : `null`
Other: `us`,`de`,`uk`,`jp`	|

####Optional Parameters
| Parameter           | Variable name         | Values                                      	   |
|---------------------|-----------------------|----------------------------------------------------|
| Currency Code       | `currency_code`       | Default : `null`
Other: `USD`,`EUR`,`GBP`,`JPY` |
| Environment         | `sandbox`             | Default : `false`
Other: `true`	    	   |
| Platform ID         | `platform_id`         | Default : `null` 			    	   |
| CA Bundle File      | `cabundle_file`       | Default : `null`			    	   |
| Application Name    | `application_name`    | Default : `null`			    	   |
| Application Version | `application_version` | Default : `null`			    	   |
| Proxy Host          | `proxy_host`          | Default : `null`			    	   |
| Proxy Port          | `proxy_port`          | Default : `-1`  			    	   |
| Proxy Username      | `proxy_username`      | Default : `null`			    	   |
| Proxy Password      | `proxy_password`      | Default : `null`			    	   |
| LWA Client ID       | `client_id`           | Default : `null`			    	   |
| Handle Throttle     | `handle_throttle`     | Default : `true`
Other: `false`	    	   |

## Setting Configuration

Setting configuration while instantiating the Client object
```php
<?php
namespace PayWithAmazon;

require_once 'Client.php';
// Your Login and Pay with Amazon keys are available in your Seller Central account

// PHP Associative array
$config = array('merchant_id' => 'YOUR_MERCHANT_ID',
                'access_key'  => 'YOUR_ACCESS_KEY',
                'secret_key'  => 'YOUR_SECRET_KEY',
                'client_id'   => 'YOUR_LOGIN_WITH_AMAZON_CLIENT_ID',
                'region'      => 'REGION');

// JSON file path
$config = 'PATH_TO_JSON_FILE';

// Instantiate the client class with the config type
$client = new Client($config);
```
### Testing in Sandbox Mode

The sandbox parameter is defaulted to false if not specified:
```php
<?php
namespace PayWithAmazon;

$config = array('merchant_id'   => 'YOUR_MERCHANT_ID',
                'access_key'    => 'YOUR_ACCESS_KEY',
                'secret_key'    => 'YOUR_SECRET_KEY',
                'client_id'     => 'YOUR_LOGIN_WITH_AMAZON_CLIENT_ID',
                'region'     	=> 'REGION',
                'sandbox'       => true );

$client = new Client($config);

// Also you can set the sandbox variable in the config() array of the Client class by

$client->setSandbox(true);
```
### Setting Proxy values
Proxy parameters can be set after Instantiating the Client Object with the following setter
```php
$proxy =  array();
$proxy['proxy_user_host'] // Hostname for the proxy
$proxy['proxy_user_port'] // Hostname for the proxy
$proxy['proxy_user_name'] // If your proxy requires a username
$proxy['proxy_user_password'] // If your proxy requires a password

$client->setProxy($proxy);
```

### Making an API Call

Below is an example on how to make the GetOrderReferenceDetails API call:

```php
<?php
namespace PayWithAmazon;

$requestParameters = array();

// AMAZON_ORDER_REFERENCE_ID is obtained from the Pay with Amazon Address/Wallet widgets
// ACCESS_TOKEN is obtained from the GET parameter from the URL.

// Required Parameter
$requestParameters['amazon_order_reference_id'] = 'AMAZON_ORDER_REFERENCE_ID';

// Optional Parameter
$requestParameters['address_consent_token']     = 'ACCESS_TOKEN';
$requestParameters['mws_auth_token']            = 'MWS_AUTH_TOKEN';

$response = $client->getOrderReferenceDetails($requestParameters);

```
See the [API Response](https://github.com/amzn/login-and-pay-with-amazon-sdk-php#api-response) section for information on parsing the API response.

### IPN Handling

1. To receive IPN's successfully you will need an valid SSL on your domain.
2. You can set up your Notification endpoints in Seller Central by accessing the Integration Settings page in the Settings tab.
3. IpnHandler.php class handles verification of the source and the data of the IPN

Add the below code into any file and set the URL to the file location in Merchant/Integrator URL by accessing Integration Settings page in the Settings tab.

```php
<?php
namespace PayWithAmazon;

require_once 'IpnHandler.php';

// Get the IPN headers and Message body
$headers    = getallheaders();
$body       = file_get_contents('php://input');

// Create an object($ipnHandler) of the IpnHandler class
$ipnHandler = new IpnHandler($headers, $body);

```
See the [IPN Response](https://github.com/amzn/login-and-pay-with-amazon-sdk-php#ipn-response) section for information on parsing the IPN response.

### Convenience Methods

#####Charge Method

The charge method combines the following API calls:

**Standard Payments / Recurring Payments**

1. SetOrderReferenceDetails / SetBillingAgreementDetails
2. ConfirmOrderReference / ConfirmBillingAgreement
3. Authorize / AuthorizeOnBillingAgreement

For **Standard payments** the first `charge` call will make the SetOrderReferenceDetails, ConfirmOrderReference, Authorize API calls.
Subsequent call to `charge` method for the same Order Reference ID will make the call only to Authorize.

For **Recurring payments** the first `charge` call will make the SetBillingAgreementDetails, ConfirmBillingAgreement, AuthorizeOnBillingAgreement API calls.
Subsequent call to `charge` method for the same Billing Agreement ID will make the call only to AuthorizeOnBillingAgreement.

> **Capture Now** can be set to `true` for digital goods . For Physical goods it's highly recommended to set the Capture Now to `false`
and the amount captured by making the `capture` API call after the shipment is complete.

| Parameter                  | Variable Name                | Mandatory | Values                                                                                |
|----------------------------|------------------------------|-----------|-----------------------------------------------------------------------------------------------------------|
| Amazon Reference ID 	     | `amazon_reference_id` 	    | yes       | OrderReference ID (`starts with P01 or S01`) or
Billing Agreement ID (`starts with B01 or C01`)       |
| Amazon OrderReference ID   | `amazon_order_reference_id`  | no        | OrderReference ID (`starts with P01 or S01`) if no Amazon Reference ID is provided                        |
| Amazon Billing Agreement ID| `amazon_billing_agreement_id`| no        | Billing Agreement ID (`starts with B01 or C01`) if no Amazon Reference ID is provided                     |
| Merchant ID         	     | `merchant_id`         	    | no        | Value taken from config array in Client.php                                                               |
| Charge Amount       	     | `charge_amount`       	    | yes       | Amount that needs to be captured.
Maps to API call variables `amount` , `authorization_amount`         |
| Currency code       	     | `currency_code`       	    | no        | If no value is provided, value is taken from the config array in Client.php      		            |
| Authorization Reference ID | `authorization_reference_id` | yes       | Unique string to be passed									            |
| Transaction Timeout 	     | `transaction_timeout`        | no        | Timeout for Authorization - Defaults to 1440 minutes						            |
| Capture Now	             | `capture_now`                | no        | Will capture the payment automatically when set to `true`. Defaults to `false`						                                            |
| Charge Note         	     | `charge_note`         	    | no        | Note that is sent to the buyer.
Maps to API call variables `seller_note` , `seller_authorization_note`|
| Charge Order ID     	     | `charge_order_id`     	    | no        | Custom order ID provided
Maps to API call variables `seller_order_id` , `seller_billing_agreement_id` |
| Store Name          	     | `store_name`          	    | no        | Name of the store                                                                                |
| Platform ID         	     | `platform_id`         	    | no        | Platform ID of the Solution provider                                                                      |
| Custom Information  	     | `custom_information`  	    | no        | Any custom string                                                                                |
| MWS Auth Token      	     | `mws_auth_token`      	    | no        | MWS Auth Token required if API call is made on behalf of the seller                                       |

```php
// Create an array that will contain the parameters for the charge API call
$requestParameters = array();

// Adding the parameters values to the respective keys in the array
$requestParameters['amazon_reference_id'] = 'AMAZON_REFERENCE_ID';

// Or
// If $requestParameters['amazon_reference_id'] is not provided,
// either one of the following ID input is needed
$requestParameters['amazon_order_reference_id']   = 'AMAZON_ORDER_REFERENCE_ID';
$requestParameters['amazon_billing_agreement_id'] = 'AMAZON_BILLING_AGREEMENT_ID';

$requestParameters['seller_id'] = null;
$requestParameters['charge_amount'] = '100.50';
$requestParameters['currency_code'] = 'USD';
$requestParameters['authorization_reference_id'] = 'UNIQUE STRING';
$requestParameters['transaction_timeout'] = 0;
$requestParameters['capture_now'] = false; //`true` for Digital goods
$requestParameters['charge_note'] = 'Example item note';
$requestParameters['charge_order_id'] = '1234-Example-Order';
$requestParameters['store_name'] = 'Example Store';
$requestParameters['platform_Id'] = null;
$requestParameters['custom_information'] = 'Any_Custom_String';
$requestParameters['mws_auth_token'] = null;

// Get the Authorization response from the charge method
$response = $client->charge($requestParameters);
```
See the [API Response](https://github.com/amzn/login-and-pay-with-amazon-sdk-php#api-response) section for information on parsing the API response.

#####Obtain profile information (getUserInfo method)
1. obtains the user's profile information from Amazon using the access token returned by the Button widget.
2. An access token is granted by the authorization server when a user logs in to a site.
3. An access token is specific to a client, a user, and an access scope. A client must use an access token to retrieve customer profile data.

| Parameter           | Variable Name         | Mandatory | Values                                                                       	     |
|---------------------|-----------------------|-----------|------------------------------------------------------------------------------------------|
| Access Token        | `access_token`        | yes       | Retrieved as GET parameter from the URL                                      	     |
| Region              | `region`              | yes       | Default :`null`
Other:`us`,`de`,`uk`,`jp`
Value is set in config['region'] array |
| LWA Client ID       | `client_id`           | yes       | Default: null
Value should be set in config array                        	     |

```php
<?php namespace PayWithAmazon;

// config array parameters that need to be instantiated
$config = array('client_id' => 'YOUR_LWA_CLIENT_ID',
                'region'    => 'REGION' );

$client = new Client($config);

// Client ID can also be set using the setter function setClientId($client_id)
$client->setClientId('YOUR_LWA_CLIENT_ID');

// Get the Access Token from the URL
$access_token = 'ACCESS_TOKEN';
// Calling the function getUserInfo with the access token parameter returns object
$userInfo = $client->getUserInfo($access_token);

// Buyer name
$userInfo['name'];
// Buyer Email
$userInfo['email'];
// Buyer User Id
$userInfo['user_id'];
```
### Response Parsing

Responses are provided in 3 formats

1. XML/Raw response
2. Associative array
3. JSON format

#####API Response
```php
// Returns an object($response) of the class ResponseParser.php
$response = $client->getOrderReferenceDetails($requestParameters);

// XML response
$response->toXml();

// Associative array response
$response->toArray();

// JSON response
$response->toJson();
```

#####IPN Response
```php
$ipnHandler = new IpnHandler($headers, $body);

// Raw message response
$ipnHandler->returnMessage();

// Associative array response
$ipnHandler->toArray();

// JSON response
$ipnHandler->toJson();
```


text:
namespace crazy {

class LibraryList;
class LibraryView;

// A class that models a shared library loaded by the crazy linker.

// Libraries have dependencies (which are listed in their dynamic section
// as DT_NEEDED entries). Circular dependencies are forbidden, so they
// form an ADG, where the root is the crazy linker itself, since all
// libraries that it loads will depend on it (to ensure their
// dlopen/dlsym/dlclose calls are properly wrapped).

class SharedLibrary {
 public:
  SharedLibrary();
  ~SharedLibrary();

  size_t load_address() const { return view_.load_address(); }
  size_t load_size() const { return view_.load_size(); }
  size_t load_bias() const { return view_.load_bias(); }
  const ELF::Phdr* phdr() const { return view_.phdr(); }
  size_t phdr_count() const { return view_.phdr_count(); }
  const char* base_name() const { return base_name_; }

  // Load a library (without its dependents) from an ELF file.
  // Note: This does not apply relocations, nor runs constructors.
  // |full_path| if the file full path.
  // |load_address| is the page-aligned load address in memory, or 0.
  // |file_offset| is the page-aligned file offset.
  // On failure, return false and set |error| message.
  //
  // After this, the caller should load all library dependencies,
  // Then call Relocate() and CallConstructors() to complete the
  // operation.
  bool Load(const char* full_path,
            size_t load_address,
            size_t file_offset,
            Error* error);

  // Relocate this library, assuming all its dependencies are already
  // loaded in |lib_list|. On failure, return false and set |error|
  // message.
  bool Relocate(LibraryList* lib_list,
                Vector<LibraryView*>* dependencies,
                Error* error);

  void GetInfo(size_t* load_address,
               size_t* load_size,
               size_t* relro_start,
               size_t* relro_size) {
    *load_address = view_.load_address();
    *load_size = view_.load_size();
    *relro_start = relro_start_;
    *relro_size = relro_size_;
  }

  // Returns true iff a given library is mapped to a virtual address range
  // that contains a given address.
  bool ContainsAddress(void* address) const {
    size_t addr = reinterpret_cast<size_t>(address);
    return load_address() <= addr && addr <= load_address() + load_size();
  }

  // Call all constructors in the library.
  void CallConstructors();

  // Call all destructors in the library.
  void CallDestructors();

  // Return the ELF symbol entry for a given symbol, if defined by
  // this library, or NULL otherwise.
  const ELF::Sym* LookupSymbolEntry(const char* symbol_name);

  // Find the nearest symbol near a given |address|. On success, return
  // true and set |*sym_name| to the symbol name, |*sym_addr| to its address
  // in memory, and |*sym_size| to its size in bytes, if any.
  bool FindNearestSymbolForAddress(void* address,
                                   const char** sym_name,
                                   void** sym_addr,
                                   size_t* sym_size) {
    return symbols_.LookupNearestByAddress(
        address, load_bias(), sym_name, sym_addr, sym_size);
  }

  // Return the address of a given |symbol_name| if it is exported
  // by the library, NULL otherwise.
  void* FindAddressForSymbol(const char* symbol_name);

  // Create a new Ashmem region holding a copy of the library's RELRO section,
  // potentially relocated for a new |load_address|. On success, return true
  // and sets |*relro_start|, |*relro_size| and |*relro_fd|. Note that the
  // RELRO start address is adjusted for |load_address|, and that the caller
  // becomes the owner of |*relro_fd|. On failure, return false and set
  // |error| message.
  bool CreateSharedRelro(size_t load_address,
                         size_t* relro_start,
                         size_t* relro_size,
                         int* relro_fd,
                         Error* error);

  // Try to use a shared relro section from another process.
  // On success, return true. On failure return false and
  // sets |error| message.
  bool UseSharedRelro(size_t relro_start,
                      size_t relro_size,
                      int relro_fd,
                      Error* error);

  // Look for a symbol named 'JNI_OnLoad' in this library, and if it
  // exists, call it with |java_vm| as the first parameter. If the
  // function result is less than |minimum_jni_version|, fail with
  // a message in |error|. On success, return true, and record
  // |java_vm| to call 'JNI_OnUnload' at unload time, if present.
  bool SetJavaVM(void* java_vm, int minimum_jni_version, Error* error);

  // Call 'JNI_OnUnload()' is necessary, i.e. if there was a succesful call
  // to SetJavaVM() before. This will pass the same |java_vm| value to the
  // callback, if it is present in the library.
  void CallJniOnUnload();

  // Helper class to iterate over dependencies in a given SharedLibrary.
  // Usage:
  //    SharedLibary::DependencyIterator iter(lib);
  //    while (iter.GetNext() {
  //      dependency_name = iter.GetName();
  //      ...
  //    }
  class DependencyIterator {
   public:
    DependencyIterator(SharedLibrary* lib)
        : iter_(&lib->view_), symbols_(&lib->symbols_), dep_name_(NULL) {}

    bool GetNext();

    const char* GetName() const { return dep_name_; }

   private:
    DependencyIterator();
    DependencyIterator(const DependencyIterator&);
    DependencyIterator& operator=(const DependencyIterator&);

    ElfView::DynamicIterator iter_;
    const ElfSymbols* symbols_;
    const char* dep_name_;
  };

  typedef void (*linker_function_t)();

 private:
  friend class LibraryList;

  ElfView view_;
  ElfSymbols symbols_;

  ELF::Addr relro_start_;
  ELF::Addr relro_size_;
  bool relro_used_;

  SharedLibrary* list_next_;
  SharedLibrary* list_prev_;
  unsigned flags_;

  linker_function_t* preinit_array_;
  size_t preinit_array_count_;
  linker_function_t* init_array_;
  size_t init_array_count_;
  linker_function_t* fini_array_;
  size_t fini_array_count_;
  linker_function_t init_func_;
  linker_function_t fini_func_;

#ifdef __arm__
  // ARM EABI section used for stack unwinding.
  unsigned* arm_exidx_;
  size_t arm_exidx_count_;

  // ARM packed relocations data, NULL if absent.
  uint8_t* arm_packed_relocs_;
#endif

  link_map_t link_map_;

  bool has_DT_SYMBOLIC_;

  void* java_vm_;

  const char* base_name_;
  char full_path_[512];
};

}  // namespace crazy

#endif  // CRAZY_LINKER_SHARED_LIBRARY_H


text:
package org.xlcloud.ssh.mojo;

/**
 * Class representing connection configuration
 *
 * @author Michał Kamiński, AMG.net
 */
public class Connection {

    private String user;

    private String host;

    private String password;

    /**
     * Gets the value of {@link #user}.
     *
     * @return value of {@link #user}
     */
    public String getUser() {
        return user;
    }

    /**
     * Sets the value of {@link #user}.
     *
     * @param user
     *            - value
     */
    public void setUser(String user) {
        this.user = user;
    }

    /**
     * Gets the value of {@link #host}.
     *
     * @return value of {@link #host}
     */
    public String getHost() {
        return host;
    }

    /**
     * Sets the value of {@link #host}.
     *
     * @param host
     *            - value
     */
    public void setHost(String host) {
        this.host = host;
    }

    /**
     * Gets the value of {@link #password}.
     *
     * @return value of {@link #password}
     */
    public String getPassword() {
        return password;
    }

    /**
     * Sets the value of {@link #password}.
     *
     * @param password
     *            - value
     */
    public void setPassword(String password) {
        this.password = password;
    }

}


text:
"""NDG XACML data fetch by URL utility

NERC DataGrid
"""
__author__ = "R B Wilkinson"
__date__ = "03/11/11"
__copyright__ = "(C) 2011 Science and Technology Facilities Council"
__contact__ = "Philip.Kershaw@stfc.ac.uk"
__license__ = "BSD - see LICENSE file in top-level directory"
__contact__ = "Philip.Kershaw@stfc.ac.uk"
__revision__ = "$Id$"
import logging
import os
import urllib2
import urlparse

log = logging.getLogger(__name__)

def fetch_stream_from_url(url, debug=False):
    """Returns data retrieved from a URL.
    @param url: URL to attempt to open
    @type: str
    @param debug: debug flag for urllib2
    @type: bool
    @return: data retrieved from URL or None
    @rtype: file derived type
    """
    response = open_url(url, debug)
    return response

def fetch_data_from_url(url, debug=False):
    """Returns data retrieved from a URL.
    @param url: URL to attempt to open
    @type: str
    @param debug: debug flag for urllib2
    @type: bool
    @return: data retrieved from URL or None
    @rtype: str
    """
    response = open_url(url, debug)
    return_data = response.read()
    response.close()
    return return_data

def open_url(url, debug=False):
    """Attempts to open a connection to a specified URL.
    @param url: URL to attempt to open
    @type: str
    @param debug: debug flag for urllib2
    @type: bool
    @return: tuple (
    @rtype: tuple (
        int: returned HTTP status code or 0 if an error occurred
        str: returned message or error description
        file-like: response object
    )
    """
    debuglevel = 1 if debug else 0

    # Set up handlers for URL opener.
    http_handler = urllib2.HTTPHandler(debuglevel=debuglevel)

    handlers = [http_handler]

    # Explicitly remove proxy handling if the host is one listed in the value of
    # the no_proxy environment variable because urllib2 does use proxy settings
    # set via http_proxy and https_proxy, but does not take the no_proxy value
    # into account.
    if not _should_use_proxy(url):
        handlers.append(urllib2.ProxyHandler({}))
        log.debug("Not using proxy")

    opener = urllib2.build_opener(*handlers)

    # Open the URL and check the response.
    try:
        response = opener.open(url)
    except urllib2.HTTPError, exc:
        # Re-raise as simple exception
        raise Exception(exc.__str__())
    return response

def _should_use_proxy(url):
    """Determines whether a proxy should be used to open a connection to the
    specified URL, based on the value of the no_proxy environment variable.
    @param url: URL
    @type: str
    @return: flag indicating whether proxy should be used
    @rtype: bool
    """
    no_proxy   = os.environ.get('no_proxy', '')

    urlObj = urlparse.urlparse(url)
    for np in [h.strip() for h in no_proxy.split(',')]:
        if urlObj.hostname == np:
            return False

    return True


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></meta>

<title>AbacusUtil</title>

<link href="./css/css" rel="stylesheet" type="text/css"></link>
<link href="./css/css(1)" rel="stylesheet" type="text/css"></link>
<link rel="stylesheet" href="./css/syntax.css" type="text/css"></link>
<link rel="stylesheet" href="./css/screen.css" type="text/css"></link>

			AbacusUtil  Docs | Download | Javadoc | FAQ | Community

Transaction

Transaction is supported by the Connection from Jdbc. Here is a simple sample:

final SQLTransaction tran = sqlExecutor.beginTransaction(IsolationLevel.READ_COMMITTED);
// DO NOT CLOSE the connection manually. It will be automatically closed after the transaction is committed or rolled back.
final Connection conn = tran.connection();
boolean noException = false;

try {
    // Do something with the "conn". For example:
    //
    // long id = sqlExecutor.insert(conn, INSERT_ACCOUNT, account);
    // DataSet result = sqlExecutor.query(conn, SELECT_ACCOUNT_BY_ID, id);

    noException = true;
} finally {
    if (noException) {
        tran.commit();
    } else {
        tran.rollback();
    }
}

We should avoid to open too many unnecessary transactions in heavy/big online systems.


text:
/* */
System.register(['./headers', './request-message-processor', './transformers'], function (_export) {
  'use strict';

  var Headers, RequestMessageProcessor, timeoutTransformer, credentialsTransformer, progressTransformer, responseTypeTransformer, headerTransformer, contentTransformer, HttpRequestMessage;

  _export('createHttpRequestMessageProcessor', createHttpRequestMessageProcessor);

  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }

  function createHttpRequestMessageProcessor() {
    return new RequestMessageProcessor(XMLHttpRequest, [timeoutTransformer, credentialsTransformer, progressTransformer, responseTypeTransformer, contentTransformer, headerTransformer]);
  }

  return {
    setters: [function (_headers) {
      Headers = _headers.Headers;
    }, function (_requestMessageProcessor) {
      RequestMessageProcessor = _requestMessageProcessor.RequestMessageProcessor;
    }, function (_transformers) {
      timeoutTransformer = _transformers.timeoutTransformer;
      credentialsTransformer = _transformers.credentialsTransformer;
      progressTransformer = _transformers.progressTransformer;
      responseTypeTransformer = _transformers.responseTypeTransformer;
      headerTransformer = _transformers.headerTransformer;
      contentTransformer = _transformers.contentTransformer;
    }],
    execute: function () {
      HttpRequestMessage = function HttpRequestMessage(method, url, content, headers) {
        _classCallCheck(this, HttpRequestMessage);

        this.method = method;
        this.url = url;
        this.content = content;
        this.headers = headers || new Headers();
        this.responseType = 'json';
      };

      _export('HttpRequestMessage', HttpRequestMessage);
    }
  };
});


text:
mysysadmin
==========

System to manage the information related to your servers, domains, users and so forth.

# Compatibilities

This application should run on PHP 5.4 or superior and MySQL + 5.0.

# Install

## Vendors

In order to install the libraries of the system run composer on the root of the project:

    $ composer.phar install --prefer-dist

## Virtual host

### Nginx

To install the Nginx's Virtual host check the folder [docs/nginx.conf](https://github.com/medinadato/mysysadmin/blob/master/docs/ngnix/mysysadmin.com.conf)

### Apache

Well, if you using Apache, you are on your own. it should not be hard, though.

## Hosts

If you working locally, you might setup your HOSTS file

    XX.X.X.XXX      local.mysysadmin.com

## Initial Data

You need either add the user below into your database or change the connection info at app/config/config_dev.yml

    $ mysql -uroot -p -e "GRANT ALL PRIVILEGES ON mysysadmin.* TO 'mysysadmin'@'localhost' IDENTIFIED BY 'mypass' WITH GRANT OPTION";

There are 2 ways to load the database;

### Via SQL

You can forward engineer the tables from [mysysadmin.mwb](https://github.com/medinadato/mysysadmin/blob/master/docs/db/data%20modeling/mysysadmin.mwb) or run [mysysadmin.sql](https://github.com/medinadato/mysysadmin/blob/master/docs/db/dump/mysysadmin.sql)

Tip: Don't forget to create the database/user prior to import the tables:

    $ mysql -uroot -p -e "CREATE DATABASE mysysadmin CHARACTER SET utf8 COLLATE utf8_general_ci";

### Via Symfony Console

Database structure

> ATTENTION: This operation should not be executed in a production environment

    $ php app/console doctrine:database:create --env=dev
    $ php app/console doctrine:schema:create --env=dev --em=default

### Authentication data

    $ php app/console doctrine:fixtures:load --env=dev --no-interaction

## Directory permissions

You might or might not need to run

    $ sudo chmod -R 744 .

You also might or might not need to run:
    $ sudo chmod 666 /var/run/php5-fpm.sock

# Application

## Assets

Composer usually install the assets when you run it. Otherwise you can it yourself.
I strongly recommend to create the assets as symbolic links. To do so:

    $ php app/console assets:install --symlink

# Access

You should be able to access the server by the data:

URL:  [http://local.mysysadmin.com/admin](http://local.mysysadmin.com/admin)
USER: admin[at]mdnsolutions.com
PASS: 123456

# Creating a CRUD

This section I show an example of how to create your own custom CRUD module.
In our case it's a new CRUD for the table Server in our MDN\AdminBundle.

## Database Table

Create your database table (e.g.: Server).

### Mapping and Entities

In order to map your entities into the application, run in your command line:

    $ php app/console doctrine:mapping:import --em=default --filter='Server' MDNAdminBundle yml

Then create the entity class file by:

    $ php app/console doctrine:mapping:convert annotation ./src --em=default --filter='Server'

By now you should be able to see the new file MDN\AdminBundle\Entity\Server.php created.

Now, add the Getters and Setters by using

    $ php app/console doctrine:generate:entities MDN/AdminBundle/Entity/Server

You can also delete the files on the directory src/MDN/AdminBundle/Resources/config/doctrine/.

## Controller

Create your controller in src/MDN/AdminBundle/Controller/ServerController.php
This step includes creating the view as well.

### Grid

You might use the grid module available. To do so, register your grid as a service and load it
in your controller src/MDN/AdminBundle/Resources/config/services/grid.yml.

# Extra libraries' documentations

[APYGridBundle](https://github.com/Abhoryo/APYDataGridBundle/blob/master/Resources/doc/summary.md)

# More at:
[http://blog.mdnsolutions.com](http://blog.mdnsolutions.com)


text:
package com.twitter.storehaus.kafka

import com.twitter.storehaus.WritableStore
import com.twitter.util.{Time, FuturePool, Future}
import java.util.Properties
import kafka.producer.{ProducerData, Producer, ProducerConfig}
import java.util.concurrent.ExecutorService
import com.twitter.concurrent.AsyncMutex
import kafka.serializer.Encoder

/**
 * Store capable of writing to a Kafka Topic.
 * @author Mansur Ashraf
 * @since 11/22/13
 */
class KafkaStore[K, V](topic: String, props: Properties)(executor: => ExecutorService) extends WritableStore[K, V] with Serializable {
  private lazy val producerConfig = new ProducerConfig(props)
  private lazy val producer = new Producer[K, V](producerConfig)
  private lazy val futurePool = FuturePool(executor)
  private[this] lazy val mutex = new AsyncMutex

  /**
   * Puts a key/value pair on a Kafka Topic using kafka.producer.AyncProducer and does not block thread
   * @param kv (key,value)
   * @return Future.unit
   */
  override def put(kv: (K, V)): Future[Unit] = mutex.acquire().flatMap {
    p =>
      futurePool {
        val (key, value) = kv
        producer.send(new ProducerData[K, V](topic, key, List(value)))
      } ensure {
        p.release()
      }
  }

  override def multiPut[K1 <: K](kvs: Map[K1, V]): Map[K1, Future[Unit]] = {
    val future = mutex.acquire().flatMap {
      p => futurePool {
        val batch = kvs.map {
          case (k, v) => new ProducerData[K, V](topic, k, List(v))
        }.toList
        producer.send(batch: _*)

      } ensure {
        p.release()
      }
    }
    kvs.mapValues(v => future)
  }

  /** Close this store and release any resources.
    * It is undefined what happens on get/multiGet after close
    */
  override def close(time: Time): Future[Unit] = futurePool {
    producer.close()
  }
}

object KafkaStore {

  /**
   * Creates an instance of Kafka store based on given properties.
   * @param topic Kafka topic.
   * @param props Kafka properties { @see http://kafka.apache.org/07/configuration.html}.
   * @tparam K Key
   * @tparam V Value
   * @return Kafka Store
   */
  def apply[K, V](topic: String, props: Properties)(executor: => ExecutorService) = new KafkaStore[K, V](topic, props)(executor)

  /**
   * Creates a Kafka store.
   * @param zkQuorum zookeeper quorum.
   * @param topic  Kafka topic.
   * @tparam K  Key
   * @tparam V Value
   * @return Kafka Store
   */
  def apply[K, V, E <: Encoder[V] : Manifest](zkQuorum: Seq[String],
                                              topic: String)(executor: => ExecutorService) = new KafkaStore[K, V](topic, createProp[V,E](zkQuorum))(executor)

  private def createProp[V, E <: Encoder[V] : Manifest](zkQuorum: Seq[String]): Properties = {
    val prop = new Properties()
    prop.put("serializer.class", implicitly[Manifest[E]].erasure.getName)
    prop.put("zk.connect", zkQuorum.mkString(","))
    prop
  }
}


text:
using namespace arangodb::aql;

namespace arangodb::tests::aql {
class AqlCallListTest : public ::testing::Test {};

TEST_F(AqlCallListTest, only_single_call) {
  AqlCall myCall{};
  myCall.offset = 3u;
  myCall.softLimit = 9u;

  AqlCallList testee(myCall);
  EXPECT_TRUE(testee.hasMoreCalls());
  AqlCall popped = testee.popNextCall();
  EXPECT_EQ(myCall, popped);
  EXPECT_FALSE(testee.hasMoreCalls());

  // Make sure calls are non-referenced
  myCall.offset = 9;
  EXPECT_FALSE(myCall == popped);
}

TEST_F(AqlCallListTest, only_single_call_peek) {
  AqlCall myCall{};
  myCall.offset = 3;
  myCall.softLimit = 9u;

  AqlCallList testee(myCall);
  EXPECT_TRUE(testee.hasMoreCalls());
  AqlCall popped = testee.peekNextCall();
  EXPECT_EQ(myCall, popped);
  EXPECT_TRUE(testee.hasMoreCalls());

  // Make sure calls are non-referenced
  popped.offset = 9;
  EXPECT_FALSE(myCall == popped);

  AqlCall popped2 = testee.popNextCall();
  EXPECT_EQ(myCall, popped2);
  EXPECT_FALSE(testee.hasMoreCalls());
}

TEST_F(AqlCallListTest, multiple_calls) {
  AqlCall myFirstCall{};
  myFirstCall.offset = 3;
  myFirstCall.softLimit = 9u;

  AqlCall defaultCall{};
  defaultCall.hardLimit = 2u;
  defaultCall.fullCount = true;
  EXPECT_FALSE(myFirstCall == defaultCall);

  AqlCallList testee(myFirstCall, defaultCall);
  {
    // Test the First specific call
    EXPECT_TRUE(testee.hasMoreCalls());
    AqlCall popped = testee.popNextCall();
    // it is equal to myFirstCall
    EXPECT_EQ(popped, myFirstCall);
    EXPECT_FALSE(popped == defaultCall);
    EXPECT_TRUE(testee.hasMoreCalls());
  }
  // 3 is a random number, we should be able to loop here forever.
  for (size_t i = 0; i < 3; ++i) {
    EXPECT_TRUE(testee.hasMoreCalls());
    AqlCall popped = testee.popNextCall();
    // it is equal to the defaultCall
    EXPECT_EQ(popped, defaultCall);
    EXPECT_FALSE(popped == myFirstCall);
    EXPECT_TRUE(testee.hasMoreCalls());
    // Modifying has no side effect on default call
    popped.didProduce(1);
    EXPECT_FALSE(popped == defaultCall);
    // Indirect test, modifing pop has no side-effect on the internal default call.
  }
}

TEST_F(AqlCallListTest, multiple_calls_peek) {
  AqlCall myFirstCall{};
  myFirstCall.offset = 3;
  myFirstCall.softLimit = 9u;

  AqlCall defaultCall{};
  defaultCall.hardLimit = 2u;
  defaultCall.fullCount = true;
  EXPECT_FALSE(myFirstCall == defaultCall);

  AqlCallList testee(myFirstCall, defaultCall);
  {
    // Test peek the first specific call
    EXPECT_TRUE(testee.hasMoreCalls());
    AqlCall peeked = testee.peekNextCall();
    // it is equal to myFirstCall
    EXPECT_EQ(peeked, myFirstCall);
    EXPECT_FALSE(peeked == defaultCall);
    EXPECT_TRUE(testee.hasMoreCalls());
  }
  {
    // Test pop the First specific call
    EXPECT_TRUE(testee.hasMoreCalls());
    AqlCall popped = testee.popNextCall();
    // it is equal to myFirstCall
    EXPECT_EQ(popped, myFirstCall);
    EXPECT_FALSE(popped == defaultCall);
    EXPECT_TRUE(testee.hasMoreCalls());
  }
  // 3 is a random number, we should be able to loop here forever.
  for (size_t i = 0; i < 3; ++i) {
    {
      // Test peek
      EXPECT_TRUE(testee.hasMoreCalls());
      AqlCall peeked = testee.peekNextCall();
      // it is equal to myFirstCall
      EXPECT_EQ(peeked, defaultCall);
      EXPECT_FALSE(peeked == myFirstCall);
      EXPECT_TRUE(testee.hasMoreCalls());
    }
    {
      EXPECT_TRUE(testee.hasMoreCalls());
      AqlCall popped = testee.popNextCall();
      // it is equal to the defaultCall
      EXPECT_EQ(popped, defaultCall);
      EXPECT_FALSE(popped == myFirstCall);
      EXPECT_TRUE(testee.hasMoreCalls());
      // Modifying has no side effect on default call
      popped.didProduce(1);
      EXPECT_FALSE(popped == defaultCall);
    }
    // Indirect test, modifing pop has no side-effect on the internal default call.
  }
}

}  // namespace arangodb::tests::aql


text:
import React,{ Component,PropTypes } from 'react'

export default class LoginFooterComponent extends Component {

  render() {
  	let {prefixCls} = this.props,
  		text = 'Copyright © 2016 The Project by company. All Rights Reserved'
    return (
      <footer className={`${prefixCls}-footer`}>

    )
  }
}


text:
package com.aws.global.common.base;

import org.apache.log4j.Logger;

/**
 * Base class for service layer implementation classes.
 * @author bryan.wong
 */
public class BaseService {

	/** Log4j Instance. */
	private static Logger logger = Logger.getLogger(BaseService.class);

	/**
	 * Logs DEBUG to Log4j instance.
	 * @param className currently invoked class
	 * @param functionName currently invoked method
	 * @param message message to write
	 */
	public void log(String className, String functionName, String message) {
		logger.info("[" + className + "] [" + functionName + "] " + message);
	}

	/**
	 * Logs ERROR to Log4j instance.
	 * @param className currently invoked class
	 * @param functionName currently invoked method
	 * @param message message to write
	 */
	public void logErr(String className, String functionName, String message) {
		logger.error("[" + className + "] [" + functionName + "] " + message);
	}

	/**
	 * Logs ERROR to Log4j instance.
	 * @param className currently invoked class
	 * @param functionName currently invoked method
	 * @param message message to write
	 * @param throwable instance
	 */
	public void logErr(String className, String functionName, String message, Throwable t) {
		logger.error("[" + className + "] [" + functionName + "] " + message, t);
	}
}


text:
public interface QueueInterface<T>

{
  T dequeue() throws QueueUnderflowException;
  // Throws QueueUnderflowException if this queue is empty;
  // otherwise, removes front element from this queue and returns it.

  boolean isEmpty();
  // Returns true if this queue is empty; otherwise, returns false.
}


text:
import { AuthGuard } from './common/auth.guard';
import { CanDeactivateGuard } from './common/canDeactivate.guard';
import { RouterModule, Routes } from '@angular/router';

import { capitalizeURL } from './common/utils';

import { AlertDebugComponent } from './components/alert-debug/alert-debug.component';
import { QuotesComponent } from './components/quotes/quotes.component';

/**
 * Title functions
 * We MUST separate them and export them otherwise Angular can't resolve it statically or something
 */
export function defaultTitleFunction(url: string) {
	return `MyMICDS - ${capitalizeURL(url)}`;
}

/**
 * Router Config
 */
export const appRoutes: Routes = [
	{
		path: '',
		redirectTo: '/home',
		pathMatch: 'full'
	},
	{
		path: 'quote',
		component: QuotesComponent
	},
	{
		path: 'alert-debug',
		component: AlertDebugComponent
	},
	{
		path: 'about',
		loadChildren: () => import('./about/about.module').then(m => m.AboutModule)
	},
	{
		path: 'home',
		loadChildren: () => import('./home/home.module').then(m => m.HomeModule)
	},
	{
		path: 'planner',
		loadChildren: () => import('./planner/planner.module').then(m => m.PlannerModule)
	},
	{
		path: 'lunch',
		loadChildren: () => import('./lunch/lunch.module').then(m => m.LunchModule)
	},
	{
		path: 'reset-password',
		loadChildren: () =>
			import('./reset-password/reset-password.module').then(m => m.ResetPasswordModule)
	},
	{
		path: 'confirm',
		loadChildren: () => import('./confirm/confirm.module').then(m => m.ConfirmModule)
	},
	{
		path: 'settings',
		loadChildren: () => import('./settings/settings.module').then(m => m.SettingsModule)
	},
	{
		path: 'unsubscribe',
		loadChildren: () =>
			import('./unsubscribe/unsubscribe.module').then(m => m.UnsubscribeModule)
	},
	{
		path: 'daily-bulletin',
		loadChildren: () =>
			import('./daily-bulletin/daily-bulletin.module').then(m => m.DailyBulletinModule)
	}
];

export const appRoutingProviders = [AuthGuard, CanDeactivateGuard];

export const routing = RouterModule.forRoot(appRoutes, { relativeLinkResolution: 'legacy' });


text:
#ifndef SYN_H
#define SYN_H

#include <stack.h>
#include <stdio.h>
#include <sys/stat.h>

#define STACK_SIZE 256
#define OUT_SIZE 4

stack_int_t stack;
int output[OUT_SIZE];

#define POP stack_pop(&stack)
#define PUSH(x) stack_push(&stack, x)

/* BASIC OPCODES */
#define SRT		0x53594E2E // Start of op codes
#define	END 	0xFFFFFFFF // End of op codes
#define	NOP 	0x00000000 // No operation
#define	SET 	0x00000002 // Push value onto stack
#define	GET 	0x00000003 // Return value from stack into output register
#define CLR 	0x00000004 // Clear top value from output register

/* CONTROL FLOW */
#define JMP 	0x0000000A // Jump to program buffer address
#define JMZ 	0x0000000B // Jump to program buffer address of next value if stack zero

/* MATHS */
#define INC		0x00000100 // Increment first stack element
#define DEC		0x00000101 // Decrement first stack element
#define	ADD 	0x0000010A // Add first two stack elements
#define	SUB 	0x0000010B // Subtract second element from first
#define	MUL 	0x0000010C // Multiply first two stack elements
#define	DIV 	0x0000010D // Divide first element by second
#define	MOD 	0x0000010E // Modulo division

/* MEMORY */
#define LOD

/* STRINGS */
#define PST 	0x00000101 // Push string onto stack in reverse order
#define GST 	0x00000102 // Get nul terminated string off stack in order

/* INPUT & OUTPUT */
#define INI 	0x00F00001 // Add int from stdin to stack
#define OUT 	0x00F00011 // Print int from stack to stdout

enum BYTE_ERROR {
	ERR_UNKNOWN_ERROR,
	ERR_OUTPUT_OVERFLOW,
	ERR_ILLEGAL_INSTRUCTION,
	ERR_STACK_OVERFLOW,
};

int execute_program(int* input, int* output);
int* read_file(char* file);
void dump_program(int* prog);
void dump_output();
int endian_swap(int in);
void endian_swap_buffer(int* buffer);

#endif


text:
Jerminal is a small library written in pure Java 8, with no external libraries.
It offers elegant API for command-line interface creation. It was written initially for Protium project, and continued living as separate open-source library.

### Usage ###
Use .jar files offered in Downloads. API Reference will be [here](https://kkremen.bitbucket.io/projects/jconsole) soon.

Simple usage:
```java
import org.meinkopf.jerminal.BasicCommandList;
import org.meinkopf.jerminal.Executable;
import org.meinkopf.jerminal.Jerminal;

class Main {

	public static void main(String[] argv) {

		Executable exit = (args) -> {
			System.exit(0);
			return null;
		};

		BasicCommandList commandList = new BasicCommandList();
		commandList.register("exit", exit);

		Jerminal console = new Jerminal(commandList);
		console.run();

	}
}
```

### Contribute ###
Want to help? Feel free to make pull requests!