text:
package org.jclouds.chef.functions;

import java.util.Map;
import java.util.Set;

import javax.inject.Inject;
import javax.inject.Singleton;

import org.jclouds.http.HttpResponse;
import org.jclouds.http.functions.ParseJson;

import com.google.common.base.Function;

/**
 * @author Adrian Cole
 */
@Singleton
public class ParseKeySetFromJson implements Function<HttpResponse, Set<String>> {

   private final ParseJson<Map<String, String>> json;

   @Inject
   ParseKeySetFromJson(ParseJson<Map<String, String>> json) {
      this.json = json;
   }

   @Override
   public Set<String> apply(HttpResponse arg0) {
      return json.apply(arg0).keySet();

   }
}

redpajama_set_name: RedPajamaGithub


text:
module Model where

import Prelude
import Yesod
import Data.Text (Text)
import Database.Persist.Quasi
import Database.Persist.MongoDB hiding (master)
import Language.Haskell.TH.Syntax
import Yesod.Markdown (Markdown)
import Yesod.Auth.HashDB (HashDBUser(..))

-- You can define all of your database entities in the entities file.
-- You can find more information on persistent and how to declare entities
-- at:
-- http://www.yesodweb.com/book/persistent/

-- note that the UniqueUsername constraint on User will not work with Mongo,
-- to stop duplicate usernames from being entered you should create a
-- unique index on the user collection like so:
-- db.user.ensureIndex({ username : 1}, { unique : true })
let mongoSettings = (mkPersistSettings (ConT ''MongoBackend))
                        { mpsGeneric = True
                        }
 in share [mkPersist mongoSettings]
    $(persistFileWith lowerCaseSettings "config/models")

instance HashDBUser (UserGeneric backend) where
  userPasswordHash = Just . userPassword
  userPasswordSalt = Just . userSalt
  setSaltAndPasswordHash s h u = u { userSalt     = s
                                   , userPassword = h
                                   }


text:
.class public Lcom/samsung/android/friends/common/BundleFrs;
.super Ljava/lang/Object;
.source "BundleFrs.java"

# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/samsung/android/friends/common/BundleFrs$Builder;
    }
.end annotation

# static fields
.field public static final ACCESSORY_LIST:Ljava/lang/String; = "accessoryList"

.field public static final ATTACHED:Ljava/lang/String; = "attached"

.field public static final CLIENT_STATE_ACTION:Ljava/lang/String; = "clientStateAction"

.field public static final CLIENT_STATE_BUNDLE:Ljava/lang/String; = "clientStateBundle"

.field public static final DATA:Ljava/lang/String; = "data"

.field public static final EXTRA_DATA:Ljava/lang/String; = "extraData"

.field public static final KEEP_CONNECTION_STATE:Ljava/lang/String; = "keepConnectionState"

.field public static final PARAM_BOOLEAN_0:Ljava/lang/String; = "paramBool0"

.field public static final PARAM_BOOLEAN_1:Ljava/lang/String; = "paramBool1"

.field public static final PARAM_BYTE_ARRAY_0:Ljava/lang/String; = "paramByteA0"

.field public static final PARAM_BYTE_ARRAY_1:Ljava/lang/String; = "paramByteA1"

.field public static final PARAM_BYTE_ARRAY_2:Ljava/lang/String; = "paramByteA2"

.field public static final PARAM_INT_0:Ljava/lang/String; = "paramInt0"

.field public static final PARAM_INT_1:Ljava/lang/String; = "paramInt1"

.field public static final PARAM_LIST_0:Ljava/lang/String; = "paramList0"

.field public static final PARAM_LIST_1:Ljava/lang/String; = "paramList1"

.field public static final PARAM_STRING_0:Ljava/lang/String; = "paramStr0"

.field public static final PARAM_STRING_1:Ljava/lang/String; = "paramStr1"

.field public static final PARAM_STRING_ARRAY_0:Ljava/lang/String; = "paramStrA0"

.field public static final PARAM_STRING_ARRAY_1:Ljava/lang/String; = "paramStrA1"

.field public static final PARAM_STRING_ARRAY_2:Ljava/lang/String; = "paramStrA2"

.field public static final PARAM_STRING_ARRAY_3:Ljava/lang/String; = "paramStrA3"

.field private static final RESULT_BOOLEAN:Ljava/lang/String; = "resultBoolean"

.field public static final SECURITY_DATA_TYPE:Ljava/lang/String; = "dataType"

.field public static final SECURITY_DECRYPT_DATA:Ljava/lang/String; = "decryptData"

.field public static final SECURITY_DECRYPT_MULTIPLE_DATA:Ljava/lang/String; = "decryptMultipleData"

.field public static final SECURITY_DECRYPT_MULTIPLE_RESULT:Ljava/lang/String; = "decryptMultipleResult"

.field public static final SECURITY_DECRYPT_RESULT:Ljava/lang/String; = "decryptResult"

.field public static final SECURITY_ENCRYPT_DATA:Ljava/lang/String; = "encryptData"

.field public static final SECURITY_ENCRYPT_MULTIPLE_DATA:Ljava/lang/String; = "encryptMultipleData"

.field public static final SECURITY_ENCRYPT_MULTIPLE_RESULT:Ljava/lang/String; = "encryptMultipleResult"

.field public static final SECURITY_ENCRYPT_RESULT:Ljava/lang/String; = "encryptResult"

.field public static final STATE_ID:Ljava/lang/String; = "stateId"

.field public static final SYS_SVC_VERSION:Ljava/lang/String; = "sysSvcVer"

.field public static final TIMESTAMP:Ljava/lang/String; = "timeStamp"

# direct methods
.method public constructor <init>()V
    .locals 0

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

    return-void
.end method

.method public static byteArray(Landroid/os/Bundle;Ljava/lang/String;)[B
    .locals 1

    const/4 v0, 0x0

    if-eqz p0, :cond_0

    invoke-virtual {p0, p1}, Landroid/os/Bundle;->getByteArray(Ljava/lang/String;)[B

    move-result-object v0

    return-object v0

    :cond_0
    return-object v0
.end method

.method public static getResultBoolean(Landroid/os/Bundle;)Z
    .locals 2

    const/4 v0, 0x0

    if-eqz p0, :cond_0

    const-string/jumbo v1, "resultBoolean"

    invoke-virtual {p0, v1, v0}, Landroid/os/Bundle;->getBoolean(Ljava/lang/String;Z)Z

    move-result v0

    :cond_0
    return v0
.end method

.method public static getResultBundle(Z)Landroid/os/Bundle;
    .locals 2

    new-instance v0, Landroid/os/Bundle;

    invoke-direct {v0}, Landroid/os/Bundle;-><init>()V

    const-string/jumbo v1, "resultBoolean"

    invoke-virtual {v0, v1, p0}, Landroid/os/Bundle;->putBoolean(Ljava/lang/String;Z)V

    return-object v0
.end method


text:
use strict;

use Getopt::Long;
use SAPserver;
use ScriptThing;
use SeedUtils;

#
#	This is a SAS Component.
#

=head1 svr_figfam_fasta

    svr_figfam_fasta <figfam_ids.tbl >genes.fasta

Produce FASTA strings for FIGfams.

This script takes as input a tab-delimited file with FIGfam IDs at the end of
each line. For each FIGfam ID, all the genes in the FIGfam are written to the
output file in FASTA format. The FIGfam ID will be included as the FASTA
comment.

This is a pipe command: the input is taken from the standard input and the
output is to the standard output.

=head2 Command-Line Options

=over 4

=item url

The URL for the Sapling server, if it is to be different from the default.

=item c

Column index. If specified, indicates that the input IDs should be taken from the
indicated column instead of the last column. The first column is column 1.

=back

=cut

# Parse the command-line options.
my $url = '';
my $column = 0;
my $opted =  GetOptions('url=s' => \$url, 'c=i' => \$column);
if (! $opted) {
    print "usage: svr_figfam_fasta [--url=http://...] [--c=N] <input >output\n";
} else {
    # Get the server object.
    my $sapServer = SAPserver->new(url => $url);
    # The main loop processes chunks of input one line at a time.
    while (my @tuples = ScriptThing::GetBatch(\*STDIN, 1, $column)) {
        my $ffid = $tuples[0][0];
        # Ask the server for the FASTA strings.
        my $document = $sapServer->figfam_fids(-id => $ffid,
                                               -fasta => 1);
        # Write out the results.
        print join("", @$document);
    }
}


text:
<!DOCTYPE html >

          <title>RFModelAggregator - Random Forests in Apache Spark 1.2-SNAPSHOT API - reforest.rf.RFModelAggregator</title>
          <meta name="description" content="RFModelAggregator - Random Forests in Apache Spark 1.2 - SNAPSHOT API - reforest.rf.RFModelAggregator" />
          <meta name="keywords" content="RFModelAggregator Random Forests in Apache Spark 1.2 SNAPSHOT API reforest.rf.RFModelAggregator" />
          <meta http-equiv="content-type" content="text/html; charset=UTF-8" />

      <link href="../../lib/template.css" media="screen" type="text/css" rel="stylesheet" />
      <link href="../../lib/diagrams.css" media="screen" type="text/css" rel="stylesheet" id="diagrams-css" />

reforest.rf

RFModelAggregator

Related Doc:
            package rf

        class

        RFModelAggregator[T, U] extends RFModel[T, U]

It aggregates multiple RFModel.
It is possible to add models incrementally.

T

raw data type

U

working data type

          Linear Supertypes

RFModel[T, U], Serializable, Serializable, AnyRef, Any

<input id="mbrsel-input" type="text" accesskey="/" />

              Ordering

Alphabetic

By Inheritance

                Inherited

RFModelAggregator

RFModel

Serializable

Serializable

AnyRef

Any

Hide All

Show All

            Visibility

Public

All

Instance Constructors

        new

        RFModelAggregator(numClasses: Int)

numClasses

number of classes in the dataset

Value Members

        final
        def

        !=(arg0: Any): Boolean

Definition Classes

AnyRef → Any

        final
        def

        ##(): Int

Definition Classes

AnyRef → Any

        final
        def

        ==(arg0: Any): Boolean

Definition Classes

AnyRef → Any

        def

        addModel(model: RFModel[T, U]): Unit

        final
        def

        asInstanceOf[T0]: T0

Definition Classes

Any

        def

        clone(): AnyRef

Attributes

protected[java.lang]

Definition Classes

AnyRef

Annotations

                @throws(

      ...
    )

        final
        def

        eq(arg0: AnyRef): Boolean

Definition Classes

AnyRef

        def

        equals(arg0: Any): Boolean

Definition Classes

AnyRef → Any

        def

        finalize(): Unit

Attributes

protected[java.lang]

Definition Classes

AnyRef

Annotations

                @throws(

      classOf[java.lang.Throwable]
    )

        def

        getBinNumber: Int

The bin number used to learn this model

The bin number used to learn this model

returns

the number of bin

Definition Classes

RFModelAggregator → RFModel

        final
        def

        getClass(): Class[_]

Definition Classes

AnyRef → Any

        def

        getDepth: Int

The maximum depth used to learn this model

The maximum depth used to learn this model

returns

the maximum depth

Definition Classes

RFModelAggregator → RFModel

        def

        getFeaturePerNode: Int

The number of features used in each node to detect the split to learn this model

The number of features used in each node to detect the split to learn this model

returns

the number of features used in each node

Definition Classes

RFModelAggregator → RFModel

        def

        getNumTrees: Int

The number of tress used to learn this model

The number of tress used to learn this model

returns

the number of trees

Definition Classes

RFModelAggregator → RFModel

        def

        hashCode(): Int

Definition Classes

AnyRef → Any

        final
        def

        isInstanceOf[T0]: Boolean

Definition Classes

Any

        var

        modelList: ListBuffer[RFModel[T, U]]

        final
        def

        ne(arg0: AnyRef): Boolean

Definition Classes

AnyRef

        final
        def

        notify(): Unit

Definition Classes

AnyRef

        final
        def

        notifyAll(): Unit

Definition Classes

AnyRef

        val

        numClasses: Int

number of classes in the dataset

        def

        predict(point: RawData[T, U], maxDepth: Int = Int.MaxValue, maxTrees: Int = Int.MaxValue): Int

It predicts the label for the given data

It predicts the label for the given data

point

the data to predict

maxDepth

the maximum depth to visit

returns

the predicted label

Definition Classes

RFModel

        def

        predictDetails(maxDepth: Int, maxTrees: Int, point: RawData[T, U]): Array[(Int, Int)]

It collects the amount of trees voting for each class

It collects the amount of trees voting for each class

maxDepth

the maximum depth to visit

point

the data to predict

returns

an array with the amount of votes for each class

Definition Classes

RFModelAggregator → RFModel

        final
        def

        synchronized[T0](arg0: ⇒ T0): T0

Definition Classes

AnyRef

        def

        toString(): String

Definition Classes

RFModel → AnyRef → Any

        final
        def

        wait(): Unit

Definition Classes

AnyRef

Annotations

                @throws(

      ...
    )

        final
        def

        wait(arg0: Long, arg1: Int): Unit

Definition Classes

AnyRef

Annotations

                @throws(

      ...
    )

        final
        def

        wait(arg0: Long): Unit

Definition Classes

AnyRef

Annotations

                @throws(

      ...
    )

Inherited from RFModel[T, U]

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped


text:
<?php

namespace App\Entity\Doc;

use App\Helper as H;

/**
 * Класс-сущность  документ  Платежное поручение
 *
 */
class TransferOrder extends Document
{

    public function generateReport() {
        $firmdetail = \App\System::getOptions("firmdetail");

        $mybank = \App\Entity\Bank::load($firmdetail['bank']);

        $customer = \App\Entity\Customer::load($this->customer_id);
        $cbank = \App\Entity\Bank::load($customer->bank);

        $header = array(
            'date' => date('d.m.Y', $this->document_date),
            'myname' => $firmdetail['name'],
            'mycode' => $firmdetail['edrpou'],
            'mybankaccount' => $firmdetail['bankaccount'],
            'mybank' => $mybank->bank_name,
            'mybankcode' => $mybank->mfo,
            'cname' => $customer->customer_name,
            'ccode' => $customer->edrpou,
            'cbankaccount' => $customer->bankaccount,
            'cbank' => $cbank->bank_name,
            'cbankcode' => $cbank->mfo,
            "document_number" => $this->document_number,
            "document_date" => date('Y.m.d', $this->document_date),
            "notes" => $this->headerdata['notes'],
            "amount" => H::famt($this->amount),
            "amountstr" => \App\Util::ucfirst(\App\Util::money2str($this->amount / 100))
        );

        $report = new \App\Report('transferorder.tpl');

        $html = $report->generate($header);

        return $html;
    }

    public function Execute() {

        return true;
    }

}


text:
package org.zstack.test.compute.vm;

import junit.framework.Assert;
import org.junit.Before;
import org.junit.Test;
import org.zstack.compute.host.HostGlobalConfig;
import org.zstack.core.cloudbus.CloudBus;
import org.zstack.core.cloudbus.EventCallback;
import org.zstack.core.cloudbus.EventFacade;
import org.zstack.core.componentloader.ComponentLoader;
import org.zstack.core.config.GlobalConfigFacade;
import org.zstack.core.db.DatabaseFacade;
import org.zstack.core.db.SimpleQuery;
import org.zstack.core.db.SimpleQuery.Op;
import org.zstack.header.host.HostVO;
import org.zstack.header.vm.VmInstanceState;
import org.zstack.header.vm.VmInstanceVO;
import org.zstack.header.vm.VmInstanceVO_;
import org.zstack.header.vm.VmTracerCanonicalEvents;
import org.zstack.header.vm.VmTracerCanonicalEvents.VmStateChangedOnHostData;
import org.zstack.simulator.SimulatorController;
import org.zstack.test.Api;
import org.zstack.test.DBUtil;
import org.zstack.test.deployer.Deployer;
import org.zstack.utils.Utils;
import org.zstack.utils.logging.CLogger;

import java.util.Map;
import java.util.concurrent.TimeUnit;

/**
 * 1. create a vm
 * 2. make the vm abnormally stopped
 *

 * confirm the host capacity returned
 * confirm VmStateChangedOnHostData issued
 *

 * 3. make the vm abnormally started
 *

 * confirm the host capacity allocated
 * confirm VmStateChangedOnHostData issued
 */
public class TestVmStateTracer {
    Deployer deployer;
    Api api;
    ComponentLoader loader;
    CloudBus bus;
    DatabaseFacade dbf;
    GlobalConfigFacade gcf;
    SimulatorController sctrl;
    EventFacade evtf;
    boolean success1 = false;
    boolean success2 = false;
    private static final CLogger logger = Utils.getLogger(TestVmStateTracer.class);

    @Before
    public void setUp() throws Exception {
        DBUtil.reDeployDB();
        deployer = new Deployer("deployerXml/vm/TestVmStateTracer.xml");
        loader = deployer.getComponentLoader();
        gcf = loader.getComponent(GlobalConfigFacade.class);
        sctrl = loader.getComponent(SimulatorController.class);
        HostGlobalConfig.PING_HOST_INTERVAL.updateValue(1);
        bus = loader.getComponent(CloudBus.class);
        dbf = loader.getComponent(DatabaseFacade.class);
        evtf = loader.getComponent(EventFacade.class);

        deployer.build();
        api = deployer.getApi();
    }

    @Test
    public void test() throws InterruptedException {
        SimpleQuery<VmInstanceVO> q = dbf.createQuery(VmInstanceVO.class);
        q.add(VmInstanceVO_.name, Op.EQ, "TestVm1");
        VmInstanceVO vm1 = q.find();
        final String vmUuid = vm1.getUuid();
        final String hostUuid = vm1.getHostUuid();
        Assert.assertNotNull(vm1);
        Assert.assertEquals(VmInstanceState.Running, vm1.getState());

        evtf.on(VmTracerCanonicalEvents.VM_STATE_CHANGED_PATH, new EventCallback() {
            @Override
            public void run(Map tokens, Object data) {
                VmStateChangedOnHostData d = (VmTracerCanonicalEvents.VmStateChangedOnHostData) data;
                if (d.getVmUuid().equals(vmUuid) && d.getTo() == VmInstanceState.Stopped
                        && d.getOriginalHostUuid().equals(hostUuid) && d.getCurrentHostUuid() == null) {
                    // abnormally stopped
                    success1 = true;
                } else if (d.getVmUuid().equals(vmUuid) && d.getTo() == VmInstanceState.Running &&
                        d.getOriginalHostUuid() == null && d.getCurrentHostUuid().equals(hostUuid)) {
                    // abnormally started
                    success2 = true;
                }
            }
        });

        HostVO hvo1 = dbf.findByUuid(vm1.getHostUuid(), HostVO.class);
        sctrl.setVmStateOnSimulatorHost(hostUuid, vm1.getUuid(), VmInstanceState.Stopped);
        TimeUnit.SECONDS.sleep(3);
        vm1 = dbf.findByUuid(vm1.getUuid(), VmInstanceVO.class);
        Assert.assertNotNull(vm1);
        Assert.assertEquals(VmInstanceState.Stopped, vm1.getState());
        Assert.assertNull(vm1.getHostUuid());
        HostVO hvo2 = dbf.findByUuid(hostUuid, HostVO.class);
        Assert.assertEquals(hvo2.getCapacity().getAvailableMemory(), hvo1.getCapacity().getAvailableMemory() + vm1.getMemorySize());
        Assert.assertEquals(hvo2.getCapacity().getAvailableCpu(), hvo1.getCapacity().getAvailableCpu() + vm1.getCpuNum());
        Assert.assertTrue(success1);
        Assert.assertFalse(success2);

        sctrl.setVmStateOnSimulatorHost(hostUuid, vm1.getUuid(), VmInstanceState.Running);
        TimeUnit.SECONDS.sleep(3);
        vm1 = dbf.findByUuid(vm1.getUuid(), VmInstanceVO.class);
        Assert.assertNotNull(vm1);
        Assert.assertEquals(VmInstanceState.Running, vm1.getState());
        Assert.assertNotNull(vm1.getHostUuid());
        HostVO hvo3 = dbf.findByUuid(vm1.getHostUuid(), HostVO.class);
        Assert.assertEquals(hvo3.getCapacity().getAvailableMemory(), hvo2.getCapacity().getAvailableMemory() - vm1.getMemorySize());
        Assert.assertEquals(hvo3.getCapacity().getAvailableCpu(), hvo2.getCapacity().getAvailableCpu() - vm1.getCpuNum());
        Assert.assertTrue(success2);
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<ldswebml type="image" uri="/media-library/images/recreation#father-son-playing-catch-883307" xml:lang="eng" locale="eng" status="publish" xmlns:its="http://www.w3.org/2005/11/its">
  <search-meta>
      <uri-title its:translate="no">father-son-playing-catch-883307</uri-title>
      <source>father-son-playing-catch-883307</source>
      <publication-type its:translate="no">image</publication-type>
      <media-type its:translate="no">image</media-type>
      <publication value="ldsorg">LDS.org</publication>
      <publication-date value="2012-07-02">2012-07-02</publication-date>
      <title/>
      <description/>
      <collections>
          <collection its:translate="no">global-search</collection>
          <collection its:translate="no">media</collection>
          <collection its:translate="no">images</collection>
      </collections>
      <subjects>
          <subject>fathers</subject>
          <subject>sons</subject>
          <subject>boys</subject>
          <subject>men</subject>
          <subject>man</subject>
          <subject>playing</subject>
          <subject>football</subject>
          <subject>catch</subject>
          <subject>passing</subject>
          <subject>outside</subject>
          <subject>outdoors</subject>
          <subject>backyards</subject>
          <subject>sports</subject>
          <subject>fatherhood</subject>
      </subjects>
  </search-meta>
  <no-search>
      <path>http://media.ldscdn.org/images/media-library/recreation/father-son-playing-catch-883307-gallery.jpg</path>
      <images>
          http://media.ldscdn.org/images/media-library/recreation/father-son-playing-catch-883307-thumbnail.jpg
      </images>
          <download-urls>
              <download-url>
                  Mobile
                  <size>144 KB</size>
                  <path>http://media.ldscdn.org/images/media-library/recreation/father-son-playing-catch-883307-mobile.jpg</path>
              </download-url>
              <download-url>
                  Tablet
                  <size>202 KB</size>
                  <path>http://media.ldscdn.org/images/media-library/recreation/father-son-playing-catch-883307-tablet.jpg</path>
              </download-url>
              <download-url>
                  Print
                  <size>473 KB</size>
                  <path>http://media.ldscdn.org/images/media-library/recreation/father-son-playing-catch-883307-print.jpg</path>
              </download-url>
              <download-url>
                  Wallpaper
                  <size>809 KB</size>
                  <path>http://media.ldscdn.org/images/media-library/recreation/father-son-playing-catch-883307-wallpaper.jpg</path>
              </download-url>
          </download-urls>
  </no-search>
</ldswebml>


text:
// Copyright 2019 Keybase, Inc. All rights reserved. Use of
// this source code is governed by the included BSD license.

// RPC handlers for kvstore operations

package service

import (
	"fmt"
	"strings"
	"sync"

	"github.com/keybase/client/go/kvstore"
	"github.com/keybase/client/go/libkb"
	keybase1 "github.com/keybase/client/go/protocol/keybase1"
	"github.com/keybase/client/go/teams"
	"github.com/keybase/go-framed-msgpack-rpc/rpc"
	"golang.org/x/net/context"
)

type KVStoreHandler struct {
	*BaseHandler
	sync.Mutex
	libkb.Contextified
	Boxer kvstore.KVStoreBoxer
}

var _ keybase1.KvstoreInterface = (*KVStoreHandler)(nil)

func NewKVStoreHandler(xp rpc.Transporter, g *libkb.GlobalContext) *KVStoreHandler {
	if g.GetKVRevisionCache() == nil {
		g.SetKVRevisionCache(kvstore.NewKVRevisionCache(g))
	}
	return &KVStoreHandler{
		BaseHandler:  NewBaseHandler(g, xp),
		Contextified: libkb.NewContextified(g),
		Boxer:        kvstore.NewKVStoreBoxer(g),
	}
}

func (h *KVStoreHandler) resolveTeam(mctx libkb.MetaContext, userInputTeamName string) (teamID keybase1.TeamID, err error) {
	if strings.Contains(userInputTeamName, ",") {
		// it's an implicit team that might not exist yet
		team, _, _, err := teams.LookupOrCreateImplicitTeam(mctx.Ctx(), mctx.G(), userInputTeamName, false /*public*/)
		if err != nil {
			mctx.Debug("error loading implicit team %s: %v", userInputTeamName, err)
			err = libkb.AppStatusError{
				Code: libkb.SCTeamReadError,
				Desc: "You are not a member of this team",
			}
			return teamID, err
		}
		return team.ID, nil
	}
	teamID, err = teams.GetTeamIDByNameRPC(mctx, userInputTeamName)
	if err != nil {
		mctx.Debug("error resolving team with name %s: %v", userInputTeamName, err)
	}
	return teamID, err
}

type getEntryAPIRes struct {
	libkb.AppStatusEmbed
	TeamID            keybase1.TeamID               `json:"team_id"`
	Namespace         string                        `json:"namespace"`
	EntryKey          string                        `json:"entry_key"`
	TeamKeyGen        keybase1.PerTeamKeyGeneration `json:"team_key_gen"`
	Revision          int                           `json:"revision"`
	Ciphertext        *string                       `json:"ciphertext"`
	FormatVersion     int                           `json:"format_version"`
	WriterUID         keybase1.UID                  `json:"uid"`
	WriterEldestSeqno keybase1.Seqno                `json:"eldest_seqno"`
	WriterDeviceID    keybase1.DeviceID             `json:"device_id"`
}

func (h *KVStoreHandler) serverFetch(mctx libkb.MetaContext, entryID keybase1.KVEntryID) (emptyRes getEntryAPIRes, err error) {
	var apiRes getEntryAPIRes
	apiArg := libkb.APIArg{
		Endpoint:    "team/storage",
		SessionType: libkb.APISessionTypeREQUIRED,
		Args: libkb.HTTPArgs{
			"team_id":   libkb.S{Val: entryID.TeamID.String()},
			"namespace": libkb.S{Val: entryID.Namespace},
			"entry_key": libkb.S{Val: entryID.EntryKey},
		},
	}
	err = mctx.G().API.GetDecode(mctx, apiArg, &apiRes)
	if err != nil {
		mctx.Debug("error fetching %+v from server: %v", entryID, err)
		return emptyRes, err
	}
	if apiRes.TeamID != entryID.TeamID {
		return emptyRes, fmt.Errorf("api returned an unexpected teamID: %s isn't %s", apiRes.TeamID, entryID.TeamID)
	}
	if apiRes.Namespace != entryID.Namespace {
		return emptyRes, fmt.Errorf("api returned an unexpected namespace: %s isn't %s", apiRes.Namespace, entryID.Namespace)
	}
	if apiRes.EntryKey != entryID.EntryKey {
		return emptyRes, fmt.Errorf("api returned an unexpected entryKey: %s isn't %s", apiRes.EntryKey, entryID.EntryKey)
	}
	return apiRes, nil
}

func (h *KVStoreHandler) GetKVEntry(ctx context.Context, arg keybase1.GetKVEntryArg) (res keybase1.KVGetResult, err error) {
	h.Lock()
	defer h.Unlock()
	return h.getKVEntryLocked(ctx, arg)
}

func (h *KVStoreHandler) getKVEntryLocked(ctx context.Context, arg keybase1.GetKVEntryArg) (res keybase1.KVGetResult, err error) {
	ctx = libkb.WithLogTag(ctx, "KV")
	mctx := libkb.NewMetaContext(ctx, h.G())
	defer mctx.Trace(fmt.Sprintf("KVStoreHandler#GetKVEntry: t:%s, n:%s, k:%s", arg.TeamName, arg.Namespace, arg.EntryKey), &err)()

	if err := assertLoggedIn(ctx, h.G()); err != nil {
		mctx.Debug("not logged in err: %v", err)
		return res, err
	}
	teamID, err := h.resolveTeam(mctx, arg.TeamName)
	if err != nil {
		return res, err
	}
	entryID := keybase1.KVEntryID{
		TeamID:    teamID,
		Namespace: arg.Namespace,
		EntryKey:  arg.EntryKey,
	}
	apiRes, err := h.serverFetch(mctx, entryID)
	if err != nil {
		mctx.Debug("error fetching %+v from server: %v", entryID, err)
		return res, err
	}
	// check the server response against the local cache
	err = mctx.G().GetKVRevisionCache().Check(mctx, entryID, apiRes.Ciphertext, apiRes.TeamKeyGen, apiRes.Revision)
	if err != nil {
		err = fmt.Errorf("error comparing the entry from the server to what's in the local cache: %s", err)
		mctx.Debug("%+v: %s", entryID, err)
		return res, err
	}
	var entryValue *string
	if apiRes.Ciphertext != nil && len(*apiRes.Ciphertext) > 0 {
		// ciphertext coming back from the server is available to be unboxed (has previously been set, and was not previously deleted)
		cleartext, err := h.Boxer.Unbox(mctx, entryID, apiRes.Revision, *apiRes.Ciphertext, apiRes.TeamKeyGen, apiRes.FormatVersion, apiRes.WriterUID, apiRes.WriterEldestSeqno, apiRes.WriterDeviceID)
		if err != nil {
			mctx.Debug("error unboxing %+v: %v", entryID, err)
			return res, err
		}
		entryValue = &cleartext
	}
	err = mctx.G().GetKVRevisionCache().Put(mctx, entryID, apiRes.Ciphertext, apiRes.TeamKeyGen, apiRes.Revision)
	if err != nil {
		err = fmt.Errorf("error putting newly fetched values into the local cache: %s", err)
		mctx.Debug("%+v: %s", entryID, err)
		return res, err
	}
	return keybase1.KVGetResult{
		TeamName:   arg.TeamName,
		Namespace:  arg.Namespace,
		EntryKey:   arg.EntryKey,
		EntryValue: entryValue,
		Revision:   apiRes.Revision,
	}, nil
}

type putEntryAPIRes struct {
	libkb.AppStatusEmbed
	Revision int `json:"revision"`
}

func (h *KVStoreHandler) PutKVEntry(ctx context.Context, arg keybase1.PutKVEntryArg) (res keybase1.KVPutResult, err error) {
	h.Lock()
	defer h.Unlock()
	return h.putKVEntryLocked(ctx, arg)
}

func (h *KVStoreHandler) putKVEntryLocked(ctx context.Context, arg keybase1.PutKVEntryArg) (res keybase1.KVPutResult, err error) {
	ctx = libkb.WithLogTag(ctx, "KV")
	mctx := libkb.NewMetaContext(ctx, h.G())
	defer mctx.Trace(fmt.Sprintf("KVStoreHandler#PutKVEntry: t:%s, n:%s, k:%s, r:%d", arg.TeamName, arg.Namespace, arg.EntryKey, arg.Revision), &err)()
	if err := assertLoggedIn(ctx, h.G()); err != nil {
		mctx.Debug("not logged in err: %v", err)
		return res, err
	}
	teamID, err := h.resolveTeam(mctx, arg.TeamName)
	if err != nil {
		return res, err
	}
	entryID := keybase1.KVEntryID{
		TeamID:    teamID,
		Namespace: arg.Namespace,
		EntryKey:  arg.EntryKey,
	}

	revision := arg.Revision
	if revision == 0 {
		// fetch to get the correct revision when it's not specified
		getRes, err := h.getKVEntryLocked(ctx, keybase1.GetKVEntryArg{
			SessionID: arg.SessionID,
			TeamName:  arg.TeamName,
			Namespace: arg.Namespace,
			EntryKey:  arg.EntryKey,
		})
		if err != nil {
			err = fmt.Errorf("error fetching the revision before writing this entry: %s", err)
			mctx.Debug("%+v: %s", entryID, err)
			return res, err
		}
		revision = getRes.Revision + 1
	}

	mctx.Debug("updating %+v to revision %d", entryID, revision)
	ciphertext, teamKeyGen, ciphertextVersion, err := h.Boxer.Box(mctx, entryID, revision, arg.EntryValue)
	if err != nil {
		mctx.Debug("error boxing %+v: %v", entryID, err)
		return res, err
	}
	err = mctx.G().GetKVRevisionCache().CheckForUpdate(mctx, entryID, revision)
	if err != nil {
		mctx.Debug("error from cache for updating %+v: %s", entryID, err)
		return res, err
	}

	apiArg := libkb.APIArg{
		Endpoint:    "team/storage",
		SessionType: libkb.APISessionTypeREQUIRED,
		Args: libkb.HTTPArgs{
			"team_id":            libkb.S{Val: entryID.TeamID.String()},
			"team_key_gen":       libkb.I{Val: int(teamKeyGen)},
			"namespace":          libkb.S{Val: entryID.Namespace},
			"entry_key":          libkb.S{Val: entryID.EntryKey},
			"ciphertext":         libkb.S{Val: ciphertext},
			"ciphertext_version": libkb.I{Val: ciphertextVersion},
			"revision":           libkb.I{Val: revision},
		},
	}
	var apiRes putEntryAPIRes
	err = mctx.G().API.PostDecode(mctx, apiArg, &apiRes)
	if err != nil {
		mctx.Debug("error posting update for %+v to the server: %v", entryID, err)
		return res, err
	}
	if apiRes.Revision != revision {
		mctx.Debug("expected the server to return revision %d but got %d for %+v", revision, apiRes.Revision, entryID)
		return res, fmt.Errorf("kvstore PUT revision error. expected %d, got %d", revision, apiRes.Revision)
	}
	err = mctx.G().GetKVRevisionCache().Put(mctx, entryID, &ciphertext, teamKeyGen, revision)
	if err != nil {
		err = fmt.Errorf("error caching this new entry (try fetching it again): %s", err)
		mctx.Debug("%+v: %s", entryID, err)
		return res, err
	}
	return keybase1.KVPutResult{
		TeamName:  arg.TeamName,
		Namespace: arg.Namespace,
		EntryKey:  arg.EntryKey,
		Revision:  apiRes.Revision,
	}, nil
}

func (h *KVStoreHandler) DelKVEntry(ctx context.Context, arg keybase1.DelKVEntryArg) (res keybase1.KVDeleteEntryResult, err error) {
	h.Lock()
	defer h.Unlock()
	return h.delKVEntryLocked(ctx, arg)
}

func (h *KVStoreHandler) delKVEntryLocked(ctx context.Context, arg keybase1.DelKVEntryArg) (res keybase1.KVDeleteEntryResult, err error) {
	ctx = libkb.WithLogTag(ctx, "KV")
	mctx := libkb.NewMetaContext(ctx, h.G())
	defer mctx.Trace(fmt.Sprintf("KVStoreHandler#DeleteKVEntry: t:%s, n:%s, k:%s, r:%d", arg.TeamName, arg.Namespace, arg.EntryKey, arg.Revision), &err)()
	if err := assertLoggedIn(ctx, h.G()); err != nil {
		mctx.Debug("not logged in err: %v", err)
		return res, err
	}
	teamID, err := h.resolveTeam(mctx, arg.TeamName)
	if err != nil {
		return res, err
	}
	entryID := keybase1.KVEntryID{
		TeamID:    teamID,
		Namespace: arg.Namespace,
		EntryKey:  arg.EntryKey,
	}

	revision := arg.Revision
	if revision == 0 {
		getArg := keybase1.GetKVEntryArg{
			SessionID: arg.SessionID,
			TeamName:  arg.TeamName,
			Namespace: arg.Namespace,
			EntryKey:  arg.EntryKey,
		}
		getRes, err := h.getKVEntryLocked(ctx, getArg)
		if err != nil {
			err = fmt.Errorf("error fetching the revision before deleting this entry: %s", err)
			mctx.Debug("%+v: %s", entryID, err)
			return res, err
		}
		revision = getRes.Revision + 1
	}

	mctx.Debug("deleting %+v at revision %d", entryID, revision)
	err = mctx.G().GetKVRevisionCache().CheckForUpdate(mctx, entryID, revision)
	if err != nil {
		mctx.Debug("error from cache for deleting %+v: %s", entryID, err)
		return res, err
	}
	apiArg := libkb.APIArg{
		Endpoint:    "team/storage",
		SessionType: libkb.APISessionTypeREQUIRED,
		Args: libkb.HTTPArgs{
			"team_id":   libkb.S{Val: entryID.TeamID.String()},
			"namespace": libkb.S{Val: entryID.Namespace},
			"entry_key": libkb.S{Val: entryID.EntryKey},
			"revision":  libkb.I{Val: revision},
		},
	}
	apiRes, err := mctx.G().API.Delete(mctx, apiArg)
	if err != nil {
		mctx.Debug("error making delete request for entry %v: %v", entryID, err)
		return res, err
	}
	responseRevision, err := apiRes.Body.AtKey("revision").GetInt()
	if err != nil {
		mctx.Debug("error getting the revision from the server response: %v", err)
		err = fmt.Errorf("server response doesnt have a revision field: %s", err)
		return res, err
	}
	if responseRevision != revision {
		mctx.Debug("expected the server to return revision %d but got %d for %+v", revision, responseRevision, entryID)
		return res, fmt.Errorf("kvstore DEL revision error. expected %d, got %d", revision, responseRevision)
	}
	err = mctx.G().GetKVRevisionCache().MarkDeleted(mctx, entryID, revision)
	if err != nil {
		err = fmt.Errorf("error caching this now-deleted entry (try fetching it): %s", err)
		mctx.Debug("%+v: %s", entryID, err)
		return res, err
	}
	return keybase1.KVDeleteEntryResult{
		TeamName:  arg.TeamName,
		Namespace: arg.Namespace,
		EntryKey:  arg.EntryKey,
		Revision:  revision,
	}, nil
}

type getListNamespacesAPIRes struct {
	libkb.AppStatusEmbed
	TeamID     keybase1.TeamID `json:"team_id"`
	Namespaces []string        `json:"namespaces"`
}

func (h *KVStoreHandler) ListKVNamespaces(ctx context.Context, arg keybase1.ListKVNamespacesArg) (res keybase1.KVListNamespaceResult, err error) {
	h.Lock()
	defer h.Unlock()
	return h.listKVNamespaceLocked(ctx, arg)
}

func (h *KVStoreHandler) listKVNamespaceLocked(ctx context.Context, arg keybase1.ListKVNamespacesArg) (res keybase1.KVListNamespaceResult, err error) {
	ctx = libkb.WithLogTag(ctx, "KV")
	mctx := libkb.NewMetaContext(ctx, h.G())
	defer mctx.Trace(fmt.Sprintf("KVStoreHandler#ListKVNamespaces: t:%s", arg.TeamName), &err)()
	if err := assertLoggedIn(ctx, h.G()); err != nil {
		mctx.Debug("not logged in err: %v", err)
		return res, err
	}
	teamID, err := h.resolveTeam(mctx, arg.TeamName)
	if err != nil {
		return res, err
	}

	var apiRes getListNamespacesAPIRes
	apiArg := libkb.APIArg{
		Endpoint:    "team/storage/list",
		SessionType: libkb.APISessionTypeREQUIRED,
		Args: libkb.HTTPArgs{
			"team_id": libkb.S{Val: teamID.String()},
		},
	}
	err = mctx.G().API.GetDecode(mctx, apiArg, &apiRes)
	if err != nil {
		return res, err
	}
	if apiRes.TeamID != teamID {
		mctx.Debug("list KV Namespaces server returned an unexpected, mismatching teamID")
		return res, fmt.Errorf("expected teamID %s from the server, got %s", teamID, apiRes.TeamID)
	}
	return keybase1.KVListNamespaceResult{
		TeamName:   arg.TeamName,
		Namespaces: apiRes.Namespaces,
	}, nil
}

type getListEntriesAPIRes struct {
	libkb.AppStatusEmbed
	TeamID    keybase1.TeamID      `json:"team_id"`
	Namespace string               `json:"namespace"`
	EntryKeys []compressedEntryKey `json:"entry_keys"`
}

type compressedEntryKey struct {
	EntryKey string `json:"k"`
	Revision int    `json:"r"`
}

func (h *KVStoreHandler) ListKVEntries(ctx context.Context, arg keybase1.ListKVEntriesArg) (res keybase1.KVListEntryResult, err error) {
	h.Lock()
	defer h.Unlock()
	return h.listKVEntriesLocked(ctx, arg)
}

func (h *KVStoreHandler) listKVEntriesLocked(ctx context.Context, arg keybase1.ListKVEntriesArg) (res keybase1.KVListEntryResult, err error) {
	ctx = libkb.WithLogTag(ctx, "KV")
	mctx := libkb.NewMetaContext(ctx, h.G())
	defer mctx.Trace(fmt.Sprintf("KVStoreHandler#ListKVEntries: t:%s, n:%s", arg.TeamName, arg.Namespace), &err)()
	if err := assertLoggedIn(ctx, h.G()); err != nil {
		mctx.Debug("not logged in err: %v", err)
		return res, err
	}
	teamID, err := h.resolveTeam(mctx, arg.TeamName)
	if err != nil {
		return res, err
	}
	var apiRes getListEntriesAPIRes
	apiArg := libkb.APIArg{
		Endpoint:    "team/storage/list",
		SessionType: libkb.APISessionTypeREQUIRED,
		Args: libkb.HTTPArgs{
			"team_id":   libkb.S{Val: teamID.String()},
			"namespace": libkb.S{Val: arg.Namespace},
		},
	}
	err = mctx.G().API.GetDecode(mctx, apiArg, &apiRes)
	if err != nil {
		return res, err
	}
	if apiRes.TeamID != teamID {
		mctx.Debug("list KV Namespaces server returned an unexpected, mismatching teamID")
		return res, fmt.Errorf("expected teamID %s from the server, got %s", teamID, apiRes.TeamID)
	}
	if apiRes.Namespace != arg.Namespace {
		mctx.Debug("list KV EntryKeys server returned an unexpected, mismatching namespace")
		return res, fmt.Errorf("expected namespace %s from the server, got %s", arg.Namespace, apiRes.Namespace)
	}
	resKeys := []keybase1.KVListEntryKey{}
	for _, ek := range apiRes.EntryKeys {
		k := keybase1.KVListEntryKey{EntryKey: ek.EntryKey, Revision: ek.Revision}
		resKeys = append(resKeys, k)
	}
	return keybase1.KVListEntryResult{
		TeamName:  arg.TeamName,
		Namespace: arg.Namespace,
		EntryKeys: resKeys,
	}, nil
}


text:
package uk.ac.manchester.cs.owl.semspreadsheets.listeners;

import uk.ac.manchester.cs.owl.semspreadsheets.model.Range;

/**
 * @author Matthew Horridge
 */
public interface CellSelectionListener {

    void selectionChanged(Range range);
}


text:
Queues
======

Programming Assignment
----------------------

* http://coursera.cs.princeton.edu/algs4/assignments/queues.html


text:
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
    <title>or-tools/src/base/map-util.h Source File - Doxy</title>
    <link rel="shortcut icon" href="../../../favicon.ico">

    <link href="../../../doxygen.css" rel="stylesheet" type="text/css">
    <link href="../../../tabs.css" rel="stylesheet" type="text/css">

          Generated on: Thu Mar 29 07:46:58 PDT 2012
            for custom file set

        <tt>//
            doxy/
            or-tools/
            src/
            base/
            </tt>

Main Page

Namespaces

Classes

Files

or-tools/src/base/map-util.h
Go to the documentation of this file.

00001 // Copyright 2010-2012 Google
00002 // Licensed under the Apache License, Version 2.0 (the "License");
00003 // you may not use this file except in compliance with the License.
00004 // You may obtain a copy of the License at
00005 //
00006 //     http://www.apache.org/licenses/LICENSE-2.0
00007 //
00008 // Unless required by applicable law or agreed to in writing, software
00009 // distributed under the License is distributed on an "AS IS" BASIS,
00010 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00011 // See the License for the specific language governing permissions and
00012 // limitations under the License.
00013
00014 #ifndef OR_TOOLS_BASE_MAP_UTIL_H_
00015 #define OR_TOOLS_BASE_MAP_UTIL_H_
00016
00017 #include <utility>
00018
00019 namespace operations_research {
00020
00021 // Perform a lookup in a map or hash_map.
00022 // If the key is present in the map then the value associated with that
00023 // key is returned, otherwise the value passed as a default is returned.
00024 template <class Collection>
00025 const typename Collection::value_type::second_type&
00026 FindWithDefault(const Collection& collection,
00027                 const typename Collection::value_type::first_type& key,
00028                 const typename Collection::value_type::second_type& value) {
00029   typename Collection::const_iterator it = collection.find(key);
00030   if (it == collection.end()) {
00031     return value;
00032   }
00033   return it->second;
00034 }
00035
00036 // Perform a lookup in a map or hash_map.
00037 // If the key is present a const pointer to the associated value is returned,
00038 // otherwise a NULL pointer is returned.
00039 template <class Collection>
00040 const typename Collection::value_type::second_type*
00041 FindOrNull(const Collection& collection,
00042            const typename Collection::value_type::first_type& key) {
00043   typename Collection::const_iterator it = collection.find(key);
00044   if (it == collection.end()) {
00045     return 0;
00046   }
00047   return &it->second;
00048 }
00049
00050 // Perform a lookup in a map or hash_map.
00051 // Same as above but the returned pointer is not const and can be used to change
00052 // the stored value.
00053 template <class Collection>
00054 typename Collection::value_type::second_type*
00055 FindOrNull(Collection& collection,  // NOLINT
00056            const typename Collection::value_type::first_type& key) {
00057   typename Collection::iterator it = collection.find(key);
00058   if (it == collection.end()) {
00059     return 0;
00060   }
00061   return &it->second;
00062 }
00063
00064 // Perform a lookup in a map or hash_map whose values are pointers.
00065 // If the key is present a const pointer to the associated value is returned,
00066 // otherwise a NULL pointer is returned.
00067 // This function does not distinguish between a missing key and a key mapped
00068 // to a NULL value.
00069 template <class Collection>
00070 const typename Collection::value_type::second_type
00071 FindPtrOrNull(const Collection& collection,
00072               const typename Collection::value_type::first_type& key) {
00073   typename Collection::const_iterator it = collection.find(key);
00074   if (it == collection.end()) {
00075     return 0;
00076   }
00077   return it->second;
00078 }
00079
00080 // Change the value associated with a particular key in a map or hash_map.
00081 // If the key is not present in the map the key and value are inserted,
00082 // otherwise the value is updated to be a copy of the value provided.
00083 // True indicates that an insert took place, false indicates an update.
00084 template <class Collection, class Key, class Value>
00085 bool InsertOrUpdate(Collection * const collection,
00086                    const Key& key, const Value& value) {
00087   std::pair<typename Collection::iterator, bool> ret =
00088       collection->insert(typename Collection::value_type(key, value));
00089   if (!ret.second) {
00090     // update
00091     ret.first->second = value;
00092     return false;
00093   }
00094   return true;
00095 }
00096
00097 // Insert a new key and value into a map or hash_map.
00098 // If the key is not present in the map the key and value are
00099 // inserted, otherwise nothing happens. True indicates that an insert
00100 // took place, false indicates the key was already present.
00101 template <class Collection, class Key, class Value>
00102 bool InsertIfNotPresent(Collection * const collection,
00103                         const Key& key, const Value& value) {
00104   std::pair<typename Collection::iterator, bool> ret =
00105       collection->insert(typename Collection::value_type(key, value));
00106   return ret.second;
00107 }
00108
00109 // Inserts a new pair<key,value> into a map or hash_map.
00110 // Insert a new key into a set or hash_set.
00111 // Dies if the key is already present.
00112 template<class Collection>
00113 void InsertOrDie(Collection* const collection,
00114                  const typename Collection::value_type& value) {
00115   CHECK(collection->insert(value).second) << "duplicate value: " << value;
00116 }
00117
00118 // Inserts a new key/value into a map or hash_map.
00119 // Dies if the key is already present.
00120 template<class Collection>
00121 void InsertOrDie(Collection* const collection,
00122                  const typename Collection::value_type::first_type& key,
00123                  const typename Collection::value_type::second_type& data) {
00124   typedef typename Collection::value_type value_type;
00125   CHECK(collection->insert(value_type(key, data)).second)
00126     << "duplicate key: " << key;
00127 }
00128
00129 // Perform a lookup in map or hash_map.
00130 // If the key is present and value is non-NULL then a copy of the value
00131 // associated with the key is made into *value. Returns whether key was present.
00132 template <class Collection, class Key, class Value>
00133 bool FindCopy(const Collection& collection,
00134               const Key& key,
00135               Value* const value) {
00136   typename Collection::const_iterator it = collection.find(key);
00137   if (it == collection.end()) {
00138     return false;
00139   }
00140   if (value) {
00141     *value = it->second;
00142   }
00143   return true;
00144 }
00145
00146 // Test to see if a set, map, hash_set or hash_map contains a particular key.
00147 // Returns true if the key is in the collection.
00148 template <class Collection, class Key>
00149 bool ContainsKey(const Collection& collection, const Key& key) {
00150   typename Collection::const_iterator it = collection.find(key);
00151   return it != collection.end();
00152 }
00153
00154 template <class Collection>
00155 const typename Collection::value_type::second_type&
00156 FindOrDie(const Collection& collection,
00157           const typename Collection::value_type::first_type& key) {
00158   typename Collection::const_iterator it = collection.find(key);
00159   CHECK(it != collection.end()) << "Map key not found: " << key;
00160   return it->second;
00161 }
00162 }  // namespace operations_research
00163
00164 #endif  // OR_TOOLS_BASE_MAP_UTIL_H_


text:
package org.eclipse.bpel.ui.editparts.borders;

import org.eclipse.bpel.ui.BPELUIPlugin;
import org.eclipse.bpel.ui.IBPELUIConstants;
import org.eclipse.core.resources.IMarker;
import org.eclipse.draw2d.Graphics;
import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.ImageFigure;
import org.eclipse.draw2d.Label;
import org.eclipse.draw2d.geometry.Insets;
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.jface.resource.ColorRegistry;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.swt.graphics.Image;

/**
 * This border knows about collapsability. Specifically, it has icons for expand
 * and collapse, does hit testing for these icons, has an image and label to use
 * when collapsed, and does complete rendering when collapsed to look similar to
 * a leaf border (except with the addition of an expand icon).
 *
 * It does not do rendering for the expanded state. The rationale is that things
 * should look similar when collapsed (like a leaf node) but may have different
 * appearances when expanded.
 */
public abstract class CollapsableBorder extends GradientBorder {

	// Whether or not we are collapsed.
	private boolean collapsed = false;
	// The location of the collapsed image (+).
	protected Rectangle rectCollapsed;
	// The images for collapsed (+) and expanded (-).
	protected Image collapsedImage, expandedImage;
	// The width and height of the expanded image. Collapsed should be the same.
	protected int expandedWidth, expandedHeight;
	// The label to use when collapsed. Subclasses may also use it when expanded.
	protected Label collapsedNameLabel = null;
	// The image to use when collapsed. Subclasses may also use it when expanded.
	protected Image image;
	// The label containing the image.
	protected ImageFigure imageLabel = null;
	// Our parent figure. Used for relative location calculation.
	protected IFigure parentFigure;
	// The calculated rectangle for the collapsed border. This is null
	// when not collapsed, so subclasses shouldn't assume it's there.
	protected Rectangle collapsedBounds;
	// The calculated location of the top and bottom drawer images as well as
	// the top and bottom drawers themselves.
	protected Point topImageLocation = new Point(), bottomImageLocation = new Point();
	protected Point topDrawerLocation = new Point(), bottomDrawerLocation = new Point();
	// The calculated bounds of the rectangle to draw when collapsed
	protected Rectangle collapsedRectangle;

	public CollapsableBorder(boolean isVertical, int arcWidth, IFigure parentFigure, String labelText, Image image) {
		super(isVertical, arcWidth);
		this.parentFigure = parentFigure;

		this.image = image;
		this.imageLabel = new ImageFigure(image);

		this.collapsedImage = BPELUIPlugin.INSTANCE.getImage(IBPELUIConstants.ICON_FIGURE_COLLAPSED);
		this.expandedImage = BPELUIPlugin.INSTANCE.getImage(IBPELUIConstants.ICON_FIGURE_EXPANDED);
		this.expandedHeight = expandedImage.getBounds().height;
		this.expandedWidth = expandedImage.getBounds().width;

		this.collapsedNameLabel = new Label(labelText);
		this.collapsedNameLabel.setFont(JFaceResources.getFontRegistry().get(JFaceResources.DEFAULT_FONT));
	}

	/**
	 * Tests whether the given point is inside the collapsed image.
	 * The superclass only knows where the collapsed image is located; if subclasses
	 * want to do hit testing on the expanded image, they may override but may want
	 * to call super if we are collapsed.
	 */
	public boolean isPointInCollapseImage(int x, int y) {
		if (!isCollapsed()) return false;
		Point p = new Point(x,y);
		parentFigure.translateToRelative(p);
		Rectangle rect = rectCollapsed.getCopy();
		rect.expand(new Insets(1,1,1,1));
		return rect.contains(p);
	}

	public boolean isCollapsed() {
		return collapsed;
	}

	public void setCollapsed(boolean showCollapse) {
		this.collapsed = showCollapse;
	}

	/**
	 * Throw away computed values that determine the layout
	 */
	public void invalidate() {
		// rectCollapsed = null;
		collapsedBounds = null;
	}

	public Label getLabel() {
		return collapsedNameLabel;
	}

	public void setName(String name) {
		collapsedNameLabel.setText(name);
	}

	protected void calculate(IFigure figure) {
		// Calculate the coordinates for collapsed state, even though
		// we may currently be expanded.
		if (collapsedBounds == null) {
			collapsedBounds = figure.getBounds().getCopy();
			this.collapsedRectangle = collapsedBounds.getCopy();

			// Leave room on the left and right for the drawer.
			collapsedRectangle.x += DRAWER_WIDTH;
			collapsedRectangle.width -= DRAWER_WIDTH * 2;

			// area for collapsed button
			rectCollapsed = new Rectangle(collapsedBounds.x + collapsedBounds.width / 2 - expandedWidth/2, collapsedBounds.y + collapsedBounds.height - expandedHeight, expandedWidth, expandedHeight);
		}
	}

	/**
	 * This method first invalidates and recalculates any bounds, and then
	 * paints the top and bottom drawers, as well as any markers contained within them.
	 */

	public final void paint(IFigure figure, Graphics graphics, Insets insets) {
		invalidate();
		calculate(figure);
		doPaint(figure, graphics, insets);
	}

	/**
	 * Subclasses should call this paint method unless there is a very good
	 * reason for overriding its behaviour. To affect where various things
	 * appear, override the calculate() method.
	 */
	protected void doPaint(IFigure figure, Graphics graphics, Insets insets) {
		// Remember the clipping rectangle
		Rectangle oldClip = new Rectangle();
		oldClip = graphics.getClip(oldClip);

		IMarker topMarker = getTopMarker();
		IMarker bottomMarker = getBottomMarker();
		if (topMarker != null || bottomMarker != null) {
			ColorRegistry registry = BPELUIPlugin.INSTANCE.getColorRegistry();
			graphics.setForegroundColor(registry.get(IBPELUIConstants.COLOR_ACTIVITY_BORDER));
			Rectangle clippingRect;
			if (bottomMarker == null) {
				clippingRect = new Rectangle(topDrawerLocation.x, topDrawerLocation.y, DRAWER_WIDTH, DRAWER_HALF_HEIGHT + 1);
			} else if (topMarker == null) {
				clippingRect = new Rectangle(bottomDrawerLocation.x, bottomDrawerLocation.y, DRAWER_WIDTH, DRAWER_HALF_HEIGHT + 1);
			} else {
				clippingRect = new Rectangle(topDrawerLocation.x, topDrawerLocation.y, DRAWER_WIDTH, DRAWER_HEIGHT + 1);
			}
			graphics.setClip(clippingRect);
			// -1 due to GEF
			graphics.drawRoundRectangle(new Rectangle(topDrawerLocation.x + DRAWER_INSET, topDrawerLocation.y, DRAWER_WIDTH * 2, DRAWER_HEIGHT - 1), IBPELUIConstants.ARC_WIDTH, IBPELUIConstants.ARC_WIDTH);
			graphics.setClip(oldClip);
			if (bottomMarker == null || topMarker == null) {
				graphics.drawLine(topDrawerLocation.x + DRAWER_INSET, topDrawerLocation.y + DRAWER_HALF_HEIGHT, topDrawerLocation.x + DRAWER_WIDTH, topDrawerLocation.y + DRAWER_HALF_HEIGHT);
			}

		}

		// Draw the actual breakpoints
		Image topImage = getTopImage();
		if (topImage != null) {
			graphics.drawImage(topImage, topImageLocation);
		}
		Image bottomImage = getBottomImage();
		if (bottomImage != null) {
			graphics.drawImage(bottomImage, bottomImageLocation);
		}
	}

	/**
	 * We only know about the gradient rectangle when we are collapsed.
	 * TODO: Do we need a gradient rectangle when collapsed?
	 */

	protected Rectangle getGradientRect() {
		return new Rectangle(0,0,0,0);
	}

	public boolean isPointInTopDrawer(int x, int y) {
		if (getTopMarker() == null) return false;
		Point p = new Point(x, y);
		Image image = getTopImage();
		org.eclipse.swt.graphics.Rectangle imageSize = image.getBounds();
		Rectangle imageBounds = new Rectangle(topImageLocation.x, topImageLocation.y, imageSize.width, imageSize.height);
		return imageBounds.contains(p);
	}

	public boolean isPointInBottomDrawer(int x, int y) {
		if (getBottomMarker() == null) return false;
		Point p = new Point(x, y);
		Image image = getBottomImage();
		org.eclipse.swt.graphics.Rectangle imageSize = image.getBounds();
		Rectangle imageBounds = new Rectangle(bottomImageLocation.x, bottomImageLocation.y, imageSize.width, imageSize.height);
		return imageBounds.contains(p);
	}

	/**
	 * Calculate the insets when in the collapsed state. In expanded state, we don't
	 * know how to answer. Insets don't matter in the collapsed state because there
	 * are no children.
	 */

	public Insets getInsets(IFigure figure) {
		return new Insets(0, 0, 0, 0);
	}
}


text:
<?php
/**
 * User: Alex Gusev <alex@flancer64.com>
 */

namespace Praxigento\BonusHybrid\Service\Calc\SignUp\Debit\A\Repo\Query;

use Magento\Sales\Model\Order as MSaleOrder;
use Praxigento\BonusHybrid\Config as Cfg;
use Praxigento\Downline\Repo\Data\Customer as EDwnlCust;
use Praxigento\Pv\Repo\Data\Sale as EPvSale;

/**
 * Query to get data to process 'Sign Up Volume Debit' bonus
 * (this month's signed customers from distributors group with first order more then 100 PV).
 * This query return all sales for selected customers not only first ones, postprocessing is required for result set.
 * All sales are ordered by ID (natural creation order).
 */
class GetOrders
    extends \Praxigento\Core\App\Repo\Query\Builder
{
    /** Tables aliases for external usage ('camelCase' naming) */
    const AS_CUST = 'cust';
    const AS_DWNL = 'dwnl';
    const AS_INVOICE = 'invoice';
    const AS_PV = 'pv';
    const AS_SALE = 'sale';

    /** Columns/expressions aliases for external usage ('camelCase' naming) */
    const A_COUNTRY = EDwnlCust::A_COUNTRY_CODE;
    const A_CUST_ID = 'custId';
    const A_PV = 'pv';
    const A_SALE_ID = 'saleId';
    const A_SALE_INC_ID = 'saleIncId';

    /** Bound variables names ('camelCase' naming) */
    const BND_CUST_GROUP_ID = 'custGroupId';
    const BND_DATE_FROM = 'dateFrom';
    const BND_DATE_TO = 'dateTo';

    /** Entities are used in the query */
    const E_CUST = Cfg::ENTITY_MAGE_CUSTOMER;
    const E_DWNL = EDwnlCust::ENTITY_NAME;
    const E_INVOICE = Cfg::ENTITY_MAGE_SALES_INVOICE;
    const E_PV = EPvSale::ENTITY_NAME;
    const E_SALE = Cfg::ENTITY_MAGE_SALES_ORDER;

    public function build(\Magento\Framework\DB\Select $source = null)
    {
        /* this is root query builder (started from SELECT) */
        $result = $this->conn->select();

        /* define tables aliases for internal usage (in this method) */
        $asCust = self::AS_CUST;
        $asDwnl = self::AS_DWNL;
        $asInv = self::AS_INVOICE;
        $asPv = self::AS_PV;
        $asSale = self::AS_SALE;

        /* SELECT FROM customer_entity */
        $tbl = $this->resource->getTableName(self::E_CUST);
        $as = $asCust;
        $cols = [
            self::A_CUST_ID => Cfg::E_CUSTOMER_A_ENTITY_ID
        ];
        $result->from([$as => $tbl], $cols);

        /* LEFT JOIN prxgt_dwnl_customer */
        $tbl = $this->resource->getTableName(self::E_DWNL);
        $as = $asDwnl;
        $cols = [
            self::A_COUNTRY => EDwnlCust::A_COUNTRY_CODE
        ];
        $cond = $as . '.' . EDwnlCust::A_CUSTOMER_REF . '=' . $asCust . '.' . Cfg::E_CUSTOMER_A_ENTITY_ID;
        $result->joinLeft([$as => $tbl], $cond, $cols);

        /* LEFT JOIN sales_order */
        $tbl = $this->resource->getTableName(self::E_SALE);
        $as = $asSale;
        $cols = [
            self::A_SALE_ID => Cfg::E_SALE_ORDER_A_ENTITY_ID,
            self::A_SALE_INC_ID => Cfg::E_SALE_ORDER_A_INCREMENT_ID
        ];
        $cond = $as . '.' . Cfg::E_SALE_ORDER_A_CUSTOMER_ID . '=' . $asCust . '.' . Cfg::E_CUSTOMER_A_ENTITY_ID;
        $result->joinLeft([$as => $tbl], $cond, $cols);

        /* LEFT JOIN sales_invoice */
        $tbl = $this->resource->getTableName(self::E_INVOICE);
        $as = $asInv;
        $cols = [];
        $cond = $as . '.' . Cfg::E_SALE_INVOICE_A_ORDER_ID . '=' . $asSale . '.' . Cfg::E_SALE_ORDER_A_ENTITY_ID;
        $result->joinLeft([$as => $tbl], $cond, $cols);

        /* LEFT JOIN prxgt_pv_sale  */
        $tbl = $this->resource->getTableName(self::E_PV);
        $as = $asPv;
        $cols = [
            self::A_PV => EPvSale::A_TOTAL
        ];
        $cond = $as . '.' . EPvSale::A_SALE_REF . '=' . $asSale . '.' . Cfg::E_SALE_ORDER_A_ENTITY_ID;
        $result->joinLeft([$as => $tbl], $cond, $cols);

        /* WHERE */
        $conn = $this->resource->getConnection();
        $byCreatedAfter = $asCust . '.' . Cfg::E_CUSTOMER_A_CREATED_AT . '>=:' . self::BND_DATE_FROM;
        $byCreatedBefore = $asCust . '.' . Cfg::E_CUSTOMER_A_CREATED_AT . '<:' . self::BND_DATE_TO;
        $byCustGroup = $asCust . '.' . Cfg::E_CUSTOMER_A_GROUP_ID . '=:' . self::BND_CUST_GROUP_ID;
        $byPv = $asPv . '.' . EPvSale::A_TOTAL . ' >= 100';
        $quoted = $conn->quote(MSaleOrder::STATE_PROCESSING);
        $bySaleStateProcessing = $asSale . '.' . Cfg::E_SALE_ORDER_A_STATE . "=$quoted";
        $quoted = $conn->quote(MSaleOrder::STATE_COMPLETE);
        $bySaleStateComplete = $asSale . '.' . Cfg::E_SALE_ORDER_A_STATE . "=$quoted";
        $bySaleState = "($bySaleStateProcessing) OR ($bySaleStateComplete)";
        $quoted = $conn->quote(\Magento\Sales\Model\Order\Invoice::STATE_PAID);
        $byInvState = $asInv . '.' . Cfg::E_SALE_INVOICE_A_STATE . "=$quoted";
        $byInvCreated = $asInv . '.' . Cfg::E_SALE_INVOICE_A_CREATED_AT . '<:' . self::BND_DATE_TO;
        $where = "($byCreatedAfter) AND ($byCreatedBefore) AND ($byCustGroup) AND ($byPv) "
            . "AND ($bySaleState) AND ($byInvState) AND ($byInvCreated)";
        $result->where($where);

        /* ORDER by sale id */
        $order = $asSale . '.' . Cfg::E_SALE_ORDER_A_ENTITY_ID . ' ASC';
        $result->order($order);

        return $result;
    }
}


text:
<ion-view view-title="Pit Scouting">
    <ion-content overflow-scroll="true" padding="true" class="has-header">

            <form name="PitScoutForm">

                        Team number
                        <select
                            name="team"
                            id="team"
                            ng-options="option.number + ' - ' + option.name for option in teams track by option.id"
                            ng-model="team"
                            ng-change="selectTeam()"></select>

                        Robot name
                        <select
                            name="selectedRobot"
                            id="selectedRobot"
                            ng-options="option.name for option in robots track by option.id"
                            ng-model="selectedRobot"
                            ng-change="selectRobot()"></select>

                        What drive type does your robot have?
                        <input type="text" placeholder="" ng-model="driveType" ng-change="robotChanged()">

                        What is your robot's height in inches?
                        <input type="number" placeholder="" ng-model="height" ng-change="robotChanged()">

                        What is your strategy/what are your strengths?
                        <textarea placeholder="" ng-model="notes" ng-change="robotChanged()"> </textarea>

                        Does your robot run in autonomous?
                        <select
                            name="runAuto"
                            id="runAuto"
                            ng-options="option.name for option in data.yesNo track by option.id"
                            ng-model="runAuto"
                            ng-change="robotChanged()"
                            ng-disabled="disableFields()"></select>

                    <ion-item class="item-divider">Which of the outer works can you traverse in autonomous?</ion-item>

                    <ion-list>
                        <ion-checkbox
                            ng-repeat="owa in owaList track by $index"
                            class="checkbox-positive"
                            type="checkbox"
                            id="{{owa.id}}"
                            ng-model="owa.checked"
                            ng-true-value=1
                            ng-false-value=0
                            ng-change="robotChanged()">
                            {{ owa.label }}
                        </ion-checkbox>
                    </ion-list>

                    <ion-item class="item-divider">Which of the outer works can you traverse in teleop?</ion-item>

                    <ion-list>
                        <ion-checkbox
                            ng-repeat="owt in owtList track by $index"
                            class="checkbox-positive"
                            type="checkbox"
                            id="{{owT.id}}"
                            ng-model="owt.checked"
                            ng-true-value=1
                            ng-false-value=0
                            ng-change="robotChanged()">
                            {{ owt.label }}
                        </ion-checkbox>
                    </ion-list>

                    <ion-item class="item-divider">From what location does your robot score during autonomous?</ion-item>

                    <ion-list>
                        <ion-checkbox
                            ng-repeat="position in scorePosition track by $index"
                            class="checkbox-positive"
                            type="checkbox"
                            id="{{position.id}}"
                            ng-model="position.checked"
                            ng-true-value=1
                            ng-false-value=0
                            ng-change="robotChanged()">
                            {{ position.label }}
                        </ion-checkbox>
                    </ion-list>

                    <ion-item class="item-divider">How does your robot score tower damage points during teleop?</ion-item>

                    <ion-list>
                        <ion-checkbox
                            ng-repeat="topBottom in pickup track by $index"
                            class="checkbox-positive"
                            type="checkbox"
                            id="{{topBottom.id}}"
                            ng-model="topBottom.checked"
                            ng-true-value=1
                            ng-false-value=0
                            ng-change="robotChanged()">
                            {{ topBottom.label }}
                        </ion-checkbox>
                    </ion-list>

                    <ion-item class="item-divider">Where can your robot pick up boulders from?</ion-item>

                    <ion-list>
                        <ion-checkbox
                            ng-repeat="b in boulders track by $index"
                            class="checkbox-positive"
                            type="checkbox"
                            id="{{b.id}}"
                            ng-model="b.checked"
                            ng-true-value=1
                            ng-false-value=0
                            ng-change="robotChanged()">
                            {{ b.label }}
                        </ion-checkbox>
                    </ion-list>

                    <ion-item class="item-divider">Other questions</ion-item>

                    <ion-list>
                        <ion-checkbox
                            ng-repeat="q in randomQs track by $index"
                            class="checkbox-positive"
                            type="checkbox"
                            id="{{q.id}}"
                            ng-model="q.checked"
                            ng-true-value=1
                            ng-false-value=0
                            ng-change="robotChanged()">
                            {{ q.label }}
                        </ion-checkbox>
                    </ion-list>

                        Do you need a spy (human) to guide your robot?
                        <select
                            name="spyReq"
                            id="spyReq"
                            ng-options="option.name for option in data.yesNo track by option.id"
                            ng-model="spyReq"
                            ng-change="robotChanged()"
                            ng-disabled="disableFields()"></select>

                        Do you have a documented, easy-to-learn signaling method?
                        <select
                            name="spyDoc"
                            id="spyDoc"
                            ng-options="option.name for option in data.yesNo track by option.id"
                            ng-model="spyDoc"
                            ng-change="robotChanged()"
                            ng-disabled="disableFields()"></select>

            </form>

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


text:
/**
 * Open Payments Cloud Application API
 * Open Payments Cloud API
 *
 * OpenAPI spec version: 1.0.0
 *
 *
 * NOTE: This class is auto generated by the swagger code generator program.
 * https://github.com/swagger-api/swagger-codegen.git
 * Do not edit the class manually.
 *
 */

(function(root, factory) {
  if (typeof define === 'function' && define.amd) {
    // AMD. Register as an anonymous module.
    define(['ApiClient'], factory);
  } else if (typeof module === 'object' && module.exports) {
    // CommonJS-like environments that support module.exports, like Node.
    module.exports = factory(require('../ApiClient'));
  } else {
    // Browser globals (root is window)
    if (!root.OpenPaymentsCloudApplicationApi) {
      root.OpenPaymentsCloudApplicationApi = {};
    }
    root.OpenPaymentsCloudApplicationApi.ScaledAmount = factory(root.OpenPaymentsCloudApplicationApi.ApiClient);
  }
}(this, function(ApiClient) {
  'use strict';

  /**
   * The ScaledAmount model module.
   * @module model/ScaledAmount
   * @version 1.1.0
   */

  /**
   * Constructs a new ScaledAmount.
   * A floating point number, represented as a value and its scale. Its actual value can be obtained using the equation: value * pow(10, -scale).
   * @alias module:model/ScaledAmount
   * @class
   */
  var exports = function() {
    var _this = this;

  };

  /**
   * Constructs a ScaledAmount from a plain JavaScript object, optionally creating a new instance.
   * Copies all relevant properties from data to obj if supplied or a new instance if not.
   * @param {Object} data The plain JavaScript object bearing properties of interest.
   * @param {module:model/ScaledAmount} obj Optional instance to populate.
   * @return {module:model/ScaledAmount} The populated ScaledAmount instance.
   */
  exports.constructFromObject = function(data, obj) {
    if (data) {
      obj = obj || new exports();

      if (data.hasOwnProperty('value')) {
        obj['value'] = ApiClient.convertToType(data['value'], 'String');
      }
      if (data.hasOwnProperty('scale')) {
        obj['scale'] = ApiClient.convertToType(data['scale'], 'Number');
      }
    }
    return obj;
  }

  /**
   * @member {String} value
   */
  exports.prototype['value'] = undefined;
  /**
   * @member {Number} scale
   */
  exports.prototype['scale'] = undefined;

  return exports;
}));


text:
Usage = """

12-seq_metrics.py - version 1.1: limited ram to 2GB per core
Command:
cd InDir = /work/jelber2/immunome/call-SNPs-recal03
1.CalculateHSMetrics:
    java -Xmx2g -jar ~/bin/picard-tools-1.118/CalculateHsMetrics.jar \
    BAIT_INTERVALS=/work/jelber2/reference/immunome_baits_C_picta-3.0.3.list \
    BAIT_SET_NAME=Immunome \
    TARGET_INTERVALS=/work/jelber2/reference/immunome_targetregion_C_picta-3.0.3.list \
    METRIC_ACCUMULATION_LEVEL=SAMPLE \
    R=/work/jelber2/reference/C_picta-3.0.3.fa \
    I=Sample.bam \
    O=Sample.hsmetrics.txt

InDir = /work/jelber2/immunome/call-SNPs-recal03
Input Files = *.bam

Usage (execute following code in InDir):

~/scripts/immunome/12-seq_metrics.py Sample.bam

"""
###############################################################################
import os, sys, subprocess #imports os, sys, subprocess modules

if len(sys.argv)<2:
    print Usage
else:
    FileList = sys.argv[1:]
    RefDir = "/work/jelber2/reference"
    InDir = os.getcwd()
    OutDir = InDir
    for InFileName in FileList: # do the following steps for each file in the inputstream
        FileSuffix = ".bam"
        Sample = InFileName.replace(FileSuffix,'') # create file prefix string
        # Customize your job options here
        Queue = "single"
        Allocation = "hpc_gopo02"
        Processors = "nodes=1:ppn=1"
        WallTime = "01:00:00"
        LogOut = OutDir
        LogMerge = "oe"
        JobName = "seq-metrics-%s" % (Sample)
        Command ="""
        java -Xmx2g -jar ~/bin/picard-tools-1.118/CalculateHsMetrics.jar \
        BAIT_INTERVALS=/work/jelber2/reference/immunome_baits_C_picta-3.0.3.list \
        BAIT_SET_NAME=Immunome \
        TARGET_INTERVALS=/work/jelber2/reference/immunome_targetregion_C_picta-3.0.3.list \
        METRIC_ACCUMULATION_LEVEL=SAMPLE \
        R=/work/jelber2/reference/C_picta-3.0.3.fa \
        I=%s.bam \
        O=%s.hsmetrics.txt""" % (Sample, Sample)

        JobString = """
        #!/bin/bash
        #PBS -q %s
        #PBS -A %s
        #PBS -l %s
        #PBS -l walltime=%s
        #PBS -o %s
        #PBS -j %s
        #PBS -N %s

        cd %s
        %s\n""" % (Queue, Allocation, Processors, WallTime, LogOut, LogMerge, JobName, InDir, Command)

        #Create pipe to qsub
        proc = subprocess.Popen(['qsub'], shell=True,
          stdin=subprocess.PIPE, stdout=subprocess.PIPE, close_fds=True)
        (child_stdout, child_stdin) = (proc.stdout, proc.stdin)

        #Print JobString
        JobName = proc.communicate(JobString)[0]
        print JobString
        print JobName


text:
https://awonders.herokuapp.com/welcome

Awonders is a web application society to let members upload images of natures and wonderful images all over the world, Awonders will let us known ancient civilizations history, also Awanders will be mobile app to take photo easy and upload it, to view the best all over the world

# If you want to be sponser please contact with me :
# email: ibrahim.seniore@gmail.com
# phone: +20 01005092916

Welcome to Awonders.

![alt tag](https://raw.githubusercontent.com/ibrahim1hero1/awonders/master/readme/images/awonders.png).

This is the next phase of awonders and the main idea, just by letting users select how a wonderful rate about nature image that viewed, also allow users to put comments on images just comments , the main idea of awondersto view best nature places and ancient civilizations.

![alt tag](https://raw.githubusercontent.com/ibrahim1hero1/awonders/master/readme/images/2017-01-16_001535.png).


text:
package org.apache.geode.internal.cache;

import java.util.Collections;
import java.util.Iterator;

import org.apache.logging.log4j.Logger;

import org.apache.geode.cache.CacheRuntimeException;
import org.apache.geode.distributed.internal.DistributionManager;
import org.apache.geode.internal.logging.LogService;

public class DistTXAdjunctCommitMessage extends TXCommitMessage {

  private static final Logger logger = LogService.getLogger();

  public DistTXAdjunctCommitMessage(TXId txIdent, DistributionManager dm, TXState txState) {
    super(txIdent, dm, txState);
  }

  @Override
  public void basicProcessOps() {
    Collections.sort(this.farSideEntryOps);
    Iterator it = this.farSideEntryOps.iterator();
    while (it.hasNext()) {
      try {
        RegionCommit.FarSideEntryOp entryOp = (RegionCommit.FarSideEntryOp) it.next();
        entryOp.processAdjunctOnly();
      } catch (CacheRuntimeException problem) {
        processCacheRuntimeException(problem);
      } catch (Exception e) {
        addProcessingException(e);
      }
    }
  }
}


text:
from database.dict_converters.converter_base import ConverterBase

class MediaConverter(ConverterBase):
    SUBVERSIONS = {  # Increment every time a change to the dict is made
        3: 2,
    }

    @classmethod
    def _convert(cls, medias, dict_version):
        MEDIA_CONVERTERS = {
            3: cls.mediasConverter_v3,
        }
        return MEDIA_CONVERTERS[dict_version](medias)

    @classmethod
    def mediasConverter_v3(cls, medias):
        medias = map(cls.mediaConverter_v3, medias)
        return medias

    @classmethod
    def mediaConverter_v3(cls, media):
        return {
            'type': media.slug_name,
            'foreign_key': media.foreign_key,
            'details': media.details if media.details else {},
            'preferred': True if media.preferred_references != [] else False,
        }


text:
package com.evolveum.midpoint.web.util;

import com.evolveum.midpoint.gui.api.GuiStyleConstants;
import com.evolveum.midpoint.schema.constants.ObjectTypes;

/**
 * @author lazyman
 */
public enum ObjectTypeGuiDescriptor {

    CONNECTOR(ObjectTypes.CONNECTOR, "ObjectTypeGuiDescriptor.connector", "silk-link", "silk-link"),

    CONNECTOR_HOST(ObjectTypes.CONNECTOR_HOST, "ObjectTypeGuiDescriptor.connectorHost", "silk-driver_link", "silk-driver_link"),

    GENERIC_OBJECT(ObjectTypes.GENERIC_OBJECT, "ObjectTypeGuiDescriptor.genericObject", "silk-page_white_code", "silk-page_white_code"),

    RESOURCE(ObjectTypes.RESOURCE, "ObjectTypeGuiDescriptor.resource", GuiStyleConstants.CLASS_OBJECT_RESOURCE_ICON_COLORED, GuiStyleConstants.CLASS_OBJECT_RESOURCE_ICON),

    USER(ObjectTypes.USER, "ObjectTypeGuiDescriptor.user", GuiStyleConstants.CLASS_OBJECT_USER_ICON_COLORED, GuiStyleConstants.CLASS_OBJECT_USER_ICON),

    OBJECT_TEMPLATE(ObjectTypes.OBJECT_TEMPLATE, "ObjectTypeGuiDescriptor.objectTemplate", "silk-layout", "silk-layout"),

    SYSTEM_CONFIGURATION(ObjectTypes.SYSTEM_CONFIGURATION, "ObjectTypeGuiDescriptor.systemConfiguration", "silk-page_white_gear", "silk-page_white_gear"),

    TASK(ObjectTypes.TASK, "ObjectTypeGuiDescriptor.task", GuiStyleConstants.CLASS_OBJECT_TASK_ICON_COLORED, GuiStyleConstants.CLASS_OBJECT_TASK_ICON),

    SHADOW(ObjectTypes.SHADOW, "ObjectTypeGuiDescriptor.shadow", "silk-status_online", "silk-status_online"),

    OBJECT(ObjectTypes.OBJECT, "ObjectTypeGuiDescriptor.object", "silk-page_white", "silk-page_white"),

    ROLE(ObjectTypes.ROLE, "ObjectTypeGuiDescriptor.role", GuiStyleConstants.CLASS_OBJECT_ROLE_ICON_COLORED, GuiStyleConstants.CLASS_OBJECT_ROLE_ICON),

    VALUE_POLICY(ObjectTypes.PASSWORD_POLICY, "ObjectTypeGuiDescriptor.valuePolicy", "silk-lock", "silk-lock"),

    NODE(ObjectTypes.NODE, "ObjectTypeGuiDescriptor.node", "silk-computer", "silk-computer"),

    FORM(ObjectTypes.FORM, "ObjectTypeGuiDescriptor.form", "", ""),

    ORG(ObjectTypes.ORG, "ObjectTypeGuiDescriptor.org", GuiStyleConstants.CLASS_OBJECT_ORG_ICON_COLORED, GuiStyleConstants.CLASS_OBJECT_ORG_ICON),

    ABSTRACT_ROLE(ObjectTypes.ABSTRACT_ROLE, "ObjectTypeGuiDescriptor.abstractRole", "silk-award_star_gold_3", "silk-award_star_gold_3"),

    FOCUS(ObjectTypes.FOCUS_TYPE, "ObjectTypeGuiDescriptor.focus", "", ""),

    REPORT(ObjectTypes.REPORT, "ObjectTypeGuiDescriptor.report", "", ""),

    REPORT_OUTPUT(ObjectTypes.REPORT_OUTPUT, "ObjectTypeGuiDescriptor.reportOutput", "", ""),

    SECURITY_POLICY(ObjectTypes.SECURITY_POLICY, "ObjectTypeGuiDescriptor.securityPolicy", "", ""),

    LOOKUP_TABLE(ObjectTypes.LOOKUP_TABLE, "ObjectTypeGuiDescriptor.lookupTable", "", ""),

    ACCESS_CERTIFICATION_DEFINITION(ObjectTypes.ACCESS_CERTIFICATION_DEFINITION, "ObjectTypeGuiDescriptor.accessCertificationDefinition", "", ""),

    ACCESS_CERTIFICATION_CAMPAIGN(ObjectTypes.ACCESS_CERTIFICATION_CAMPAIGN, "ObjectTypeGuiDescriptor.accessCertificationCampaign", "", ""),

    SEQUENCE(ObjectTypes.SEQUENCE, "ObjectTypeGuiDescriptor.sequence", "", ""),

    SERVICE(ObjectTypes.SERVICE, "ObjectTypeGuiDescriptor.service", GuiStyleConstants.CLASS_OBJECT_SERVICE_ICON_COLORED, GuiStyleConstants.CLASS_OBJECT_SERVICE_ICON),

    CASE(ObjectTypes.CASE, "ObjectTypeGuiDescriptor.case", "", ""),             // TODO icons

    FUNCTION_LIBRARY(ObjectTypes.FUNCTION_LIBRARY, "ObjectTypeGuiDescriptor.functionLibrary", "", ""),      // TODO icons

    OBJECT_COLLECTION(ObjectTypes.OBJECT_COLLECTION, "ObjectTypeGuiDescriptor.objectCollection", "", ""),      // TODO icons

    ARCHETYPE(ObjectTypes.ARCHETYPE, "ObjectTypeGuiDescriptor.archetype", "", ""),      // TODO icons

    DASHBOARD(ObjectTypes.DASHBOARD, "ObjectTypeGuiDescriptor.dashboard", "fa fa-dashboard", "fa fa-dashboard"),

    ASSIGNMENT_HOLDER_TYPE(ObjectTypes.ASSIGNMENT_HOLDER_TYPE, "ObjectTypeGuiDescriptor.assignmentHolderType", "", ""); //TODO icons

    public static final String ERROR_ICON = "silk-error";
    public static final String ERROR_LOCALIZATION_KEY = "ObjectTypeGuiDescriptor.unknown";

    private ObjectTypes type;
    private String localizationKey;
    private String coloredIcon;
    private String blackIcon;

    ObjectTypeGuiDescriptor(ObjectTypes type, String localizationKey, String coloredIcon, String blackIcon) {
        this.coloredIcon = coloredIcon;
        this.blackIcon = blackIcon;
        this.localizationKey = localizationKey;
        this.type = type;
    }

    @SuppressWarnings("unused")
    public String getColoredIcon() {
        return coloredIcon;
    }

    public String getBlackIcon() {
        return blackIcon;
    }

    public String getLocalizationKey() {
        return localizationKey;
    }

    public ObjectTypes getType() {
        return type;
    }

    public static ObjectTypeGuiDescriptor getDescriptor(Class type) {
        for (ObjectTypeGuiDescriptor descr : ObjectTypeGuiDescriptor.values()) {
            if (descr.getType() != null && descr.getType().getClassDefinition().equals(type)) {
                return descr;
            }
        }

        return null;
    }

    public static ObjectTypeGuiDescriptor getDescriptor(ObjectTypes type) {
        if (type == null) {
            return null;
        }
        for (ObjectTypeGuiDescriptor descr : ObjectTypeGuiDescriptor.values()) {
            if (descr.getType() != null && descr.getType().equals(type)) {
                return descr;
            }
        }

        return null;
    }
}


text:
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using Baseline;
using Marten.Linq;
using Marten.Schema;
using Marten.Testing;
using Marten.Util;
using StoryTeller;
using StoryTeller.Grammars.Tables;
using StructureMap;

namespace Marten.Storyteller.Fixtures
{
    public class LinqFixture : Fixture
    {
        private IContainer _container;
        private readonly LightweightCache<Guid, string> _idToName = new LightweightCache<Guid, string>();
        private IDocumentSession _session;
        private readonly Dictionary<string, Expression<Func<Target, bool>>> _wheres = new Dictionary<string, Expression<Func<Target, bool>>>();

        public LinqFixture()
        {
            Title = "Linq Support";

            // set the expressions
            expression(x => x.Number == 1);
            expression(x => x.Number > 3);
            expression(x => x.Number < 3);
            expression(x => x.Number <= 3);
            expression(x => x.Number >= 3);
            expression(x => x.Number != 3);

            expression(x => x.Long == 1);
            expression(x => x.Long > 3);
            expression(x => x.Long < 3);
            expression(x => x.Long <= 3);
            expression(x => x.Long >= 3);
            expression(x => x.Long != 3);

            expression(x => x.String == "A");
            expression(x => x.String.Equals("a", StringComparison.OrdinalIgnoreCase));
            expression(x => string.Equals(x.String, "a", StringComparison.OrdinalIgnoreCase));
            expression(x => string.Equals("a", x.String, StringComparison.OrdinalIgnoreCase));
            expression(x => x.String.Equals("A", StringComparison.Ordinal));
            expression(x => x.String != "A");

            expression(x => x.String == "A" && x.Number == 1);
            expression(x => x.String == "A" || x.Number == 1);

            expression(x => x.String.Contains("B"));
            expression(x => x.String.Contains("b", StringComparison.OrdinalIgnoreCase));
            expression(x => x.String.StartsWith("Bar"), "x.String.StartsWith(\"Bar\")");
            expression(x => x.String.StartsWith("bar", StringComparison.OrdinalIgnoreCase), "x.String.StartsWith(\"bar\", StringComparison.OrdinalIgnoreCase)");
            expression(x => x.String.EndsWith("Foo"), "x.String.EndsWith(\"Foo\")");
            expression(x => x.String.EndsWith("foo", StringComparison.OrdinalIgnoreCase), "x.String.EndsWith(\"Foo\", StringComparison.OrdinalIgnoreCase)");

            expression(x => x.String == null);

            expression(x => x.Flag);
            expression(x => x.Flag == true);
            expression(x => !x.Flag, "!Flag");
            expression(x => x.Flag == false);

            expression(x => x.Inner.Flag, "Inner.Flag");
            expression(x => !x.Inner.Flag, "!Inner.Flag");
            expression(x => x.Inner.Flag == true);
            expression(x => x.Inner.Flag == false);

            expression(x => x.Double == 10);
            expression(x => x.Double != 10);
            expression(x => x.Double > 10);
            expression(x => x.Double < 10);
            expression(x => x.Double <= 10);
            expression(x => x.Double >= 10);

            expression(x => x.Decimal == 10);
            expression(x => x.Decimal != 10);
            expression(x => x.Decimal > 10);
            expression(x => x.Decimal < 10);
            expression(x => x.Decimal <= 10);
            expression(x => x.Decimal >= 10);

            var today = DateTime.Today.ToUniversalTime();

            expression(x => x.Date == today, "x.Date == Today");
            expression(x => x.Date != today, "x.Date != Today");
            expression(x => x.Date > today, "x.Date > Today");
            expression(x => x.Date < today, "x.Date < Today");
            expression(x => x.Date >= today, "x.Date >= Today");
            expression(x => x.Date <= today, "x.Date <= Today");

            AddSelectionValues("Expressions", _wheres.Keys.ToArray());

            AddSelectionValues("Fields", typeof(Target).GetProperties().Where(x => TypeMappings.HasTypeMapping(x.PropertyType)).Select(x => x.Name).ToArray());
        }

        public override void SetUp()
        {
            _idToName.ClearAll();

            _container = Container.For<DevelopmentModeRegistry>();
            _container.GetInstance<IDocumentStore>().Advanced.Clean.CompletelyRemoveAll();

            _session = _container.GetInstance<IDocumentStore>().OpenSession();

        }

        private void expression(Expression<Func<Target, bool>> where, string key = null)
        {
            if (key.IsEmpty())
            {
                key = @where.As<LambdaExpression>().Body.ToString().TrimStart('(').TrimEnd(')').Replace(") AndAlso (", " && ").Replace(") OrElse (", " || ");
            }
            _wheres.Add(key, where);
        }

        public override void TearDown()
        {
            _session.Dispose();
            _container.Dispose();
        }

        [FormatAs("The field {field} is configured to be duplicated")]
        public void FieldIsDuplicated([SelectionList("Fields")] string field)
        {
            _container.GetInstance<IDocumentSchema>().MappingFor(typeof(Target)).As<DocumentMapping>().DuplicateField(field);
        }

        public IGrammar TheDocumentsAre()
        {
            return CreateNewObject<Target>("Documents", _ =>
            {
                _.WithInput<string>("Name").Configure((target, name) =>
                {
                    _idToName[target.Id] = name;
                }).Header("Document Name");

                _.SetProperty(x => x.Number).DefaultValue("1");
                _.SetProperty(x => x.Long).DefaultValue("1");
                _.SetProperty(x => x.String).DefaultValue("Max");
                _.SetProperty(x => x.Flag).DefaultValue("false");
                _.SetProperty(x => x.Double).DefaultValue("1");
                _.SetProperty(x => x.Decimal).DefaultValue("1");
                _.SetProperty(x => x.Date).DefaultValue("TODAY");

                _.WithInput<bool>("InnerFlag").Configure((target, flag) =>
                {
                    if (target.Inner == null)
                    {
                        target.Inner = new Target();
                    }

                    target.Inner.Flag = flag;

                });

                _.Do(t =>
                {
                    t.Date = t.Date.ToUniversalTime();
                    _session.Store(t);
                });
            }).AsTable("If the documents are").After(() => _session.SaveChanges());
        }

        [ExposeAsTable("Executing queries")]
        public void ExecutingQuery([SelectionList("Expressions"), Header("Where Clause")]string WhereClause, out ResultSet Results)
        {
            var expression = _wheres[WhereClause];
            var queryable = _session.Query<Target>().Where(expression);
            var command = queryable.ToCommand(FetchType.FetchMany);
            var sql = command.CommandText;
            Debug.WriteLine(sql + ", " + command.Parameters.Select(x => $"{x.ParameterName} = {x.Value}").Join(", "));

            Results = new ResultSet(queryable.ToArray().Select(x => _idToName[x.Id]).ToArray());
        }
    }
}


text:
<?php

namespace Magento\GoogleAnalytics\Helper;

use Magento\Store\Model\Store;

/**
 * GoogleAnalytics data helper
 *
 */
class Data extends \Magento\Framework\App\Helper\AbstractHelper
{
    /**
     * Config paths for using throughout the code
     */
    const XML_PATH_ACTIVE = 'google/analytics/active';

    const XML_PATH_ACCOUNT = 'google/analytics/account';

    /**
     * Core store config
     *
     * @var \Magento\Framework\App\Config\ScopeConfigInterface
     */
    protected $_scopeConfig;

    /**
     * @param \Magento\Framework\App\Helper\Context $context
     * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
     */
    public function __construct(
        \Magento\Framework\App\Helper\Context $context,
        \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
    ) {
        $this->_scopeConfig = $scopeConfig;
        parent::__construct($context);
    }

    /**
     * Whether GA is ready to use
     *
     * @param null|string|bool|int|Store $store
     * @return bool
     */
    public function isGoogleAnalyticsAvailable($store = null)
    {
        $accountId = $this->_scopeConfig->getValue(self::XML_PATH_ACCOUNT, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, $store);
        return $accountId && $this->_scopeConfig->isSetFlag(self::XML_PATH_ACTIVE, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, $store);
    }
}


text:
using namespace std;

//#include <iostream>
void Observer::IterationError::postIteration(BackPropagation const& learner){
    outf << learner.current_iteration << "," << learner.N.testDataSet(*data, *loss) << endl;

	//cout << learner.current_iteration << "," << learner.N.testDataSet(*data, *loss) << endl;
}


text:
/* See license.txt for terms of usage */

"use strict";

// Add-on SDK
const { Cc, Ci, Cu } = require("chrome");
const Events = require("sdk/event/core");

// DevTools
const { devtools } = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});

// xxxHonza: is this really required?
devtools["require"]("devtools/server/actors/inspector");

let protocol = devtools["require"]("devtools/server/protocol");
let { method, ActorClass, FrontClass, Front, Actor, Arg } = protocol;

/**
 * A method decorator that ensures the actor is in the expected state before
 * proceeding. If the actor is not in the expected state, the decorated method
 * returns a rejected promise.
 *
 * @param String expectedState
 *        The expected state.
 *
 * @param Function method
 *        The actor method to proceed with when the actor is in the expected
 *        state.
 *
 * @returns Function
 *          The decorated method.
 */
function expectState(expectedState, method) {
  return function(...args) {
    if (this.state !== expectedState) {
      const msg = "Wrong State: Expected '" + expectedState + "', but current "
                + "state is '" + this.state + "'";
      return Promise.reject(new Error(msg));
    }

    return method.apply(this, args);
  };
}

/**
 * TODO: description
 */
var MyActor = ActorClass({
  typeName: "myactor",

  /**
   * Events emitted by this actor.
   */
  events: {
    "click": {
      type: "click",
      node: Arg(0, "disconnectedNode"),
    }
  },

  initialize: function(conn, parent) {
    Actor.prototype.initialize.call(this, conn);

    this.parent = parent;
    this.state = "detached";

    this.onNavigate = this.onNavigate.bind(this);
    this.onClick = this.onClick.bind(this);
  },

  destroy: function() {
    if (this.state === "attached") {
      this.detach();
    }

    Actor.prototype.destroy.call(this);
  },

  /**
   * Attach to this actor.
   */
  attach: method(expectState("detached", function(walkerActorID) {
    this.walkerActorID = walkerActorID;
    this.state = "attached";

    Events.on(this.parent, "navigate", this.onNavigate);

    this.registerEventHandler();
  }), {
    request: {
      walkerActorID: Arg(0, "string"),
    },
    response: {
      type: "attached"
    }
  }),

  /**
   * Detach from this actor.
   */
  detach: method(expectState("attached", function() {
    this.state = "detached";
  }), {
    request: {},
    response: {
      type: "detached"
    }
  }),

  /**
   * Page navigation handler.
   */
  onNavigate: function({isTopLevel}) {
    this.registerEventHandler();
  },

  registerEventHandler: function() {
    let win = this.parent.window;
    win.addEventListener("click", this.onClick, true);
  },

  onClick: function(event) {
    let threadActor = this.parent.threadActor;
    let walkerActor = this.conn.getActor(this.walkerActorID);
    if (!walkerActor) {
      return;
    }

    let data = walkerActor.attachElement(event.target);

    // Send the click event to the client.
    Events.emit(this, "click", data);
  }
});

exports.MyActor = MyActor;

exports.MyActorFront = FrontClass(MyActor, {
  initialize: function(client, form) {
    Front.prototype.initialize.call(this, client, form);

    this.actorID = form[MyActor.prototype.typeName];
    this.manage(this);
  },

  attach: protocol.custom(function(walkerFront) {
    this.walkerFront = walkerFront;
    return this._attach(this.walkerFront.actorID);
  }, {impl: "_attach"}),

  ensureParentFront: function(...args) {
    this.walkerFront.ensureParentFront.apply(this.walkerFront, args);
  }
});

// Exports from this module


text:
package com.jfixby.scarabei.red.geometry;

import com.jfixby.scarabei.api.geometry.GeometricShape;

public class VertexMaster implements GeometricShape {

	final private RedTransform transform = new RedTransform();

	public RedTransform getTransform () {
		return this.transform;
	}

}


text:
package pgx

import (
	"context"

	"github.com/jackc/pgx/v5/pgconn"
)

// QueryTracer traces Query, QueryRow, and Exec.
type QueryTracer interface {
	// TraceQueryStart is called at the beginning of Query, QueryRow, and Exec calls. The returned context is used for the
	// rest of the call and will be passed to TraceQueryEnd.
	TraceQueryStart(ctx context.Context, conn *Conn, data TraceQueryStartData) context.Context

	TraceQueryEnd(ctx context.Context, conn *Conn, data TraceQueryEndData)
}

type TraceQueryStartData struct {
	SQL  string
	Args []any
}

type TraceQueryEndData struct {
	CommandTag pgconn.CommandTag
	Err        error
}

// BatchTracer traces SendBatch.
type BatchTracer interface {
	// TraceBatchStart is called at the beginning of SendBatch calls. The returned context is used for the
	// rest of the call and will be passed to TraceBatchQuery and TraceBatchEnd.
	TraceBatchStart(ctx context.Context, conn *Conn, data TraceBatchStartData) context.Context

	TraceBatchQuery(ctx context.Context, conn *Conn, data TraceBatchQueryData)
	TraceBatchEnd(ctx context.Context, conn *Conn, data TraceBatchEndData)
}

type TraceBatchStartData struct {
	Batch *Batch
}

type TraceBatchQueryData struct {
	SQL        string
	Args       []any
	CommandTag pgconn.CommandTag
	Err        error
}

type TraceBatchEndData struct {
	Err error
}

// CopyFromTracer traces CopyFrom.
type CopyFromTracer interface {
	// TraceCopyFromStart is called at the beginning of CopyFrom calls. The returned context is used for the
	// rest of the call and will be passed to TraceCopyFromEnd.
	TraceCopyFromStart(ctx context.Context, conn *Conn, data TraceCopyFromStartData) context.Context

	TraceCopyFromEnd(ctx context.Context, conn *Conn, data TraceCopyFromEndData)
}

type TraceCopyFromStartData struct {
	TableName   Identifier
	ColumnNames []string
}

type TraceCopyFromEndData struct {
	CommandTag pgconn.CommandTag
	Err        error
}

// PrepareTracer traces Prepare.
type PrepareTracer interface {
	// TracePrepareStart is called at the beginning of Prepare calls. The returned context is used for the
	// rest of the call and will be passed to TracePrepareEnd.
	TracePrepareStart(ctx context.Context, conn *Conn, data TracePrepareStartData) context.Context

	TracePrepareEnd(ctx context.Context, conn *Conn, data TracePrepareEndData)
}

type TracePrepareStartData struct {
	Name string
	SQL  string
}

type TracePrepareEndData struct {
	AlreadyPrepared bool
	Err             error
}

// ConnectTracer traces Connect and ConnectConfig.
type ConnectTracer interface {
	// TraceConnectStart is called at the beginning of Connect and ConnectConfig calls. The returned context is used for
	// the rest of the call and will be passed to TraceConnectEnd.
	TraceConnectStart(ctx context.Context, data TraceConnectStartData) context.Context

	TraceConnectEnd(ctx context.Context, data TraceConnectEndData)
}

type TraceConnectStartData struct {
	ConnConfig *ConnConfig
}

type TraceConnectEndData struct {
	Conn *Conn
	Err  error
}


text:
<!DOCTYPE html>
<html>
<head>
    <title>GeoExplorer::Kaart</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link rel="shortcut icon" href="../theme/app/img/favicon.ico">
    <!-- Ext resources -->
    <link rel="stylesheet" type="text/css" href="../externals/ext/resources/css/ext-all.css">
    <link rel="stylesheet" type="text/css" href="../externals/ext/resources/css/xtheme-gray.css">

    <script type="text/javascript" src="../externals/ext/adapter/ext/ext-base.js"></script>
    <script src="../externals/ext/ext-all.js"></script> <!-- deze wordt gevonden -->

    <script src="../externals/OpenLayers-2.13.1/OpenLayers.js"></script> <!-- check-->
    <!--script src="../script/app/OpenLS_XLSReader.js" type="text/javascript"></script-->

    <script src="../externals/GeoExt/lib/GeoExt.js"></script>
    <script src="../externals/gxp/src/script/loader.js"></script>
    <script src="../externals/proj4js/lib/proj4js-combined.js"></script>
    <script src="../script/app/jquery-1.7.1.js"></script>
    <script src="../script/app/geoneer.js"></script>
    <script src="../script/app/Heron.js"></script>
    <script src="../script/app/OpenLSSearchCombo.js"></script>

    <link rel="stylesheet" type="text/css" href="../externals/openlayers/theme/default/style.css">

    <!-- GeoExt resources -->
    <link rel="stylesheet" type="text/css" href="../externals/GeoExt/resources/css/popup.css">
    <link rel="stylesheet" type="text/css" href="../externals/GeoExt/resources/css/layerlegend.css">
    <link rel="stylesheet" type="text/css" href="../externals/GeoExt/resources/css/gxtheme-gray.css">
    <!-- gxp resources -->
    <link rel="stylesheet" type="text/css" href="../externals/gxp/src/theme/all.css">
    {{{content}}}
</head>
<body>
</body>
</html>


text:
package p059

import "testing"

func TestExample0(t *testing.T) {
	generateMatrix(0)
}

func TestExample1(t *testing.T) {
	generateMatrix(1)
}

func TestExample2(t *testing.T) {
	generateMatrix(2)
}

func TestExample3(t *testing.T) {
	generateMatrix(3)
}