text:
package com.codedisaster.steamworks.test;

import com.codedisaster.steamworks.*;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.Collection;

public class SteamClientAPITestApp extends SteamTestApp {

	private SteamUser user;
	private SteamUserStats userStats;
	private SteamRemoteStorage remoteStorage;
	private SteamUGC ugc;
	private SteamUtils utils;
	private SteamApps apps;
	private SteamFriends friends;

	private SteamLeaderboardHandle currentLeaderboard = null;

	private SteamUserStatsCallback userStatsCallback = new SteamUserStatsCallback() {
		@Override
		public void onUserStatsReceived(long gameId, SteamID steamIDUser, SteamResult result) {
			System.out.println("User stats received: gameId=" + gameId + ", userId=" + steamIDUser.getAccountID() +
					", result=" + result.toString());

			int numAchievements = userStats.getNumAchievements();
			System.out.println("Num of achievements: " + numAchievements);

			for (int i = 0; i < numAchievements; i++) {
				String name = userStats.getAchievementName(i);
				boolean achieved = userStats.isAchieved(name, false);
				System.out.println("# " + i + " : name=" + name + ", achieved=" + (achieved ? "yes" : "no"));
			}
		}

		@Override
		public void onUserStatsStored(long gameId, SteamResult result) {
			System.out.println("User stats stored: gameId=" + gameId +
					", result=" + result.toString());
		}

		@Override
		public void onLeaderboardFindResult(SteamLeaderboardHandle leaderboard, boolean found) {
			System.out.println("Leaderboard find result: handle=" + leaderboard.toString() +
					", found=" + (found ? "yes" : "no"));

			if (found) {
				System.out.println("Leaderboard: name=" + userStats.getLeaderboardName(leaderboard) +
						", entries=" + userStats.getLeaderboardEntryCount(leaderboard));

				currentLeaderboard = leaderboard;
			}
		}

		@Override
		public void onLeaderboardScoresDownloaded(SteamLeaderboardHandle leaderboard,
												  SteamLeaderboardEntriesHandle entries,
												  int numEntries) {

			System.out.println("Leaderboard scores downloaded: handle=" + leaderboard.toString() +
					", entries=" + entries.toString() + ", count=" + numEntries);

			for (int i = 0; i < numEntries; i++) {

				SteamLeaderboardEntry entry = new SteamLeaderboardEntry();
				if (userStats.getDownloadedLeaderboardEntry(entries, i, entry)) {

					System.out.println("Leaderboard entry #" + i +
							": steamIDUser=" + entry.getSteamIDUser().getAccountID() +
							", globalRank=" + entry.getGlobalRank() +
							", score=" + entry.getScore());

					if (friends.requestUserInformation(entry.getSteamIDUser(), false)) {
						System.out.println("  ... requested user information for entry");
					} else {
						System.out.println("  ... user name is '" +
								friends.getFriendPersonaName(entry.getSteamIDUser()) + "'");

						int smallAvatar = friends.getSmallFriendAvatar(entry.getSteamIDUser());
						if (smallAvatar != 0) {
							int w = utils.getImageWidth(smallAvatar);
							int h = utils.getImageHeight(smallAvatar);
							System.out.println("  ... small avatar size: " + w + "x" + h + " pixels");

							ByteBuffer image = ByteBuffer.allocate(w * h * 4);

							if (utils.getImageRGBA(smallAvatar, image, w * h * 4)) {
								System.out.println("  ... small avatar retrieve avatar image successful");
							} else {
								System.out.println("  ... small avatar retrieve avatar image failed!");
							}
						} else {
							System.out.println("  ... small avatar image not available!");
						}

					}
				}

			}
		}

		@Override
		public void onLeaderboardScoreUploaded(boolean success,
											   SteamLeaderboardHandle leaderboard,
											   int score,
											   boolean scoreChanged,
											   int globalRankNew,
											   int globalRankPrevious) {

			System.out.println("Leaderboard score uploaded: " + (success ? "yes" : "no") +
					", handle=" + leaderboard.toString() +
					", score=" + score +
					", changed=" + (scoreChanged ? "yes" : "no") +
					", globalRankNew=" + globalRankNew +
					", globalRankPrevious=" + globalRankPrevious);
		}
	};

	private SteamRemoteStorageCallback remoteStorageCallback = new SteamRemoteStorageCallback() {
		@Override
		public void onFileShareResult(SteamUGCHandle fileHandle, String fileName, SteamResult result) {
			System.out.println("Remote storage file share result: handle='" + fileHandle.toString() +
					", name=" + fileName + "', result=" + result.toString());
		}

		@Override
		public void onDownloadUGCResult(SteamUGCHandle fileHandle, SteamResult result) {
			System.out.println("Remote storage download UGC result: handle='" + fileHandle.toString() +
					"', result=" + result.toString());

			ByteBuffer buffer = ByteBuffer.allocateDirect(1024);
			int offset = 0, bytesRead;

			do {
				bytesRead = remoteStorage.ugcRead(fileHandle, buffer, buffer.limit(), offset,
					SteamRemoteStorage.UGCReadAction.ContinueReadingUntilFinished);
				offset += bytesRead;
			} while (bytesRead > 0);

			System.out.println("Read " + offset + " bytes from handle=" + fileHandle.toString());
		}

		@Override
		public void onPublishFileResult(SteamPublishedFileID publishedFileID, boolean needsToAcceptWLA, SteamResult result) {
			System.out.println("Remote storage publish file result: publishedFileID=" + publishedFileID.toString() +
					", needsToAcceptWLA=" + needsToAcceptWLA + ", result=" + result.toString());
		}

		@Override
		public void onUpdatePublishedFileResult(SteamPublishedFileID publishedFileID, boolean needsToAcceptWLA, SteamResult result) {
			System.out.println("Remote storage update published file result: publishedFileID=" + publishedFileID.toString() +
					", needsToAcceptWLA=" + needsToAcceptWLA + ", result=" + result.toString());
		}
	};

	private SteamUGCCallback ugcCallback = new SteamUGCCallback() {
		@Override
		public void onUGCQueryCompleted(SteamUGCQuery query, int numResultsReturned, int totalMatchingResults,
										boolean isCachedData, SteamResult result) {
			System.out.println("UGC query completed: handle=" + query.toString() + ", " + numResultsReturned + " of " +
							   totalMatchingResults + " results returned, result=" + result.toString());

			for (int i = 0; i < numResultsReturned; i++) {
				SteamUGCDetails details = new SteamUGCDetails();
				ugc.getQueryUGCResult(query, i, details);

				System.out.println("UGC details #" + i +
								   ": publishedFileID=" + details.getPublishedFileID().toString() +
								   ", result=" + details.getResult().toString() +
								   ", title='" + details.getTitle() + "'" +
								   ", description='" + details.getDescription() + "'" +
								   ", fileName=" + details.getFileName() +
								   ", fileHandle=" + details.getFileHandle().toString() +
								   ", previewFileHandle=" + details.getPreviewFileHandle().toString());
			}

			ugc.releaseQueryUserUGCRequest(query);
		}

		@Override
		public void onSubscribeItem(SteamPublishedFileID publishedFileID, SteamResult result) {
			System.out.println("Subscribe item result: publishedFileID=" + publishedFileID + ", result=" + result);
		}

		@Override
		public void onUnsubscribeItem(SteamPublishedFileID publishedFileID, SteamResult result) {
			System.out.println("Unsubscribe item result: publishedFileID=" + publishedFileID + ", result=" + result);
		}

		@Override
		public void onRequestUGCDetails(SteamUGCDetails details, SteamResult result) {
			System.out.println("Request details result: result=" + result);
			System.out.println("UGC details " +
					   ": publishedFileID=" + details.getPublishedFileID().toString() +
					   ", result=" + details.getResult().toString() +
					   ", title='" + details.getTitle() + "'" +
					   ", description='" + details.getDescription() + "'" +
					   ", fileName=" + details.getFileName() +
					   ", fileHandle=" + details.getFileHandle().toString() +
					   ", previewFileHandle=" + details.getPreviewFileHandle().toString());
		}
	};

	private SteamFriendsCallback friendsCallback = new SteamFriendsCallback() {
		@Override
		public void onPersonaStateChange(SteamID steamID, SteamFriends.PersonaChange change) {

			switch (change) {

				case Name:
					System.out.println("Persona name received: " +
							"accountID=" + steamID.getAccountID() +
							", name='" + friends.getFriendPersonaName(steamID) + "'");
					break;

				default:
					System.out.println("Persona state changed (unhandled): " +
							"accountID=" + steamID.getAccountID() +
							", change=" + change.name());
					break;
			}
		}
	};

	@Override
	protected void registerInterfaces() {

		System.out.println("Register user ...");
		user = new SteamUser();

		System.out.println("Register user stats callback ...");
		userStats = new SteamUserStats(userStatsCallback);

		System.out.println("Register remote storage ...");
		remoteStorage = new SteamRemoteStorage(remoteStorageCallback);

		System.out.println("Register UGC ...");
		ugc = new SteamUGC(ugcCallback);

		System.out.println("Register Utils ...");
		utils = new SteamUtils();

		System.out.println("Register Apps ...");
		apps = new SteamApps();

		System.out.println("Register Friends ...");
		friends = new SteamFriends(friendsCallback);

		System.out.println("Local user account ID: " + user.getSteamID().getAccountID());
		System.out.println("App ID: " + utils.getAppID());

	}

	@Override
	protected void unregisterInterfaces() {
		user.dispose();
		userStats.dispose();
		remoteStorage.dispose();
		ugc.dispose();
		utils.dispose();
		apps.dispose();
		friends.dispose();
	}

	@Override
	protected void processUpdate() throws SteamException {

	}

	@Override
	protected void processInput(String input) throws SteamException {

		if (input.equals("stats request")) {
			userStats.requestCurrentStats();
		} else if (input.equals("stats store")) {
			userStats.storeStats();
		} else if (input.equals("file list")) {
			int numFiles = remoteStorage.getFileCount();
			System.out.println("Num of files: " + numFiles);

			for (int i = 0; i < numFiles; i++) {
				int[] sizes = new int[1];
				String name = remoteStorage.getFileNameAndSize(i, sizes);
				boolean exists = remoteStorage.fileExists(name);
				System.out.println("# " + i + " : name=" + name + ", size=" + sizes[0] + ", exists=" + (exists ? "yes" : "no"));
			}
		} else if (input.startsWith("file write ")) {
			String path = input.substring("file write ".length());
			File file = new File(path);
			try {
				FileInputStream in = new FileInputStream(file);
				SteamUGCFileWriteStreamHandle remoteFile = remoteStorage.fileWriteStreamOpen(path);
				if (remoteFile != null) {
					byte[] bytes = new byte[1024];
					int bytesRead;
					while((bytesRead = in.read(bytes, 0, bytes.length)) > 0) {
						ByteBuffer buffer = ByteBuffer.allocateDirect(bytesRead);
						buffer.put(bytes, 0, bytesRead);
						remoteStorage.fileWriteStreamWriteChunk(remoteFile, buffer, buffer.limit());
					}
					remoteStorage.fileWriteStreamClose(remoteFile);
				}
			} catch (IOException e) {
				e.printStackTrace();
			}
		} else if (input.startsWith("file delete ")) {
			String path = input.substring("file delete ".length());
			if (remoteStorage.fileDelete(path)) {
				System.out.println("deleted file '" + path + "'");
			}
		} else if (input.startsWith("file share ")) {
			remoteStorage.fileShare(input.substring("file share ".length()));
		} else if (input.startsWith("file publish ")) {
			String[] paths = input.substring("file publish ".length()).split(" ");
			if (paths.length >= 2) {
				System.out.println("publishing file: " + paths[0] + ", preview file: " + paths[1]);
				remoteStorage.publishWorkshopFile(paths[0], paths[1], utils.getAppID(),
						"Test UGC!", "Dummy UGC file published by test application.",
						SteamRemoteStorage.PublishedFileVisibility.Private, null,
						SteamRemoteStorage.WorkshopFileType.Community);
			}
		} else if (input.startsWith("file republish ")) {
			String[] paths = input.substring("file republish ".length()).split(" ");
			if (paths.length >= 3) {
				System.out.println("republishing id: " + paths[0] + ", file: " + paths[1] + ", preview file: " + paths[2]);

				SteamPublishedFileID fileID = new SteamPublishedFileID(Long.parseLong(paths[0]));

				SteamPublishedFileUpdateHandle updateHandle = remoteStorage.createPublishedFileUpdateRequest(fileID);
				if (updateHandle != null) {
					remoteStorage.updatePublishedFileFile(updateHandle, paths[1]);
					remoteStorage.updatePublishedFilePreviewFile(updateHandle, paths[2]);
					remoteStorage.updatePublishedFileTitle(updateHandle, "Updated Test UGC!");
					remoteStorage.updatePublishedFileDescription(updateHandle, "Dummy UGC file *updated* by test application.");
					remoteStorage.commitPublishedFileUpdate(updateHandle);
				}
			}
		} else if (input.equals("ugc query")) {
			SteamUGCQuery query = ugc.createQueryUserUGCRequest(user.getSteamID().getAccountID(), SteamUGC.UserUGCList.Subscribed,
					SteamUGC.MatchingUGCType.UsableInGame, SteamUGC.UserUGCListSortOrder.TitleAsc,
					utils.getAppID(), utils.getAppID(), 1);

			if (query.isValid()) {
				System.out.println("sending UGC query: " + query.toString());
				//ugc.setReturnTotalOnly(query, true);
				ugc.sendQueryUGCRequest(query);
			}
		} else if (input.startsWith("ugc download ")) {
			String name = input.substring("ugc download ".length());
			SteamUGCHandle handle = new SteamUGCHandle(Long.parseLong(name, 16));
			remoteStorage.ugcDownload(handle, 0);
		} else if (input.startsWith("ugc subscribe ")) {
			Long id = Long.parseLong(input.substring("ugc subscribe ".length()), 16);
			ugc.subscribeItem(new SteamPublishedFileID(id));
		} else if (input.startsWith("ugc unsubscribe ")) {
			Long id = Long.parseLong(input.substring("ugc unsubscribe ".length()), 16);
			ugc.unsubscribeItem(new SteamPublishedFileID(id));
		} else if (input.startsWith("ugc state ")) {
			Long id = Long.parseLong(input.substring("ugc state ".length()), 16);
			Collection<SteamUGC.ItemState> itemStates = ugc.getItemState(new SteamPublishedFileID(id));
			System.out.println("UGC item states: " + itemStates.size());
			for (SteamUGC.ItemState itemState : itemStates) {
				System.out.println("  " + itemState.name());
			}
		} else if (input.startsWith("ugc details ")) {
			System.out.println("requesting UGC details (deprecated API call)");
			Long id = Long.parseLong(input.substring("ugc details ".length()), 16);
			ugc.requestUGCDetails(new SteamPublishedFileID(id), 0);

			SteamUGCQuery query = ugc.createQueryUGCDetailsRequest(new SteamPublishedFileID(id));
			if (query.isValid()) {
				System.out.println("sending UGC details query: " + query.toString());
				ugc.sendQueryUGCRequest(query);
			}
		} else if (input.startsWith("ugc info ")) {
			Long id = Long.parseLong(input.substring("ugc info ".length()), 16);
			SteamUGC.ItemInstallInfo installInfo = new SteamUGC.ItemInstallInfo();
			if (ugc.getItemInstallInfo(new SteamPublishedFileID(id), installInfo)) {
				System.out.println("  folder: " + installInfo.getFolder());
				System.out.println("  size on disk: " + installInfo.getSizeOnDisk());
			}
			SteamUGC.ItemDownloadInfo downloadInfo = new SteamUGC.ItemDownloadInfo();
			if (ugc.getItemDownloadInfo(new SteamPublishedFileID(id), downloadInfo)) {
				System.out.println("  bytes downloaded: " + downloadInfo.getBytesDownloaded());
				System.out.println("  bytes total: " + downloadInfo.getBytesTotal());
			}
		} else if (input.startsWith("leaderboard find ")) {
			String name = input.substring("leaderboard find ".length());
			userStats.findLeaderboard(name);
		} else if (input.startsWith("leaderboard list ")) {
			String[] params = input.substring("leaderboard list ".length()).split(" ");
			if (currentLeaderboard != null && params.length >= 2) {
				userStats.downloadLeaderboardEntries(currentLeaderboard,
						SteamUserStats.LeaderboardDataRequest.Global,
						Integer.valueOf(params[0]), Integer.valueOf(params[1]));
			}
		} else if (input.startsWith("leaderboard score ")) {
			String score = input.substring("leaderboard score ".length());
			if (currentLeaderboard != null) {
				System.out.println("uploading score " + score + " to leaderboard " + currentLeaderboard.toString());
				userStats.uploadLeaderboardScore(currentLeaderboard,
						SteamUserStats.LeaderboardUploadScoreMethod.KeepBest, Integer.valueOf(score));
			}
		} else if (input.startsWith("apps subscribed ")) {
			String appId = input.substring("apps subscribed ".length());
			boolean subscribed = apps.isSubscribedApp(Long.parseLong(appId));
			System.out.println("user described to app #" + appId + ": " + (subscribed ? "yes" : "no"));
		}

	}

	public static void main(String[] arguments) {
		new SteamClientAPITestApp().clientMain(arguments);
	}

}


text:
package ua.com.fielden.platform.expression.lexer.function.seconds;

import ua.com.fielden.platform.expression.automata.AbstractState;
import ua.com.fielden.platform.expression.automata.NoTransitionAvailable;

/**
 * Final state.
 *
 * @author TG Team
 *
 */
public class State8 extends AbstractState {

    public State8() {
        super("S8", true);
    }

    @Override
    protected AbstractState transition(final char symbol) throws NoTransitionAvailable {
        throw new NoTransitionAvailable("Invalid symbol '" + symbol + "'", this, symbol);
    }

}

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace Innova\LearningPathBundle\Entity;

use Gedmo\Mapping\Annotation as Gedmo;
use Doctrine\ORM\Mapping as ORM;

/**
 * AbstractRessource
 *
 * @ORM\Table(name="inl_abstract_resource")
 * @ORM\Entity
 */
class AbstractRessource
{
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="name", type="string", length=255)
     */
    private $name;

    /**
     * @var string
     *
     * @ORM\Column(name="description", type="string", length=255, nullable=true)
     */
    private $description;

    /**
     * @Gedmo\Slug(fields={"name"})
     * @ORM\Column(length=128, unique=true)
     */
    private $slug;

    /**
     * @var datetime $created
     *
     * @Gedmo\Timestampable(on="create")
     * @ORM\Column(type="datetime")
     */
    private $created;

    /**
     * @var datetime $updated
     *
     * @Gedmo\Timestampable(on="update")
     * @ORM\Column(type="datetime")
     */
    private $updated;

    /**
    * @ORM\ManyToMany(targetEntity="ConcreteRessource", mappedBy="abstractRessources", cascade={"remove","persist"})
    */
    private $concreteRessources;

    /**
    * @ORM\ManyToMany(targetEntity="AbstractWorkspace", inversedBy="abstractRessources")
    * @ORM\JoinTable(name="inl_abstractressource_abstractworkspace")
    */
    private $abstractWorkspaces;

    /**
    * @ORM\ManyToOne(targetEntity="Innova\TaxonomyBundle\Entity\Term", inversedBy="abstractRessources")
    */
    private $term;

    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set name
     *
     * @param string $name
     *
     * @return AbstractRessource
     */
    public function setName($name)
    {
        $this->name = $name;

        return $this;
    }

    /**
     * Get name
     *
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Set description
     *
     * @param string $description
     *
     * @return AbstractRessource
     */
    public function setDescription($description)
    {
        $this->description = $description;

        return $this;
    }

    /**
     * Get description
     *
     * @return string
     */
    public function getDescription()
    {
        return $this->description;
    }

    /**
     * Constructor
     */
    public function __construct()
    {
        $this->concreteRessources = new \Doctrine\Common\Collections\ArrayCollection();
    }

    /**
     * Add concreteRessources
     *
     * @param  \Innova\LearningPathBundle\Entity\ConcreteRessource $concreteRessources
     * @return AbstractRessource
     */
    public function addConcreteRessource(\Innova\LearningPathBundle\Entity\ConcreteRessource $concreteRessources)
    {
        $this->concreteRessources[] = $concreteRessources;

        return $this;
    }

    /**
     * Remove concreteRessources
     *
     * @param \Innova\LearningPathBundle\Entity\ConcreteRessource $concreteRessources
     */
    public function removeConcreteRessource(\Innova\LearningPathBundle\Entity\ConcreteRessource $concreteRessources)
    {
        $this->concreteRessources->removeElement($concreteRessources);
    }

    /**
     * Get concreteRessources
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getConcreteRessources()
    {
        return $this->concreteRessources;
    }

    /**
     * Add abstractWorkspaces
     *
     * @param  \Innova\LearningPathBundle\Entity\AbstractWorkspace $abstractWorkspaces
     * @return AbstractRessource
     */
    public function addAbstractWorkspace(\Innova\LearningPathBundle\Entity\AbstractWorkspace $abstractWorkspaces)
    {
        $this->abstractWorkspaces[] = $abstractWorkspaces;

        return $this;
    }

    /**
     * Remove abstractWorkspaces
     *
     * @param \Innova\LearningPathBundle\Entity\AbstractWorkspace $abstractWorkspaces
     */
    public function removeAbstractWorkspace(\Innova\LearningPathBundle\Entity\AbstractWorkspace $abstractWorkspaces)
    {
        $this->abstractWorkspaces->removeElement($abstractWorkspaces);
    }

    /**
     * Get abstractWorkspaces
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getAbstractWorkspaces()
    {
        return $this->abstractWorkspaces;
    }

    /**
     * Get slug
     *
     * @return string
     */
    public function getSlug()
    {
        return $this->slug;
    }

    /**
     * Get created
     *
     * @return string
     */
    public function getCreated()
    {
        return $this->created;
    }

    /**
     * Get updated
     *
     * @return string
     */
    public function getUpdated()
    {
        return $this->updated;
    }

    /**
     * Set slug
     *
     * @param  string            $slug
     * @return AbstractRessource
     */
    public function setSlug($slug)
    {
        $this->slug = $slug;

        return $this;
    }

    /**
     * Set created
     *
     * @param  \DateTime         $created
     * @return AbstractRessource
     */
    public function setCreated($created)
    {
        $this->created = $created;

        return $this;
    }

    /**
     * Set updated
     *
     * @param  \DateTime         $updated
     * @return AbstractRessource
     */
    public function setUpdated($updated)
    {
        $this->updated = $updated;

        return $this;
    }

    /**
     * Set term
     *
     * @param  \Innova\TaxonomyBundle\Entity\Term $term
     * @return AbstractRessource
     */
    public function setTerm(\Innova\TaxonomyBundle\Entity\Term $term = null)
    {
        $this->term = $term;

        return $this;
    }

    /**
     * Get term
     *
     * @return \Innova\TaxonomyBundle\Entity\Term
     */
    public function getTerm()
    {
        return $this->term;
    }
}


text:
#include "paddle/fluid/inference/tensorrt/convert/op_converter.h"

namespace nvinfer1 {
class ILayer;
}  // namespace nvinfer1
namespace paddle {
namespace framework {
class Scope;

namespace proto {
class OpDesc;
}  // namespace proto
}  // namespace framework
}  // namespace paddle

namespace paddle {
namespace inference {
namespace tensorrt {

class TanhshrinkOpConverter : public OpConverter {
 public:
  void operator()(const framework::proto::OpDesc& op,
                  const framework::Scope& scope,
                  bool test_mode) override {
    VLOG(4) << "convert fluid Tanhshrink op to tensorrt layer";

    framework::OpDesc op_desc(op, nullptr);
    // Declare inputs
    int input_num = op_desc.Input("X").size();
    PADDLE_ENFORCE_EQ(
        input_num,
        1,
        platform::errors::InvalidArgument(
            "The input X's size must equal to 1 in TRT Tanhshrink op."
            " But received X's size %d.",
            input_num));
    auto* input = engine_->GetITensor(op_desc.Input("X")[0]);
    // Get output
    size_t output_num = op_desc.Output("Out").size();
    PADDLE_ENFORCE_EQ(
        output_num,
        1UL,
        platform::errors::InvalidArgument(
            "The output Out's size must equal to 1 in TRT Tanhshrink op. "
            "But received Out's size %u.",
            output_num));

    nvinfer1::ILayer* layer = nullptr;
    auto* tanh = TRT_ENGINE_ADD_LAYER(
        engine_, Activation, *input, nvinfer1::ActivationType::kTANH);
    layer = TRT_ENGINE_ADD_LAYER(engine_,
                                 ElementWise,
                                 *input,
                                 *(tanh->getOutput(0)),
                                 nvinfer1::ElementWiseOperation::kSUB);
    auto output_name = op_desc.Output("Out")[0];
    RreplenishLayerAndOutput(layer, "tanh_shrink", {output_name}, test_mode);
  }
};

}  // namespace tensorrt
}  // namespace inference
}  // namespace paddle

REGISTER_TRT_OP_CONVERTER(tanh_shrink, TanhshrinkOpConverter);


text:
import { IColorStop } from './../interfaces/color-stop.interface';

export class IndicatorColorStop implements IColorStop{
  color: string;
  stop: number;
  title: string;

}


text:
<!DOCTYPE html>

<meta charset="ISO-8859-1">
<title>Add to Database</title>

		<form class="empForm" accept-charset="UTF-8">

						Name
						Area
						Population

						<input type="text" class="nameInput">
						<input type="text" class="areaInput">
						<input type="text" class="populationInput">

						<input type="submit" class="formSubmit" value="Submit">
						<input type="reset" class="formClearStorage"
							value="Clear">

		</form>

Waiting for input...

		<input type="button" class="getData" value="GET_All_Data_HTTP_Request">

					Name
					Area
					Population


text:
'use strict';

angular.module('wams.module', [])
  .service('wams', function wams($q) {

    var API_URL = 'https://frayedknot.azure-mobile.net/';
    var API_KEY = 'FovMOPaZTJbHPGIFpIzXQRbgmYGAKP50';
    var VAILD_OAUTH_PROVIDERS = ['google', 'twitter', 'facebook', 'windowsaccount', 'windowsazureactivedirectory'];

    var MobileServiceClient = WindowsAzure.MobileServiceClient;
    var client = new MobileServiceClient(API_URL, API_KEY);

    var getCachedUser = function(){
        if (sessionStorage.loggedInUser){
            client.currentUser = JSON.parse(sessionStorage.loggedInUser);
        }
    };

    getCachedUser();

    var getTable = function(tableName, withFilterFn){

        if (typeof withFilterFn === 'function')
            return client.withFilter(withFilterFn).getTable(tableName);

        return client.getTable(tableName);
    };

    var isUndefinedOrNotAnObjectOrFunction = function(obj){
        return typeof obj === 'undefined' || (typeof obj !== 'object' && typeof obj !== 'function');
    };

    var isUndefinedOrNotAnObject = function(obj){
        return isNullOrUndefined(obj) || (typeof obj !== 'object');
    };

    var isNullOrUndefined = function(value){
        return value === null || typeof value === 'undefined';
    };
    var isNotNullOrUndefined = function(value){
        return !isNullOrUndefined(value);
    };

    //This will accept the Azure promise and turn it into a angular promise.
    //Elimiante the need for $scope.$apply in your controller.
    var wrapAzurePromiseWithAngularPromise = function(azurePromise){
        var deferred = $q.defer();

        azurePromise
            .done(function(items){
                deferred.resolve(items);
            },
            function(err){
                deferred.reject(err);
            });
        return deferred.promise;
    };

    return{
        /*
            The query method will create and return an azure query.

            @param string tableName                      REQUIRED The name of the table to query
            @param object obj
                @param obj or function criteria          The search object or a function to filter
                                                         If function then it must be an OData predicate.
                @param array params                      Array of parameters to pass the criteria function
                @param array columns                     Array of column names to return
                @param int take                          Number of results to return
                @param int skip                          Number of reuslts to skip over
                @param array orderBy                     Array of objects
                    @param string column                 Column name to sort by
                    @param string direction              Direction to sort asc || desc
            @param function withFilterFn                 OPTIONAL A function that can read and write arbitrary properties or add additional headers to the request
            @return promise               Returns a WindowsAzure promise
        */
        query: function(tableName, obj, withFilterFn){

            var data = null;

            if (isNullOrUndefined(tableName)){
                console.error('wams.query: You must specify a table name');
                return null;
            }

            if (angular.isDefined(obj) && angular.isObject(obj)){

                if (isUndefinedOrNotAnObjectOrFunction(obj.criteria)){
                    obj.criteria = {};
                }

                data = getTable(tableName, withFilterFn).where(obj.criteria, obj.params);

                //Number of results to return
                if (isNotNullOrUndefined(obj.take) && angular.isNumber(obj.take)){
                    data = data.take(obj.take);
                }

                //number of results to skip
                if (isNotNullOrUndefined(obj.skip) && angular.isNumber(obj.take)){
                    data = data.skip(obj.skip);
                }

                //How to sort/order the data
                if (angular.isDefined(obj.orderBy) && angular.isArray(obj.orderBy)){
                    var orderBy = obj.orderBy;

                    for (var i=0; i < orderBy.length; i++){
                        var column = orderBy[i].column;
                        var dir = orderBy[i].direction;

                        if (angular.isDefined(column)){
                            if (angular.isDefined(dir) && dir.toLowerCase() === 'desc'){
                                data = data.orderByDescending(column);
                            }else if (angular.isDefined(column)){
                                data = data.orderBy(column);
                            }
                        }
                    }
                }

                //Return listed columns
                if (angular.isDefined(obj.columns) && angular.isArray(obj.columns)){
                    data = data.select(obj.columns.join());
                }

            }else {
                //No criteria specified - get everything - Note azure limits the count of returned items see docs.
                data = getTable(tableName, withFilterFn).where({});
            }

            return wrapAzurePromiseWithAngularPromise(data.includeTotalCount().read());
        },

        /*
         Get single item in Azure

         @param string tableName       REQUIRED The name of the table to query
         @param string id              REQUIRED String id of the item to get
         @param function withFilterFn  OPTIONAL A function that can read and write arbitrary properties or add additional headers to the request
         @return promise               Returns a WindowsAzure promise
         */
        getById: function (tableName, id, withFilterFn) {
            if (isNullOrUndefined(tableName)) {
                console.error('wams.getById: You must specify a table name');
                return null;
            }

            if (isNullOrUndefined(id)) {
                console.error('wams.getById: You must specify the id');
                return null;
            }

            return wrapAzurePromiseWithAngularPromise(getTable(tableName, withFilterFn).lookup(id));
        },

        /*
          Alias to .query(tableName, null, withFilterFn)
          Returns all results
        */
        getAll: function(tableName, withFilterFn){
            return this.query(tableName, null, withFilterFn);
        },

        /*
          Insert row in to Azure

          @param string tableName       REQUIRED The name of the table to query
          @param object obj             REQUIRED A JSON object of data to insert into the database
          @param function withFilterFn  OPTIONAL A function that can read and write arbitrary properties or add additional headers to the request
          @return promise               Returns a WindowsAzure promise
        */

        insert: function(tableName, obj, withFilterFn){
            if (isNullOrUndefined(tableName)){
                console.error('wams.insert: You must specify a table name');
                return null;
            }

            if (isUndefinedOrNotAnObject(obj)){
                console.error('wams.insert: You must specify the insert object');
                return null;
            }

            return wrapAzurePromiseWithAngularPromise(getTable(tableName, withFilterFn).insert(obj));
        },

        /*
          Update row in Azure

          @param string tableName       REQUIRED The name of the table to query
          @param object obj             REQUIRED A JSON object of data to update into the database
          @param function withFilterFn  OPTIONAL A function that can read and write arbitrary properties or add additional headers to the request
          @return promise               Returns a WindowsAzure promise
        */

        update: function(tableName, obj, withFilterFn){
            if (isNullOrUndefined(tableName)){
                console.error('wams.update: You must specify a table name');
                return null;
            }

            if (isUndefinedOrNotAnObject(obj)){
                console.error('wams.update: You must specify the insert object');
                return null;
            }

            return wrapAzurePromiseWithAngularPromise(getTable(tableName, withFilterFn).update(obj));
        },

        /*
          Delete row(s) from Azure

          @param string tableName       REQUIRED The name of the table to query
          @param object obj             REQUIRED A JSON object of data to query for deletion from the database
          @param function withFilterFn  OPTIONAL A function that can read and write arbitrary properties or add additional headers to the request
          @return promise               Returns a WindowsAzure promise
        */

        del: function(tableName, obj, withFilterFn){
            if (isNullOrUndefined(tableName)){
                console.error('wams.del: You must specify a table name');
                return null;
            }

            if (isUndefinedOrNotAnObject(obj)){
                console.error('wams.del: You must specify the insert object');
                return null;
            }

            return wrapAzurePromiseWithAngularPromise(getTable(tableName, withFilterFn).del(obj));
        },

        /*
          Logs a user into the oauthProvider service using Windows Azure
          Stores the data in sessionStorage for future queries

          @param  string oauthProvider  REQUIRED pass in an oauth provider
          @return promise               Returns a WindowsAzure promise
        */

        login: function(oauthProvider){

            if (!angular.isDefined(oauthProvider) || VAILD_OAUTH_PROVIDERS.indexOf(oauthProvider) === -1){
                throw new Error('wams.login Invalid or no oauth provider listed.');
            }

            var promise = client.login(oauthProvider).then(function(){
                //cache login
                sessionStorage.loggedInUser = JSON.stringify(client.currentUser);
            });

            return wrapAzurePromiseWithAngularPromise(promise);
        },
        /*
          Logs a user out
        */

        logout: function(){
            //clear cache
            sessionStorage.loggedInUser = null;
            client.logout();
        },

        isLoggedIn: function(){
            return isNotNullOrUndefined(client.currentUser)  && isNotNullOrUndefined(sessionStorage.loggedInUser);
        },

        /*
            @param string name          the custom api name
            @param object options
                @param string method        required get, post, put, delete
                @param object body          key/value to send in the request body
                @param object headers       key value  to send in the headers
                @param object parameters    key/value to send as parameters

        */

        invokeApi: function(name, options){

            var deferred = $q.defer();

            var validMethods = ['get', 'post', 'put', 'delete'];

            if (isNullOrUndefined(name)){
                console.error('wams.invokeApi No custom api name specified');
                return null;
            }

            if (isUndefinedOrNotAnObject(options)){
                options = {
                    method: 'get'
                }
            }else if (isNullOrUndefined(options.method)){
                options.method = 'get'
            }else if (validMethods.indexOf(options.method.toLowerCase()) === -1 ){
                console.error('wams.invokeApi Invalid method type');
                return null;
            }

            client
                .invokeApi(name, options)
                .done(function(results){
                    deferred.resolve(results.result);
                },
                function(err){
                    deferred.reject(err);
                });

            return deferred.promise;
        }
    };

});


text:
/*$Header: /p/tcsh/cvsroot/tcsh/win32/forkdata.h,v 1.4 2004/05/19 18:22:27 christos Exp $*/
/*-
 * Copyright (c) 1980, 1991 The Regents of the University of California.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. Neither the name of the University nor the names of its contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 */

#ifndef FORK_DATA_H
#define FORK_DATA_H

#include <setjmp.h>

/*
 * This structure is copied by fork() to the child process. It
 * contains variables of national importance
 *
 * Thanks to Mark Tucker for the idea. tcsh now finally works on
 * alphas.
 * -amol
 */
typedef struct _fork_data {
	unsigned long _forked;
	void  *_fork_stack_begin;
	void  *_fork_stack_end;
	unsigned long _heap_size;
	HANDLE _hforkparent, _hforkchild;
	void * _heap_base;
	void * _heap_top;
	jmp_buf _fork_context;
} ForkData;

#define __forked gForkData._forked
#define __fork_stack_begin gForkData._fork_stack_begin
#define __fork_stack_end gForkData._fork_stack_end
#define __hforkparent gForkData._hforkparent
#define __hforkchild gForkData._hforkchild
#define __fork_context gForkData._fork_context
#define __heap_base gForkData._heap_base
#define __heap_size gForkData._heap_size
#define __heap_top gForkData._heap_top

extern ForkData gForkData;

#ifdef NTDBG
#define FORK_TIMEOUT INFINITE
#else
#define FORK_TIMEOUT (50000)
#endif /*!NTDBG */

#endif FORK_DATA_H


text:
class HkxFile;

class hkbCharacterStringData final: public HkxObject
{
    friend class hkbCharacterData;
    friend class AnimationsUI;
public:
    hkbCharacterStringData(HkxFile *parent, long ref = 0);
    hkbCharacterStringData& operator=(const hkbCharacterStringData&) = delete;
    hkbCharacterStringData(const hkbCharacterStringData &) = delete;
    ~hkbCharacterStringData();
public:
    int getAnimationIndex(const QString & name) const;
    QStringList getAnimationNames() const;
    QString getCharacterPropertyNameAt(int index) const;
    QString getAnimationNameAt(int index) const;
    QStringList getCharacterPropertyNames() const;
    QString getLastCharacterPropertyName() const;
    static const QString getClassname();
    int getCharacterPropertyIndex(const QString &name) const;
    void setName(const QString &value);
    void setRigName(const QString &value);
    void setRagdollName(const QString &value);
    void setBehaviorFilename(const QString &value);
    void addAnimation(const QString &name = "");
    QString getBehaviorFilename() const;
    QString getRigName() const;
    QString getRagdollName() const;
    int getNumberOfAnimations() const;
private:
    void setVariableNameAt(int index, const QString & name);
    bool readData(const HkxXmlReader & reader, long & index);
    bool link();
    QString evaluateDataValidity();
    void removeCharacterPropertyNameAt(int index);
    void generateAppendCharacterPropertyName(const QString &type);
    int addCharacterPropertyName(const QString & name, bool * wasadded = nullptr);
    bool write(HkxXMLWriter *writer);
    bool merge(hkbCharacterStringData *obj);
    void setCharacterPropertyNameAt(int index, const QString &name);
private:
    static uint refCount;
    static const QString classname;
    QStringList deformableSkinNames;
    QStringList rigidSkinNames;
    QStringList animationNames;
    QStringList animationFilenames;
    QStringList characterPropertyNames;
    QStringList retargetingSkeletonMapperFilenames;
    QStringList lodNames;
    QStringList mirroredSyncPointSubstringsA;
    QStringList mirroredSyncPointSubstringsB;
    QString name;
    QString rigName;
    QString ragdollName;
    QString behaviorFilename;
    mutable std::mutex mutex;
};

#endif // HKBCHARACTERSTRINGDATA_H


text:
package arq.cmdline ;

import java.io.IOException ;

import jena.cmd.ArgDecl;
import jena.cmd.CmdArgModule;
import jena.cmd.CmdException;
import jena.cmd.CmdGeneral;
import jena.cmd.ModBase;
import jena.cmd.TerminationException;

import org.apache.jena.query.Query ;
import org.apache.jena.query.QueryFactory ;
import org.apache.jena.query.Syntax ;
import org.apache.jena.shared.JenaException ;
import org.apache.jena.sparql.ARQInternalErrorException ;
import org.apache.jena.util.FileUtils ;

public class ModQueryIn extends ModBase {
    protected final ArgDecl queryFileDecl   = new ArgDecl(ArgDecl.HasValue, "query", "file") ;
    protected final ArgDecl querySyntaxDecl = new ArgDecl(ArgDecl.HasValue, "syntax", "syn", "in") ;
    protected final ArgDecl queryBaseDecl   = new ArgDecl(ArgDecl.HasValue, "base") ;

    private Syntax          defaultQuerySyntax     = Syntax.syntaxARQ ;
    private Syntax          querySyntax     = null ;
    private String          queryFilename   = null ;
    private String          queryString     = null ;
    private Query           query           = null ;
    private String          baseURI         = null ;

    public ModQueryIn(Syntax defaultSyntax) {
        defaultQuerySyntax = defaultSyntax ;
        querySyntax = defaultSyntax ;
    }

    @Override
    public void registerWith(CmdGeneral cmdLine) {
        cmdLine.getUsage().startCategory("Query") ;
        cmdLine.add(queryFileDecl,   "--query, --file",  "File containing a query") ;
        cmdLine.add(querySyntaxDecl, "--syntax, --in",   "Syntax of the query") ;
        cmdLine.add(queryBaseDecl,   "--base",           "Base URI for the query") ;
    }

    @Override
    public void processArgs(CmdArgModule cmdline) throws IllegalArgumentException {
        if ( cmdline.contains(queryBaseDecl) )
            baseURI = cmdline.getValue(queryBaseDecl) ;

        if ( cmdline.contains(queryFileDecl) ) {
            queryFilename = cmdline.getValue(queryFileDecl) ;
            querySyntax = Syntax.guessFileSyntax(queryFilename, defaultQuerySyntax) ;
        }

        if ( cmdline.getNumPositional() == 0 && queryFilename == null )
            cmdline.cmdError("No query string or query file") ;

        if ( cmdline.getNumPositional() > 1 )
            cmdline.cmdError("Only one query string allowed") ;

        if ( cmdline.getNumPositional() == 1 && queryFilename != null )
            cmdline.cmdError("Either query string or query file - not both") ;

        if ( queryFilename == null ) {
            // One positional argument.
            String qs = cmdline.getPositionalArg(0) ;
            if ( cmdline.matchesIndirect(qs) )
                querySyntax = Syntax.guessFileSyntax(qs, defaultQuerySyntax) ;

            queryString = cmdline.indirect(qs) ;
        }

        // Set syntax
        if ( cmdline.contains(querySyntaxDecl) ) {
            // short name
            String s = cmdline.getValue(querySyntaxDecl) ;
            Syntax syn = Syntax.lookup(s) ;
            if ( syn == null )
                cmdline.cmdError("Unrecognized syntax: " + s) ;
            querySyntax = syn ;
        }
    }

    public Syntax getQuerySyntax() {
        return querySyntax ;
    }

    public Query getQuery() {
        if ( query != null )
            return query ;

        if ( queryFilename != null && queryString != null ) {
            System.err.println("Both query string and query file name given") ;
            throw new TerminationException(1) ;
        }

        if ( queryFilename == null && queryString == null ) {
            System.err.println("No query string and no query file name given") ;
            throw new TerminationException(1) ;
        }

        try {
            if ( queryFilename != null ) {
                if ( queryFilename.equals("-") ) {
                    try {
                        // Stderr?
                        queryString = FileUtils.readWholeFileAsUTF8(System.in) ;
                        // And drop into next if
                    } catch (IOException ex) {
                        throw new CmdException("Error reading stdin", ex) ;
                    }
                } else {
                    query = QueryFactory.read(queryFilename, baseURI, getQuerySyntax()) ;
                    return query ;
                }
            }

            query = QueryFactory.create(queryString, baseURI, getQuerySyntax()) ;
            return query ;
        } catch (ARQInternalErrorException intEx) {
            System.err.println(intEx.getMessage()) ;
            if ( intEx.getCause() != null ) {
                System.err.println("Cause:") ;
                intEx.getCause().printStackTrace(System.err) ;
                System.err.println() ;
            }
            intEx.printStackTrace(System.err) ;
            throw new TerminationException(99) ;
        }
        catch (JenaException ex) {
            System.err.println(ex.getMessage()) ;
            throw new TerminationException(2) ;
        } catch (Exception ex) {
            System.out.flush() ;
            ex.printStackTrace(System.err) ;
            throw new TerminationException(98) ;
        }
    }
}


text:
package org.terracotta.management.service.monitoring;

import com.tc.classloader.CommonComponent;
import org.terracotta.entity.ClientDescriptor;
import org.terracotta.management.model.call.ContextualReturn;
import org.terracotta.management.model.call.Parameter;
import org.terracotta.management.model.capabilities.Capability;
import org.terracotta.management.model.cluster.ClientIdentifier;
import org.terracotta.management.model.cluster.Cluster;
import org.terracotta.management.model.context.Context;
import org.terracotta.management.model.context.ContextContainer;
import org.terracotta.management.model.message.Message;
import org.terracotta.management.model.notification.ContextualNotification;
import org.terracotta.management.model.stats.ContextualStatistics;
import org.terracotta.management.sequence.Sequence;
import org.terracotta.management.service.monitoring.buffer.ReadOnlyBuffer;

/**
 * @author Mathieu Carbou
 */
@CommonComponent
public interface MonitoringService {

  /**
   * Returns an identifier in the M&M topology for an internal voltron client descriptor. This client identifier identifies a client cluster-wise
   *

   * Can be called from active entity only
   */
  ClientIdentifier getClientIdentifier(ClientDescriptor clientDescriptor);

  /**
   * Push a new client-side notification coming from a client descriptor in the monitoring service. This will be put in a best effort-buffer.
   *

   * Can be called from active entity only
   */
  void pushClientNotification(ClientDescriptor from, ContextualNotification notification);

  /**
   * Push some client statistics coming fro
   *

   * Can be called from active entity onlym a client descriptor into the service. This will be put in a best effort-buffer.
   */
  void pushClientStatistics(ClientDescriptor from, ContextualStatistics... statistics);

  /**
   * Associate some tagging information to a client
   *

   * Can be called from active entity only
   */
  void exposeClientTags(ClientDescriptor from, String... tags);

  /**
   * Expose a management registry onto the client identified by a client descriptor
   *

   * Can be called from active entity only
   */
  void exposeClientManagementRegistry(ClientDescriptor caller, ContextContainer contextContainer, Capability... capabilities);

  /**
   * Expose a management registry onto the server entity that is currently consuming this service.
   *

   * Can be called from active or passive entity
   */
  void exposeServerEntityManagementRegistry(ContextContainer contextContainer, Capability... capabilities);

  /**
   * Push a new server-side notification coming from the entity consuming this service. This will be put in a best effort-buffer.
   *

   * Can be called from active or passive entity
   */
  void pushServerEntityNotification(ContextualNotification notification);

  /**
   * Push some server-side statistics coming from the entity consuming this service. This will be put in a best effort-buffer.
   *

   * Can be called from active or passive entity
   */
  void pushServerEntityStatistics(ContextualStatistics... statistics);

  /**
   * @return the current topology. You must not apply any mutation to the returned object.
   * A cluster is a composition of several clients and stripes, but the returned cluster will only have one stripe: the one we are currently on.
   * The stripe name can be configured.
   *

   * Can be called from active entity only
   */
  Cluster readTopology();

  /**
   * Request a management call from an entity client to another client of the same entity
   *

   * Can be called from active entity only
   *
   * @return An unique identifier for this management call
   */
  String sendManagementCallRequest(ClientDescriptor caller, ClientIdentifier to, Context context, String capabilityName, String methodName, Class<?> returnType, Parameter... parameters);

  /**
   * Answer a management call we received and executed
   *

   * Can be called from active entity only
   *
   * @param calledDescriptor         The entity client that was targeted by the call
   * @param from                     The client identifier that was asking the call
   * @param managementCallIdentifier The unique identifier of the management call
   * @param contextualReturn         The result of the call
   */
  void answerManagementCall(ClientDescriptor calledDescriptor, ClientIdentifier from, String managementCallIdentifier, ContextualReturn<?> contextualReturn);

  /**
   * Can be called from active entity only
   *
   * @return The buffer containing all best effort messages, including statistics and notifications.
   */
  ReadOnlyBuffer<Message> createMessageBuffer(int maxBufferSize);

  /**
   * Can be called from active entity only
   *
   * @return The next sequence to use to build a monitoring message
   */
  Sequence nextSequence();

  /**
   * Can be called from active or passive entity
   *
   * @return This consumer identifier, unique on current server only.
   */
  long getConsumerId();

}


text:
package main

import (
	"encoding/json"
	"fmt"
	"os"

	"github.com/containers/storage/pkg/mflag"
	"github.com/containers/storage/storage"
)

var testDeleteImage = false

func deleteThing(flags *mflag.FlagSet, action string, m storage.Store, args []string) int {
	if len(args) < 1 {
		return 1
	}
	deleted := make(map[string]string)
	for _, what := range args {
		err := m.Delete(what)
		if err != nil {
			deleted[what] = fmt.Sprintf("%v", err)
		} else {
			deleted[what] = ""
		}
	}
	if jsonOutput {
		json.NewEncoder(os.Stdout).Encode(deleted)
	} else {
		for what, err := range deleted {
			if err != "" {
				fmt.Fprintf(os.Stderr, "%s: %s\n", what, err)
			}
		}
	}
	for _, err := range deleted {
		if err != "" {
			return 1
		}
	}
	return 0
}

func deleteLayer(flags *mflag.FlagSet, action string, m storage.Store, args []string) int {
	if len(args) < 1 {
		return 1
	}
	deleted := make(map[string]string)
	for _, what := range args {
		err := m.DeleteLayer(what)
		if err != nil {
			deleted[what] = fmt.Sprintf("%v", err)
		} else {
			deleted[what] = ""
		}
	}
	if jsonOutput {
		json.NewEncoder(os.Stdout).Encode(deleted)
	} else {
		for what, err := range deleted {
			if err != "" {
				fmt.Fprintf(os.Stderr, "%s: %s\n", what, err)
			}
		}
	}
	for _, err := range deleted {
		if err != "" {
			return 1
		}
	}
	return 0
}

type deletedImage struct {
	DeletedLayers []string `json:"deleted-layers,omitifempty"`
	Error         string   `json:"error,omitifempty"`
}

func deleteImage(flags *mflag.FlagSet, action string, m storage.Store, args []string) int {
	if len(args) < 1 {
		return 1
	}
	deleted := make(map[string]deletedImage)
	for _, what := range args {
		layers, err := m.DeleteImage(what, !testDeleteImage)
		errText := ""
		if err != nil {
			errText = fmt.Sprintf("%v", err)
		}
		deleted[what] = deletedImage{
			DeletedLayers: layers,
			Error:         errText,
		}
	}
	if jsonOutput {
		json.NewEncoder(os.Stdout).Encode(deleted)
	} else {
		for what, record := range deleted {
			if record.Error != "" {
				fmt.Fprintf(os.Stderr, "%s: %s\n", what, record.Error)
			} else {
				for _, layer := range record.DeletedLayers {
					fmt.Fprintf(os.Stderr, "%s: %s\n", what, layer)
				}
			}
		}
	}
	for _, record := range deleted {
		if record.Error != "" {
			return 1
		}
	}
	return 0
}

func deleteContainer(flags *mflag.FlagSet, action string, m storage.Store, args []string) int {
	if len(args) < 1 {
		return 1
	}
	deleted := make(map[string]string)
	for _, what := range args {
		err := m.DeleteContainer(what)
		if err != nil {
			deleted[what] = fmt.Sprintf("%v", err)
		} else {
			deleted[what] = ""
		}
	}
	if jsonOutput {
		json.NewEncoder(os.Stdout).Encode(deleted)
	} else {
		for what, err := range deleted {
			if err != "" {
				fmt.Fprintf(os.Stderr, "%s: %s\n", what, err)
			}
		}
	}
	for _, err := range deleted {
		if err != "" {
			return 1
		}
	}
	return 0
}

func init() {
	commands = append(commands, command{
		names:       []string{"delete"},
		optionsHelp: "[LayerOrImageOrContainerNameOrID [...]]",
		usage:       "Delete a layer or image or container, with no safety checks",
		minArgs:     1,
		action:      deleteThing,
		addFlags: func(flags *mflag.FlagSet, cmd *command) {
			flags.BoolVar(&jsonOutput, []string{"-json", "j"}, jsonOutput, "Prefer JSON output")
		},
	})
	commands = append(commands, command{
		names:       []string{"delete-layer", "deletelayer"},
		optionsHelp: "[LayerNameOrID [...]]",
		usage:       "Delete a layer, with safety checks",
		minArgs:     1,
		action:      deleteLayer,
		addFlags: func(flags *mflag.FlagSet, cmd *command) {
			flags.BoolVar(&jsonOutput, []string{"-json", "j"}, jsonOutput, "Prefer JSON output")
		},
	})
	commands = append(commands, command{
		names:       []string{"delete-image", "deleteimage"},
		optionsHelp: "[ImageNameOrID [...]]",
		usage:       "Delete an image, with safety checks",
		minArgs:     1,
		action:      deleteImage,
		addFlags: func(flags *mflag.FlagSet, cmd *command) {
			flags.BoolVar(&testDeleteImage, []string{"-test", "t"}, jsonOutput, "Only test removal")
			flags.BoolVar(&jsonOutput, []string{"-json", "j"}, jsonOutput, "Prefer JSON output")
		},
	})
	commands = append(commands, command{
		names:       []string{"delete-container", "deletecontainer"},
		optionsHelp: "[ContainerNameOrID [...]]",
		usage:       "Delete a container, with safety checks",
		minArgs:     1,
		action:      deleteContainer,
		addFlags: func(flags *mflag.FlagSet, cmd *command) {
			flags.BoolVar(&jsonOutput, []string{"-json", "j"}, jsonOutput, "Prefer JSON output")
		},
	})
}


text:
//
// Pythagoras - a collection of geometry classes
// http://github.com/samskivert/pythagoras

package pythagoras.f;

/**
 * Implements the identity transform.
 */
public class IdentityTransform extends AbstractTransform
{
    /** Identifies the identity transform in {@link #generality}. */
    public static final int GENERALITY = 0;

    @Override // from Transform
    public float uniformScale () {
        return 1;
    }

    @Override // from Transform
    public float scaleX () {
        return 1;
    }

    @Override // from Transform
    public float scaleY () {
        return 1;
    }

    @Override // from Transform
    public float rotation () {
        return 0;
    }

    @Override // from Transform
    public float tx () {
        return 0;
    }

    @Override // from Transform
    public float ty () {
        return 0;
    }

    @Override // from Transform
    public void get (float[] matrix) {
        matrix[0] = 1; matrix[1] = 0;
        matrix[2] = 0; matrix[3] = 1;
        matrix[4] = 0; matrix[5] = 0;
    }

    @Override // from Transform
    public Transform invert () {
        return this;
    }

    @Override // from Transform
    public Transform concatenate (Transform other) {
        return other;
    }

    @Override // from Transform
    public Transform preConcatenate (Transform other) {
        return other;
    }

    @Override // from Transform
    public Transform lerp (Transform other, float t) {
        throw new UnsupportedOperationException(); // TODO
    }

    @Override // from Transform
    public Point transform (IPoint p, Point into) {
        return into.set(p);
    }

    @Override // from Transform
    public void transform (IPoint[] src, int srcOff, Point[] dst, int dstOff, int count) {
        for (int ii = 0; ii < count; ii++) {
            transform(src[srcOff++], dst[dstOff++]);
        }
    }

    @Override // from Transform
    public void transform (float[] src, int srcOff, float[] dst, int dstOff, int count) {
        for (int ii = 0; ii < count; ii++) {
            dst[dstOff++] = src[srcOff++];
        }
    }

    @Override // from Transform
    public Point inverseTransform (IPoint p, Point into) {
        return into.set(p);
    }

    @Override // from Transform
    public Vector transformPoint (IVector v, Vector into) {
        return into.set(v);
    }

    @Override // from Transform
    public Vector transform (IVector v, Vector into) {
        return into.set(v);
    }

    @Override // from Transform
    public Vector inverseTransform (IVector v, Vector into) {
        return into.set(v);
    }

    @Override // from Transform
    public Transform copy () {
        return this;
    }

    @Override // from Transform
    public int generality () {
        return GENERALITY;
    }

    @Override
    public String toString () {
        return "ident";
    }
}


text:
'*******************************************************************************************'
'                                                                                '
' Download Free Evaluation Version From:     https://bytescout.com/download/web-installer   '
'                                                                                '
' Also available as Web API! Get free API Key https://app.pdf.co/signup                     '
'                                                                                '
' Copyright © 2017-2020 ByteScout, Inc. All rights reserved.                                '
' https://www.bytescout.com                                                                 '
' https://www.pdf.co                                                                        '
'*******************************************************************************************'

Imports System.Drawing.Imaging
Imports System.IO
Imports Bytescout.PDF
Imports xps2img

Imports Page = Bytescout.PDF.Page

''' <summary>
''' This example demonstrates converting xps document to pdf
''' </summary>
Class Program

    Shared Sub Main()

        ' Create new document
        Dim pdfDocument = New Document()
        pdfDocument.RegistrationName = "demo"
        pdfDocument.RegistrationKey = "demo"

        ' If you wish to load an existing document uncomment the line below And comment the Add page section instead
        ' pdfDocument.Load(".\existing_document.pdf")

        'Create instance And load file
        Dim xps2Image As New Xps2Image("Sample.xps")

        ' Set parameter
        Dim oParam As New Parameters()
        oParam.Dpi = 300 ' Set Dpi
        oParam.ImageType = ImageType.Png ' Output image type

        ' Get Bitmap from input file
        Dim outBitmapList = xps2Image.ToBitmap(oParam)

        For Each itmBitmap In outBitmapList

            ' Create New pdf page
            Dim page As New Page(PaperFormat.A4)

            ' Save image to a bytestream
            Dim byteStream As New MemoryStream()
            itmBitmap.Save(byteStream, ImageFormat.Png)

            ' Fill page with image
            Dim pageImage As New Image(byteStream)
            page.Canvas.DrawImage(pageImage, 5, 5, pageImage.Width / 2, pageImage.Height / 3)

            ' Add pdf page to pdf document
            pdfDocument.Pages.Add(page)

        Next

        ' Save document to file
        pdfDocument.Save("result.pdf")

        ' Cleanup
        pdfDocument.Dispose()

        ' Open result document in default associated application (for demo purpose)
        Dim processStartInfo As New ProcessStartInfo("result.pdf")
        processStartInfo.UseShellExecute = True
        Process.Start(processStartInfo)

    End Sub

End Class


text:
/* =======
 * HELPERS
 * =======

   Thanks to JCOC611 on stackoverflow!

 */

var vpwidth = function () {
   return window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth||0;
}
var vpheight = function () {
   return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0;
}

/* =====
 * TYPES
 * =====

   Types common to the whole game.

 */

/* CONSTANTS */
var BLOCK_WIDTH = Math.floor(vpwidth() / 60),
    BLOCK_HEIGHT = BLOCK_WIDTH,
    BLOCK_BASE_SPEED = 4,
    SNAKE_BASE_SPEED = 1,
    SNAKE_BASE_LOOPS_TO_MOVE = 20,
    SNAKE_BASE_LENGTH = 4;

Direction = {
  LEFT: 0,
  UP: 1,
  RIGHT: 2,
  DOWN: 3
}

function Block (opts) {
  this.x = (opts.x) ? opts.x : Math.floor(Math.random() * Math.floor( document.width/BLOCK_WIDTH )),
  this.y = (opts.y) ? opts.y : Math.floor(Math.random() * Math.floor( document.height/BLOCK_HEIGHT )),
  this.width = BLOCK_WIDTH,
  this.height = BLOCK_HEIGHT,
  this.moves = (opts.moves) ? opts.moves : false,
  this.fillStyle = (opts.fillStyle) ? opts.fillStyle : '#282828'; /* must be a color or a gradient or a pattern */

  this.multiplier = 1;
  this.direction = (opts.direction) ? opts.direction : Direction.UP;
  this.move = function () {
    switch (this.direction) {
      case Direction.LEFT:
        this.x = this.x - 1;
        break;
      case Direction.UP:
        this.y = this.y - 1;
        break;
      case Direction.RIGHT:
        this.x = this.x + 1;
        break;
      case Direction.DOWN:
        this.y = this.y + 1;
        break;
      default:
        return false;
    }
  };

  this.render = function () {
          ctx.fillStyle = (this.fillStyle)? this.fillStyle : '#282828';
          ctx.beginPath();
          ctx.rect((this.x)? this.x*BLOCK_WIDTH : 0,
                   (this.y)? this.y*BLOCK_HEIGHT : 0,
                   (this.width)? BLOCK_WIDTH : 0,
                   (this.height)? BLOCK_HEIGHT : 0); /* make this handle different shapes, images, etc. */
          ctx.closePath();
          ctx.fill();
  };
}

function Snake (opts, blockopts) {
  this.blocks = (blockopts) ? [ new Block (blockopts) ] : [ new Block ({ moves: true }) ],
  this.speed = (opts.speed) ? opts.speed : SNAKE_BASE_SPEED,
  this.loops_to_move = (opts.loops) ? opts.loops : SNAKE_BASE_LOOPS_TO_MOVE,
  this.loops = 0;
  this.tail;
  this.direction = (opts.direction) ? opts.direction : Direction.UP;
  this.moves = true;
  this.move = function () {
    if(++this.loops >= this.loops_to_move) {
        for(var x = 0; x < this.speed; x++) {
          this.tail = this.blocks.pop();
          this.tail.x = this.blocks[0].x; this.tail.y = this.blocks[0].y; this.tail.direction = this.blocks[0].direction;
          this.preventOuroboros();
          this.tail.move();
          this.blocks.unshift(this.tail)
        }
        this.loops = 0;
    }
  };

  this.preventOuroboros = function () {
    if((this.tail.direction == Direction.LEFT && this.direction == Direction.RIGHT)
    || (this.tail.direction == Direction.UP && this.direction == Direction.DOWN)
    || (this.tail.direction == Direction.RIGHT && this.direction == Direction.LEFT)
    || (this.tail.direction == Direction.DOWN && this.direction == Direction.UP))
      return;
    else this.tail.direction = this.direction;
  };

  this.render = function () {
    this.blocks.forEach(function(e, i, a) {
      e.render();
    });
  }

  var size = (opts.size) ? opts.size : SNAKE_BASE_LENGTH;

  while(this.blocks.length < size) this.blocks.push (new Block( { x: this.blocks[this.blocks.length - 1].x, y: this.blocks[this.blocks.length - 1].y + 1, moves: true} ));

}

/* ======
 * EVENTS
 * ======

   Common game events.
   These events can happen to nearly any object.
   If I define a base object type for games, these will go there.

 */

function atWorldsEnd() {
  var snakeHead;

  if(!entities) return false;
  if(!(snakeHead = entities[0].blocks[0]))return false;

  if(snakeHead.x < 0
     ||
     snakeHead.y < 0
     ||
     snakeHead.x > document.width/BLOCK_WIDTH - 1
     ||
     snakeHead.y > document.height/BLOCK_WIDTH - 1)
        return true;

  return false;
}

function bitingSelf() {
  if(!entities) return false;
  if(!entities[0].blocks[0]) return false;

  var head,
      ret = false;
  entities[0].blocks.some(function (e, i, a) {
    if(!head) { head = e; }
    else if(Math.sqrt(Math.pow(head.x - e.x, 2) + Math.pow(head.y - e.y, 2)) < 1) return (ret = true);
  });
  return ret;
}

function eatingEgg() {
  var head;
  if(!entities) return false;
  if(!(head = entities[0].blocks[0])) return false;
  if(!entities[1]) return false;

  if(!head) { head = entities[0].blocks[0]; }
  else if(Math.sqrt(Math.pow(head.x - entities[1].x, 2) + Math.pow(head.y - entities[1].y, 2)) < 1) return true;

  return false;
}

/* =======
 * ACTIONS
 * =======

   Common game actions.
   These actions can be performed by nearly any object.
   If I define a base object type for games, these will go there.

 */

function move () {
  if(!entities) return false;
  entities.forEach(function (e, i, a) {
    if(e.moves) e.move();
  });
}

function respawn () {
  if(!entities) return false;
  entities = [ new Snake({ }, { }) ];
  if(highscore < score) highscore = score;
  score = 0;
  entities[1] =  new Block ({ fillStyle: '#CC3A09' }) ;
}

function eggSpawn () {
  if(!entities) return false;
  if(!entities[0]) return respawn();
  entities[1] =  new Block ({ fillStyle: '#CC3A09' }) ;
  growSnake();
  score++;
  entities[0].loops_to_move = (entities[0].loops_to_move)*0.95 //used to be //entities[0].loops_to_move--;
}

function growSnake () {
  if(!entities) return false;
  if(!entities[0]) return false;

  var block,
      i,
      snakeBlocks = entities[0].blocks;

  i = snakeBlocks.length - 1;

  switch(snakeBlocks[i].direction) {
    case Direction.LEFT: //add it to the right of the last one
      block = new Block( { x: snakeBlocks[i].x + 1, y: snakeBlocks[i], moves: true } );
      break;
    case Direction.UP: //add it to the bottom of the last one
      block = new Block( { x: snakeBlocks[i].x, y: snakeBlocks[i].y + 1, moves: true} );
      break;
    case Direction.RIGHT: //add it to the left of the last one
      block = new Block( { x: snakeBlocks[i].x - 1, y: snakeBlocks[i], moves: true} );
      break;
    case Direction.DOWN: //add it to the top of the last one
      block = new Block( { x: snakeBlocks[i].x, y: snakeBlocks[i].y - 1, moves: true} );
      break;
    default:
      break;
  }

  snakeBlocks.push(block);
  entities[0].blocks = snakeBlocks;
}

/* ====
 * GAME
 * ====
 */

var width = vpwidth(),
    height = vpheight(),
    c = document.getElementById('c'),
    ctx = c.getContext('2d'),
    entities,
    game,
    inputs = [],
    paused = false,
    score = 0,
    highscore = 0;

ctx.font = "22pt Arial";

var clear = function () {
        width = vpwidth();
        height = vpheight();
        if(c.width != vpwidth() || c.height != vpheight()) {
          c.width = vpwidth();
          c.height = vpheight();
          BLOCK_WIDTH = Math.floor(vpwidth() / 60);
          BLOCK_HEIGHT = BLOCK_WIDTH;
        }
        ctx.fillStyle = '#fafafa';
        ctx.beginPath();
        ctx.rect(0, 0, width, height);
        ctx.closePath();
        ctx.fill();
    };

var render = function () {
        if(!entities) return;
        entities.forEach(function (e, i, a) {
          e.render();
        });

        ctx.fillStyle = '#282828';
        ctx.beginPath();
        ctx.fillText('Score: ' + score, c.width/20, c.height/20);
        ctx.fillText('High score: ' + highscore, c.width/20, c.height/10);
        ctx.closePath();
        ctx.fill();
    };

var logic = function () {
        if(!entities) {
          entities = [ new Snake({ }, { }), new Block ({ moves: false, fillStyle: '#CC3A09' }) ];
          return;
        }
        if(inputs.length != 0)
            entities[0].direction = inputs.pop();
        if(atWorldsEnd()) return respawn();
        if(bitingSelf()) return respawn();
        if(eatingEgg()) return eggSpawn();
        return move();
    };

var loop = function () {
        clear();
        render();
        logic();
        game = setTimeout(loop, 10);
    };

var renderPause = function () {
        ctx.fillStyle = "rgba(0, 0, 0, .5)";
        ctx.beginPath();
        ctx.rect(0, 0, c.width, c.height);
        ctx.closePath();
        ctx.fill();

        ctx.fillStyle = "#fff";
        ctx.beginPath();
        ctx.fillText('Press <P> or <ESC> to continue playing.', c.width*3/8, c.height/2); //FIXME
        ctx.closePath();
}

var pause = function () {
        renderPause();
        if(!paused) {
          game = clearTimeout(game);
          paused = true;
        } else {
          game = setTimeout(loop, 10);
          paused = false;
        }
}

document.addEventListener('keydown', function (e) {
  var d = entities[0].direction,
      key = e.which;

  if      (key == '37' && d != Direction.RIGHT) d = Direction.LEFT;
  else if (key == '38' && d != Direction.DOWN)  d = Direction.UP;
  else if (key == '39' && d != Direction.LEFT)  d = Direction.RIGHT;
  else if (key == '40' && d != Direction.UP)    d = Direction.DOWN;
  else if (key == '27' || key == '80') pause();

  inputs.push(d);
});

loop();


text:
$WinlogonPath = "HKLM:\Software\Microsoft\Windows NT\CurrentVersion\Winlogon"
Remove-ItemProperty -Path $WinlogonPath -Name AutoAdminLogon
Remove-ItemProperty -Path $WinlogonPath -Name DefaultUserName

iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/mwrock/boxstarter/master/BuildScripts/bootstrapper.ps1'))
Get-Boxstarter -Force

# Testing something by moving this:
# It seems that if WMF5 is installed and then rebooted (now PS is running v5) and then the WinRM stuff is enabled, vagrant errors out with WinRM::WinRMAuthorizationError
# however if these settings are applied first then WMF5 is intalled it works fine... I have no idea why... Need to investgate further...
Write-Host "Setting up WinRM"
#block WinRM for now. need to hold off untill boxstarter is finished, then packer provisioning will take over
netsh advfirewall firewall add rule name="WinRM-HTTP" dir=in localport=5985 protocol=TCP action=block
$enableArgs=@{Force=$true}
try {
 $command = Get-Command Enable-PSRemoting
  if ($command.Parameters.Keys -contains "skipnetworkprofilecheck") {
      $enableArgs.skipnetworkprofilecheck=$true
  }
}
catch {
  $global:error.RemoveAt(0)
}

Enable-PSRemoting @enableArgs
Enable-WSManCredSSP -Force -Role Server
winrm set winrm/config/client/auth '@{Basic="true"}'
winrm set winrm/config/service/auth '@{Basic="true"}'
winrm set winrm/config/service '@{AllowUnencrypted="true"}'
Write-Host "winrm setup complete... with exception of firewall rule, blocking untill boxstarter finishes setup"

# Install latest version of PowerShell (currently v5) from chocolatey
# cannot using packer provisioning because it uses WinRM ... cannot install from WinRM, so this needs to be done before provisioning.
# REF http://www.hurryupandwait.io/blog/safely-running-windows-automation-operations-that-typically-fail-over-winrm-or-powershell-remoting
# Also after much trial and error there are issues installing it using Boxstarter, so doing it here instead

choco install powershell -y

$secpasswd = ConvertTo-SecureString "vagrant" -AsPlainText -Force
$cred = New-Object System.Management.Automation.PSCredential ("vagrant", $secpasswd)
Import-Module $env:appdata\boxstarter\boxstarter.chocolatey\boxstarter.chocolatey.psd1
Install-BoxstarterPackage -PackageName a:\package.ps1 -Credential $cred

# Testing something by using -DisableReboots
# It seems that if WMF5 is installed and then rebooted (now PS is running v5) and then the WinRM stuff is enabled, vagrant errors out with WinRM::WinRMAuthorizationError
# however if these settings are applied first then WMF5 is intalled it works fine... I have no idea why... Need to investgate further...


text:
using namespace std;
using namespace boost::program_options;

namespace ndn {
class DashPlayer
{
    public:
        DashPlayer(string MPD, int interest_lifetime);
        virtual ~DashPlayer();
        void startStreaming();

    private:
        void writeFileToDisk(shared_ptr<itec::Buffer> buf, string file_path);

        int interest_lifetime;
        string MPD;
        bool streaming_active;

        FileDownloader downloader;
};
}   // end namespace ndn

#endif // DashPlayer_H


text:
using System;
using System.Text;
using System.Web.Mvc;
using Nop.Plugin.Shipping.USPS.Domain;
using Nop.Plugin.Shipping.USPS.Models;
using Nop.Services.Configuration;
using Nop.Services.Localization;
using Nop.Web.Framework.Controllers;

namespace Nop.Plugin.Shipping.USPS.Controllers
{
    [AdminAuthorize]
    public class ShippingUSPSController : BasePluginController
    {
        private readonly USPSSettings _uspsSettings;
        private readonly ISettingService _settingService;
        private readonly ILocalizationService _localizationService;

        public ShippingUSPSController(USPSSettings uspsSettings,
            ISettingService settingService,
            ILocalizationService localizationService)
        {
            this._uspsSettings = uspsSettings;
            this._settingService = settingService;
            this._localizationService = localizationService;
        }

        [ChildActionOnly]
        public ActionResult Configure()
        {
            var model = new USPSShippingModel();
            model.Url = _uspsSettings.Url;
            model.Username = _uspsSettings.Username;
            model.Password = _uspsSettings.Password;
            model.AdditionalHandlingCharge = _uspsSettings.AdditionalHandlingCharge;

            // Load Domestic service names
            string carrierServicesOfferedDomestic = _uspsSettings.CarrierServicesOfferedDomestic;
            foreach (string service in USPSServices.DomesticServices)
                model.AvailableCarrierServicesDomestic.Add(service);

            if (!String.IsNullOrEmpty(carrierServicesOfferedDomestic))
                foreach (string service in USPSServices.DomesticServices)
                {
                    string serviceId = USPSServices.GetServiceIdDomestic(service);
                    if (!String.IsNullOrEmpty(serviceId))
                    {
                        // Add delimiters [] so that single digit IDs aren't found in multi-digit IDs
                        if (carrierServicesOfferedDomestic.Contains(String.Format("[{0}]", serviceId)))
                            model.CarrierServicesOfferedDomestic.Add(service);
                    }
                }

            // Load Internation service names
            string carrierServicesOfferedInternational = _uspsSettings.CarrierServicesOfferedInternational;
            foreach (string service in USPSServices.InternationalServices)
                model.AvailableCarrierServicesInternational.Add(service);

            if (!String.IsNullOrEmpty(carrierServicesOfferedInternational))
                foreach (string service in USPSServices.InternationalServices)
                {
                    string serviceId = USPSServices.GetServiceIdInternational(service);
                    if (!String.IsNullOrEmpty(serviceId))
                    {
                        // Add delimiters [] so that single digit IDs aren't found in multi-digit IDs
                        if (carrierServicesOfferedInternational.Contains(String.Format("[{0}]", serviceId)))
                            model.CarrierServicesOfferedInternational.Add(service);
                    }
                }
            return View("~/Plugins/Shipping.USPS/Views/Configure.cshtml", model);
        }

        [HttpPost]
        [ChildActionOnly]
        public ActionResult Configure(USPSShippingModel model)
        {
            if (!ModelState.IsValid)
            {
                return Configure();
            }

            //save settings
            _uspsSettings.Url = model.Url;
            _uspsSettings.Username = model.Username;
            _uspsSettings.Password = model.Password;
            _uspsSettings.AdditionalHandlingCharge = model.AdditionalHandlingCharge;

            // Save selected Domestic services
            var carrierServicesOfferedDomestic = new StringBuilder();
            int carrierServicesDomesticSelectedCount = 0;
            if (model.CheckedCarrierServicesDomestic != null)
            {
                foreach (var cs in model.CheckedCarrierServicesDomestic)
                {
                    carrierServicesDomesticSelectedCount++;

                    string serviceId = USPSServices.GetServiceIdDomestic(cs);
                    //unselect any other services if NONE is selected
                    if (!String.IsNullOrEmpty(serviceId) && serviceId.Equals("NONE"))
                    {
                        carrierServicesOfferedDomestic.Clear();
                        carrierServicesOfferedDomestic.AppendFormat("[{0}]:", serviceId);
                        break;
                    }

                    if (!String.IsNullOrEmpty(serviceId))
                    {
                        // Add delimiters [] so that single digit IDs aren't found in multi-digit IDs
                        carrierServicesOfferedDomestic.AppendFormat("[{0}]:", serviceId);
                    }
                }
            }
            // Add default options if no services were selected
            if (carrierServicesDomesticSelectedCount == 0)
                _uspsSettings.CarrierServicesOfferedDomestic = "[1]:[3]:[4]:";
            else
                _uspsSettings.CarrierServicesOfferedDomestic = carrierServicesOfferedDomestic.ToString();

            // Save selected International services
            var carrierServicesOfferedInternational = new StringBuilder();
            int carrierServicesInternationalSelectedCount = 0;
            if (model.CheckedCarrierServicesInternational != null)
            {
                foreach (var cs in model.CheckedCarrierServicesInternational)
                {
                    carrierServicesInternationalSelectedCount++;
                    string serviceId = USPSServices.GetServiceIdInternational(cs);
                    // unselect other services if NONE is selected
                    if (!String.IsNullOrEmpty(serviceId) && serviceId.Equals("NONE"))
                    {
                        carrierServicesOfferedInternational.Clear();
                        carrierServicesOfferedInternational.AppendFormat("[{0}]:", serviceId);
                        break;
                    }
                    if (!String.IsNullOrEmpty(serviceId))
                    {
                        // Add delimiters [] so that single digit IDs aren't found in multi-digit IDs
                        carrierServicesOfferedInternational.AppendFormat("[{0}]:", serviceId);
                    }
                }
            }
            // Add default options if no services were selected
            if (carrierServicesInternationalSelectedCount == 0)
                _uspsSettings.CarrierServicesOfferedInternational = "[2]:[15]:[1]:";
            else
                _uspsSettings.CarrierServicesOfferedInternational = carrierServicesOfferedInternational.ToString();

            _settingService.SaveSetting(_uspsSettings);

            SuccessNotification(_localizationService.GetResource("Admin.Plugins.Saved"));

            return Configure();
        }

    }
}


text:
Exercise 33: While Loops¶

Now to totally blow your mind with a new loop, the <tt class="docutils literal">while-loop</tt>. A
<tt class="docutils literal">while-loop</tt> will keep executing the code block under it as long as a
boolean expression is True.

Wait, you have been keeping up with the terminology right? That if we
write a statement such as <tt class="docutils literal">if items > 5</tt> or <tt class="docutils literal">for fruit in fruits</tt> we
are starting a code block. Then we indent the lines that follow, which
are said to be within the block, until we reach an <tt class="docutils literal">end</tt> statement,
which closes the block. This is all about structuring your programs so
that Ruby knows what you mean. If you do not get that idea then go back
and do some more work with <tt class="docutils literal">if-statements</tt>, functions, and the
<tt class="docutils literal">for-loop</tt> until you get it.

Later on we'll have some exercises that will train your brain to read
these structures, similar to how we burned boolean expressions into your
brain.

Back to <tt class="docutils literal">while-loops</tt>. What they do is simply do a test like an
<tt class="docutils literal">if-statement</tt>, but instead of running the code block once, they jump
back to the "top" where the <tt class="docutils literal">while</tt> is, and repeat. It keeps doing
this until the expression is False.

Here's the problem with <tt class="docutils literal">while-loops</tt>: sometimes they do not stop.
This is great if your intention is to just keep looping until the end of
the universe. Otherwise you almost always want your loops to end
eventually.

To avoid these problems, there's some rules to follow:

Make sure that you use <tt class="docutils literal">while-loops</tt> sparingly. Usually a
<tt class="docutils literal">for-loop</tt> is better.

Review your <tt class="docutils literal">while</tt> statements and make sure that the thing you are
testing will become False at some point.

When in doubt, print out your test variable at the top and bottom of
the <tt class="docutils literal">while-loop</tt> to see what it's doing.

In this exercise, you will learn the <tt class="docutils literal">while-loop</tt> by doing the above
three things:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17

i = 0
numbers = []

while i < 6
  puts "At the top i is #{i}"
  numbers.push(i)

  i = i + 1
  puts "Numbers now: #{numbers}"
  puts "At the bottom i is #{i}"
end

puts "The numbers: "

for num in numbers
  puts num
end

What You Should See¶

$ ruby ex33.rb
At the top i is 0
Numbers now:  [0]
At the bottom i is 1
At the top i is 1
Numbers now:  [0, 1]
At the bottom i is 2
At the top i is 2
Numbers now:  [0, 1, 2]
At the bottom i is 3
At the top i is 3
Numbers now:  [0, 1, 2, 3]
At the bottom i is 4
At the top i is 4
Numbers now:  [0, 1, 2, 3, 4]
At the bottom i is 5
At the top i is 5
Numbers now:  [0, 1, 2, 3, 4, 5]
At the bottom i is 6
The numbers:
0
1
2
3
4
5

Extra Credit¶

Convert this <tt class="docutils literal">while</tt> loop to a function that you can call, and
replace 6 in the test <tt class="docutils literal">(i < 6)</tt> with a variable.

Now use this function to rewrite the script to try different numbers.

Add another variable to the function arguments that you can pass in
that lets you change the <tt class="docutils literal">+ 1</tt> on line 8 so you can change how much
it increments by.

Rewrite the script again to use this function to see what effect that
has.

Now, write it to use <tt class="docutils literal">for-loops</tt> and ranges instead. Do you need
the incrementor in the middle anymore? What happens if you do not get
rid of it?

If at any time that you are doing this it goes crazy (it probably will),
just hold down CTRL and hit c (CTRL-c) and the program will abort.


text:
layout: leaf-node
title: "Experimental Design"
title-url: "http://www.socialresearchmethods.net/kb/desexper.php"
author: "William Trochim"
groups: research-principles-and-methodologies
categories: research-basics
topics: experimental-designs
summary: >
    This page provides a brief description of types of experimental research design.
cite: >
    Trochim, W. (2006). Experimental Design. Research Methods Knowledge Base.
    Retrieved from http://www.socialresearchmethods.net/kb/desexper.php
pub-date: 2006-10-20
added-date: 2017-04-30
resource-type: external-page
---


text: export * from './add-credit.component'


text:
package org.apache.spark.sql.execution.command.schema

import org.apache.spark.sql.{Row, SparkSession}
import org.apache.spark.sql.catalyst.TableIdentifier
import org.apache.spark.sql.execution.command._
import org.apache.spark.util.AlterTableUtil

private[sql] case class CarbonAlterTableUnsetCommand(
    tableIdentifier: TableIdentifier,
    propKeys: Seq[String],
    ifExists: Boolean,
    isView: Boolean)
  extends MetadataCommand {

  override def processMetadata(sparkSession: SparkSession): Seq[Row] = {
    setAuditTable(tableIdentifier.database.getOrElse(sparkSession.catalog.currentDatabase),
      tableIdentifier.table)
    AlterTableUtil.modifyTableProperties(tableIdentifier, Map.empty[String, String],
      propKeys, false)(sparkSession,
      sparkSession.sessionState.catalog)
    setAuditInfo(Map("unset" -> propKeys.mkString(", ")))
    Seq.empty
  }

  override protected def opName: String = "ALTER TABLE UNSET"
}


text:
$(function() {
	marked.setOptions({
	  sanitize: true
	});
	$(".wmd-input").on('keyup', function(){
		var self = $(this),
		preview = self.closest(".wmd").find(".md-preview");
		if(self.val().length == 0){
			preview.addClass("hidden");
		}else{
			preview.removeClass("hidden");
			preview.html(marked(self.val()));
		}
	});

	if($(".wmd-panel").length > 0) {
		var converter1 = Markdown.getSanitizingConverter();
		var editor1 = new Markdown.Editor(converter1);
		editor1.run();
        Globals.markdownEditor = editor1;
	}

});


text:
object UnapplySeqTest {
  def unapplySeq(any: Any): Option[(Int, Seq[Int])] = Some((5, List(1)))
}

object Test extends App {
  null match {
    case UnapplySeqTest(5) => println("uh-oh")
    case UnapplySeqTest(5, 1) => println("Matched!") // compiles
    case UnapplySeqTest(5, xs @ _*) => println("toooo long: "+ (xs: Seq[Int]))
  }
}