text:
<?php

namespace Mf\ManagerBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use JMS\Serializer\Annotation\ExclusionPolicy;
use JMS\Serializer\Annotation\Expose;

/**
 * Team
 *
 * @ORM\Table(name="mf_team")
 * @ORM\Entity(repositoryClass="Mf\ManagerBundle\Entity\TeamRepository")
 * @ExclusionPolicy("all")
 */
class Team
{
    /**
     * @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)
     * @Expose
     */
    private $name;

    /**
     * @ORM\ManyToOne(targetEntity="Mf\UserBundle\Entity\User", inversedBy="teams")
     * @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=false)
     */
    private $user;

    /**
     * @ORM\ManyToMany(targetEntity="LeagueSeason", inversedBy="teams")
     * @ORM\JoinTable(name="mf_teams_leagues_seasons")
     */
    private $leagues_seasons;

    /**
     * @ORM\OneToMany(targetEntity="TeamPlayer", mappedBy="team")
     */
    private $team_players;

    /**
     * @ORM\OneToMany(targetEntity="TeamPoint", mappedBy="team")
     */
    private $team_points;

    /**
     * @ORM\OneToMany(targetEntity="Lineup", mappedBy="team")
     */
    private $lineups;

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

    public function __toString()
    {
        return (string) $this->getName();
    }

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

        return $this;
    }

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

    /**
     * Set user
     *
     * @param \Mf\UserBundle\Entity\User $user
     * @return Team
     */
    public function setUser(\Mf\UserBundle\Entity\User $user)
    {
        $this->user = $user;

        return $this;
    }

    /**
     * Get user
     *
     * @return \Mf\UserBundle\Entity\User
     */
    public function getUser()
    {
        return $this->user;
    }

    /**
     * Add team_players
     *
     * @param \Mf\ManagerBundle\Entity\TeamPlayer $teamPlayers
     * @return Team
     */
    public function addTeamPlayer(\Mf\ManagerBundle\Entity\TeamPlayer $teamPlayers)
    {
        $this->team_players[] = $teamPlayers;

        return $this;
    }

    /**
     * Remove team_players
     *
     * @param \Mf\ManagerBundle\Entity\TeamPlayer $teamPlayers
     */
    public function removeTeamPlayer(\Mf\ManagerBundle\Entity\TeamPlayer $teamPlayers)
    {
        $this->team_players->removeElement($teamPlayers);
    }

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

    /**
     * Add team_points
     *
     * @param \Mf\ManagerBundle\Entity\TeamPoint $teamPoints
     * @return Team
     */
    public function addTeamPoint(\Mf\ManagerBundle\Entity\TeamPoint $teamPoints)
    {
        $this->team_points[] = $teamPoints;

        return $this;
    }

    /**
     * Remove team_points
     *
     * @param \Mf\ManagerBundle\Entity\TeamPoint $teamPoints
     */
    public function removeTeamPoint(\Mf\ManagerBundle\Entity\TeamPoint $teamPoints)
    {
        $this->team_points->removeElement($teamPoints);
    }

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

    /**
     * Add lineups
     *
     * @param \Mf\ManagerBundle\Entity\Lineup $lineups
     * @return Team
     */
    public function addLineup(\Mf\ManagerBundle\Entity\Lineup $lineups)
    {
        $this->lineups[] = $lineups;

        return $this;
    }

    /**
     * Remove lineups
     *
     * @param \Mf\ManagerBundle\Entity\Lineup $lineups
     */
    public function removeLineup(\Mf\ManagerBundle\Entity\Lineup $lineups)
    {
        $this->lineups->removeElement($lineups);
    }

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

    /**
     * Add leagues_seasons
     *
     * @param \Mf\ManagerBundle\Entity\LeagueSeason $leaguesSeasons
     * @return Team
     */
    public function addLeaguesSeason(\Mf\ManagerBundle\Entity\LeagueSeason $leaguesSeasons)
    {
        $this->leagues_seasons[] = $leaguesSeasons;

        return $this;
    }

    /**
     * Remove leagues_seasons
     *
     * @param \Mf\ManagerBundle\Entity\LeagueSeason $leaguesSeasons
     */
    public function removeLeaguesSeason(\Mf\ManagerBundle\Entity\LeagueSeason $leaguesSeasons)
    {
        $this->leagues_seasons->removeElement($leaguesSeasons);
    }

    /**
     * Get leagues_seasons
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getLeaguesSeasons()
    {
        return $this->leagues_seasons;
    }
    /**
     * Constructor
     */
    public function __construct()
    {
        $this->leagues_seasons = new \Doctrine\Common\Collections\ArrayCollection();
        $this->team_players = new \Doctrine\Common\Collections\ArrayCollection();
        $this->team_points = new \Doctrine\Common\Collections\ArrayCollection();
        $this->lineups = new \Doctrine\Common\Collections\ArrayCollection();
    }

}


text:
// Copyright (c) Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.

using System.Collections.Generic;

namespace Microsoft.CodeAnalysis.Editor
{
    internal interface IContentTypeMetadata
    {
        IEnumerable<string> ContentTypes { get; }
    }
}

redpajama_set_name: RedPajamaGithub


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System.Text.Json;
using Azure.Core;

namespace Azure.AI.MetricsAdvisor.Models
{
    internal partial class ServicePrincipalInKVParamPatch
    {
        // Full qualification must be used so CodeGen skips the generation of this method.
        // See: https://github.com/Azure/autorest.csharp/issues/793
        void global::Azure.Core.IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
        {
            writer.WriteStartObject();
            writer.WriteNullObjectValue("keyVaultEndpoint", KeyVaultEndpoint);
            writer.WriteNullObjectValue("keyVaultClientId", KeyVaultClientId);
            if (Optional.IsDefined(KeyVaultClientSecret))
            {
                writer.WritePropertyName("keyVaultClientSecret");
                writer.WriteStringValue(KeyVaultClientSecret);
            }
            writer.WriteNullObjectValue("servicePrincipalIdNameInKV", ServicePrincipalIdNameInKV);
            writer.WriteNullObjectValue("servicePrincipalSecretNameInKV", ServicePrincipalSecretNameInKV);
            writer.WriteNullObjectValue("tenantId", TenantId);
            writer.WriteEndObject();
        }
    }
}


text:
case class WithSynthetic()

case class WithObject()
object WithObject


text:
package com.ezardlabs.dethsquare;

import com.ezardlabs.dethsquare.Touch.TouchPhase;
import com.ezardlabs.dethsquare.util.GameListeners;
import com.ezardlabs.dethsquare.util.GameListeners.KeyListener;
import com.ezardlabs.dethsquare.util.GameListeners.MouseListener;

import java.util.ArrayList;
import java.util.HashMap;

public final class Input {
	static {
		GameListeners.addMouseListener(new MouseListener() {
			@Override
			public void onMove(int x, int y) {
				mousePosition.set(x, y);
			}

			@Override
			public void onButtonDown(int index) {
				switch(index) {
					case 1:
						setKeyDown(KeyCode.MOUSE_LEFT);
						break;
					case 2:
						setKeyDown(KeyCode.MOUSE_MIDDLE);
						break;
					case 3:
						setKeyDown(KeyCode.MOUSE_RIGHT);
						break;
					default:
						break;
				}
			}

			@Override
			public void onButtonUp(int index) {
				switch(index) {
					case 1:
						setKeyUp(KeyCode.MOUSE_LEFT);
						break;
					case 2:
						setKeyUp(KeyCode.MOUSE_MIDDLE);
						break;
					case 3:
						setKeyUp(KeyCode.MOUSE_RIGHT);
						break;
					default:
						break;
				}
			}
		});
		GameListeners.addKeyListener(new KeyListener() {
			@Override
			public void onKeyDown(String key) {
				setKeyDown(KeyCode.valueOf(key));
			}

			@Override
			public void onKeyUp(String key) {
				setKeyUp(KeyCode.valueOf(key));
			}
		});

		GameListeners.addUpdateListener(Input::update);
	}

	public static final Vector2 mousePosition = new Vector2();

	public static Touch[] touches = new Touch[0];

	/**
	 * Each key that has been pressed either has a value of true if it has been pressed down in the current frame, or false if it's been held down for multiple frames
	 */
	private static HashMap<KeyCode, Integer> keys = new HashMap<>();
	private static HashMap<KeyCode, Integer> keyChanges = new HashMap<>();

	private static ArrayList<Holder> changesToMake = new ArrayList<>(10);
	private static ArrayList<Touch> touchesToRemove = new ArrayList<>(10);

	public enum KeyCode {
		A,
		B,
		C,
		D,
		E,
		F,
		G,
		H,
		I,
		J,
		K,
		L,
		M,
		N,
		O,
		P,
		Q,
		R,
		S,
		T,
		U,
		V,
		W,
		X,
		Y,
		Z,
		ALPHA_0,
		ALPHA_1,
		ALPHA_2,
		ALPHA_3,
		ALPHA_4,
		ALPHA_5,
		ALPHA_6,
		ALPHA_7,
		ALPHA_8,
		ALPHA_9,
		SPACE,
		RETURN,
		ESCAPE,
		BACKSPACE,
		DELETE,
		F1,
		F2,
		F3,
		F4,
		F5,
		F6,
		F7,
		F8,
		F9,
		F10,
		F11,
		F12,
		MOUSE_LEFT,
		MOUSE_RIGHT,
		MOUSE_MIDDLE
	}

	private static class Holder {
		int id;
		float x;
		float y;
		TouchPhase phase;

		Holder(int id, float x, float y, TouchPhase phase) {
			this.id = id;
			this.x = x;
			this.y = y;
			this.phase = phase;
		}
	}

	public static void update() {
		Holder holder;
		for (int i = 0; i < changesToMake.size(); i++) {
			switch((holder = changesToMake.get(i)).phase) {
				case BEGAN:
					Touch[] temp = new Touch[touches.length + 1];
					System.arraycopy(touches, 0, temp, 0, touches.length);
					temp[touches.length] = new Touch(holder.id, new Vector2(holder.x, holder.y));
					touches = temp;
					break;
				case MOVED:
					for (Touch t : touches) {
						if (t.fingerId == holder.id && t.lastModified < Time.frameCount) {
							t.phase = Touch.TouchPhase.MOVED;
							t.position.set(holder.x, holder.y);
							t.lastModified = Time.frameCount;
						}
					}
					break;
				case STATIONARY:
					break;
				case ENDED:
					for (Touch t : touches) {
						if (t.fingerId == holder.id) {
							t.phase = Touch.TouchPhase.ENDED;
							t.position.set(holder.x, holder.y);
							t.lastModified = Time.frameCount;
						}
					}
					break;
				case CANCELLED:
					for (Touch t : touches) {
						if (t.fingerId == holder.id) {
							t.phase = Touch.TouchPhase.CANCELLED;
							t.position.set(holder.x, holder.y);
							t.lastModified = Time.frameCount;
						}
					}
					break;
				default:
					break;
			}
		}

		changesToMake.clear();

		for (KeyCode keyCode : keys.keySet().toArray(new KeyCode[keys.size()])) {
			switch (keys.get(keyCode)) {
				case 0:
					keys.put(keyCode, 1);
					break;
				case 2:
					keys.remove(keyCode);
					break;
				default:
					break;
			}
		}
		keys.putAll(keyChanges);
		keyChanges.clear();
		//noinspection ForLoopReplaceableByForEach
		for (int i = 0; i < touches.length; i++) {
			if ((touches[i].phase == Touch.TouchPhase.ENDED || touches[i].phase == Touch.TouchPhase.CANCELLED) && touches[i].lastModified < Time.frameCount) {
				touchesToRemove.add(touches[i]);
			} else if (touches[i].lastModified < Time.frameCount) {
				touches[i].lastModified = Time.frameCount;
				touches[i].phase = Touch.TouchPhase.STATIONARY;
			}
		}
		if (!touchesToRemove.isEmpty()) {
			Touch[] temp = new Touch[touches.length - touchesToRemove.size()];
			int count = 0;
			//noinspection ForLoopReplaceableByForEach
			for (int i = 0; i < touches.length; i++) {
				if (!touchesToRemove.contains(touches[i])) {
					temp[count++] = touches[i];
				}
			}
			touchesToRemove.clear();
			touches = temp;
		}
	}

	private static void setKeyDown(KeyCode keyCode) {
		if (!keys.containsKey(keyCode)) keyChanges.put(keyCode, 0);
	}

	private static void setKeyUp(KeyCode keyCode) {
		keyChanges.put(keyCode, 2);
	}

	public static boolean getKeyDown(KeyCode keyCode) {
		return keys.containsKey(keyCode) && keys.get(keyCode) == 0;
	}

	public static boolean getKey(KeyCode keyCode) {
		return keys.containsKey(keyCode) && keys.get(keyCode) < 2;
	}

	public static boolean getKeyUp(KeyCode keyCode) {
		return keys.containsKey(keyCode) && keys.get(keyCode) == 2;
	}

	public static void addTouch(int id, float x, float y) {
		changesToMake.add(new Holder(id, x, y, TouchPhase.BEGAN));
	}

	public static void moveTouch(int id, float x, float y) {
		changesToMake.add(new Holder(id, x, y, TouchPhase.MOVED));
	}

	public static void removeTouch(int id, float x, float y) {
		changesToMake.add(new Holder(id, x, y, TouchPhase.ENDED));
	}

	public static void cancelTouch(int id, float x, float y) {
		changesToMake.add(new Holder(id, x, y, TouchPhase.CANCELLED));
	}
}


text:
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Xunit.Abstractions;
using Xunit.Sdk;

namespace Microsoft.AspNetCore.Testing;

internal sealed class AspNetTestClassRunner : XunitTestClassRunner
{
    public AspNetTestClassRunner(
        ITestClass testClass,
        IReflectionTypeInfo @class,
        IEnumerable<IXunitTestCase> testCases,
        IMessageSink diagnosticMessageSink,
        IMessageBus messageBus,
        ITestCaseOrderer testCaseOrderer,
        ExceptionAggregator aggregator,
        CancellationTokenSource cancellationTokenSource,
        IDictionary<Type, object> collectionFixtureMappings)
        : base(testClass, @class, testCases, diagnosticMessageSink, messageBus, testCaseOrderer, aggregator, cancellationTokenSource, collectionFixtureMappings)
    {
    }

    protected override Task<RunSummary> RunTestMethodAsync(ITestMethod testMethod, IReflectionMethodInfo method, IEnumerable<IXunitTestCase> testCases, object[] constructorArguments)
    {
        var runner = new AspNetTestMethodRunner(
            testMethod,
            Class,
            method,
            testCases,
            DiagnosticMessageSink,
            MessageBus,
            new ExceptionAggregator(Aggregator),
            CancellationTokenSource,
            constructorArguments);
        return runner.RunAsync();
    }
}


text:
package com.zimbra.soap.base;

import java.util.List;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;

@XmlAccessorType(XmlAccessType.NONE)
public interface InviteComponentInterface
extends InviteComponentCommonInterface {
    public InviteComponentInterface createFromMethodComponentNumRsvp(String method, int componentNum, boolean rsvp);
    public void setCategories(Iterable <String> categories);
    public void addCategory(String category);
    public void setComments(Iterable <String> comments);
    public void addComment(String comment);
    public void setContacts(Iterable <String> contacts);
    public void addContact(String contact);

    public void setFragment(String fragment);
    public void setDescription(String description);
    public void setHtmlDescription(String htmlDescription);
    public List<String> getCategories();
    public List<String> getComments();
    public List<String> getContacts();
    public String getFragment();
    public String getDescription();
    public String getHtmlDescription();

    public void setGeoInterface(GeoInfoInterface geo);
    public void setAttendeeInterfaces(
            Iterable<CalendarAttendeeInterface> attendees);
    public void addAttendeeInterface(CalendarAttendeeInterface attendee);
    public void setAlarmInterfaces(Iterable<AlarmInfoInterface> alarms);
    public void addAlarmInterface(AlarmInfoInterface alarm);
    public void setXPropInterfaces(Iterable<XPropInterface> xProps);
    public void addXPropInterface(XPropInterface xProp);
    public void setOrganizerInterface(CalOrganizerInterface organizer);
    public void setRecurrenceInterface(RecurrenceInfoInterface recurrence);
    public void setExceptionIdInterface(
            ExceptionRecurIdInfoInterface exceptionId);
    public void setDtStartInterface(DtTimeInfoInterface dtStart);
    public void setDtEndInterface(DtTimeInfoInterface dtEnd);
    public void setDurationInterface(DurationInfoInterface duration);
    public GeoInfoInterface getGeoInterface();
    public List<CalendarAttendeeInterface> getAttendeeInterfaces();
    public List<AlarmInfoInterface> getAlarmInterfaces();
    public List<XPropInterface> getXPropInterfaces();
    public CalOrganizerInterface getOrganizerInterface();
    public RecurrenceInfoInterface getRecurrenceInterface();
    public ExceptionRecurIdInfoInterface getExceptionIdInterface();
    public DtTimeInfoInterface getDtStartInterface();
    public DtTimeInfoInterface getDtEndInterface();
    public DurationInfoInterface getDurationInterface();
}


text:
import expect from 'expect.js';
import Auth0Lock from '../src/index';
import * as h from './helper/ui';

describe("show lock connection scopes", function() {

  beforeEach(function(done) {
    h.stubWebApis();
    const opts = {
      auth: {
        connectionScopes: {
          'facebook': ['scope_1', 'scope_2']
        }
      }
    };
    this.lock = h.displayLock("multiple social", opts, done);
  });

  afterEach(function() {
    this.lock.hide();
    h.restoreWebApis();
  });

  it("should show an error flash message", function(done) {
    h.assertAuthorizeRedirection((lockID, options, authParams) => {
      expect(options).to.be.an('object');
      expect(options.connection).to.be('facebook');
      expect(options.connection_scope).to.be.an('array');
      expect(options.connection_scope).to.have.length(2);
      expect(options.connection_scope).to.contain('scope_1');
      expect(options.connection_scope).to.contain('scope_2');
      done();
    })
    h.clickSocialConnectionButton(this.lock, 'facebook');
  });
});


text:
namespace chromeos {

// This class handles the interaction with the ChromeOS cryptohome library APIs.
class CryptohomeLibraryImpl : public CryptohomeLibrary {
 public:
  CryptohomeLibraryImpl() {
    if (CrosLibrary::Get()->EnsureLoaded())
      Init();
  }
  virtual ~CryptohomeLibraryImpl() {}

  bool CheckKey(const std::string& user_email, const std::string& passhash) {
    return chromeos::CryptohomeCheckKey(user_email.c_str(), passhash.c_str());
  }

  bool AsyncCheckKey(const std::string& user_email,
                     const std::string& passhash,
                     Delegate* d) {
    return CacheCallback(
        chromeos::CryptohomeAsyncCheckKey(user_email.c_str(), passhash.c_str()),
        d,
        "Couldn't initiate async check of user's key.");
  }

  bool MigrateKey(const std::string& user_email,
                  const std::string& old_hash,
                  const std::string& new_hash) {
    return chromeos::CryptohomeMigrateKey(user_email.c_str(),
                                          old_hash.c_str(),
                                          new_hash.c_str());
  }

  bool AsyncMigrateKey(const std::string& user_email,
                       const std::string& old_hash,
                       const std::string& new_hash,
                       Delegate* d) {
    return CacheCallback(
        chromeos::CryptohomeAsyncMigrateKey(user_email.c_str(),
                                            old_hash.c_str(),
                                            new_hash.c_str()),
        d,
        "Couldn't initiate aync migration of user's key");
  }

  bool Mount(const std::string& user_email,
             const std::string& passhash,
             int* error_code) {
    return chromeos::CryptohomeMountAllowFail(user_email.c_str(),
                                              passhash.c_str(),
                                              error_code);
  }

  bool AsyncMount(const std::string& user_email,
                  const std::string& passhash,
                  const bool create_if_missing,
                  Delegate* d) {
    return CacheCallback(
        chromeos::CryptohomeAsyncMountSafe(user_email.c_str(),
                                           passhash.c_str(),
                                           create_if_missing,
                                           false,
                                           NULL),
        d,
        "Couldn't initiate async mount of cryptohome.");
  }

  bool MountForBwsi(int* error_code) {
    return chromeos::CryptohomeMountGuest(error_code);
  }

  bool AsyncMountForBwsi(Delegate* d) {
    return CacheCallback(chromeos::CryptohomeAsyncMountGuest(),
                         d,
                         "Couldn't initiate async mount of cryptohome.");
  }

  bool Unmount() {
    return chromeos::CryptohomeUnmount();
  }

  bool Remove(const std::string& user_email) {
    return chromeos::CryptohomeRemove(user_email.c_str());
  }

  bool AsyncRemove(const std::string& user_email, Delegate* d) {
    return CacheCallback(
        chromeos::CryptohomeAsyncRemove(user_email.c_str()),
        d,
        "Couldn't initiate async removal of cryptohome.");
  }

  bool IsMounted() {
    return chromeos::CryptohomeIsMounted();
  }

  CryptohomeBlob GetSystemSalt() {
    CryptohomeBlob system_salt;
    char* salt_buf;
    int salt_len;
    bool result = chromeos::CryptohomeGetSystemSaltSafe(&salt_buf, &salt_len);
    if (result) {
      system_salt.resize(salt_len);
      if ((int)system_salt.size() == salt_len) {
        memcpy(&system_salt[0], static_cast<const void*>(salt_buf),
               salt_len);
      } else {
        system_salt.clear();
      }
    }
    return system_salt;
  }

  bool AsyncDoAutomaticFreeDiskSpaceControl(Delegate* d) {
    return CacheCallback(
        chromeos::CryptohomeAsyncDoAutomaticFreeDiskSpaceControl(),
        d,
        "Couldn't do automatic free disk space control.");
  }

  bool AsyncSetOwnerUser(const std::string& username, Delegate* d) {
    return CacheCallback(
        chromeos::CryptohomeAsyncSetOwnerUser(username.c_str()),
        d,
        "Couldn't do set owner user in Cryptohomed.");
  }

  bool TpmIsReady() {
    return chromeos::CryptohomeTpmIsReady();
  }

  bool TpmIsEnabled() {
    return chromeos::CryptohomeTpmIsEnabled();
  }

  bool TpmIsOwned() {
    return chromeos::CryptohomeTpmIsOwned();
  }

  bool TpmIsBeingOwned() {
    return chromeos::CryptohomeTpmIsBeingOwned();
  }

  bool TpmGetPassword(std::string* password) {
    char *password_buf;
    bool result = chromeos::CryptohomeTpmGetPasswordSafe(&password_buf);
    *password = password_buf;
    chromeos::CryptohomeFreeString(password_buf);
    return result;
  }

  void TpmCanAttemptOwnership() {
    chromeos::CryptohomeTpmCanAttemptOwnership();
  }

  void TpmClearStoredPassword() {
    chromeos::CryptohomeTpmClearStoredPassword();
  }

  bool InstallAttributesGet(const std::string& name, std::string* value) {
    char* local_value;
    bool done =
        chromeos::CryptohomeInstallAttributesGet(name.c_str(), &local_value);
    if (done) {
      *value = local_value;
      chromeos::CryptohomeFreeString(local_value);
    }
    return done;
  }

  bool InstallAttributesSet(const std::string& name, const std::string& value) {
    return chromeos::CryptohomeInstallAttributesSet(name.c_str(),
                                                    value.c_str());
  }

  int InstallAttributesCount() {
    return chromeos::CryptohomeInstallAttributesCount();
  }

  bool InstallAttributesFinalize() {
    return chromeos::CryptohomeInstallAttributesFinalize();
  }

  bool InstallAttributesIsReady() {
    return chromeos::CryptohomeInstallAttributesIsReady();
  }

  bool InstallAttributesIsSecure() {
    return chromeos::CryptohomeInstallAttributesIsSecure();
  }

  bool InstallAttributesIsInvalid() {
    return chromeos::CryptohomeInstallAttributesIsInvalid();
  }

  bool InstallAttributesIsFirstInstall() {
    return chromeos::CryptohomeInstallAttributesIsFirstInstall();
  }

  void Pkcs11GetTpmTokenInfo(std::string* label, std::string* user_pin) {
    chromeos::CryptohomePkcs11GetTpmTokenInfo(label, user_pin);
  }

  bool Pkcs11IsTpmTokenReady() {
    return chromeos::CryptohomePkcs11IsTpmTokenReady();
  }

 private:
  static void Handler(const chromeos::CryptohomeAsyncCallStatus& event,
                      void* cryptohome_library) {
    CryptohomeLibraryImpl* library =
        reinterpret_cast<CryptohomeLibraryImpl*>(cryptohome_library);
    library->Dispatch(event);
  }

  void Init() {
    cryptohome_connection_ = chromeos::CryptohomeMonitorSession(&Handler, this);
  }

  void Dispatch(const chromeos::CryptohomeAsyncCallStatus& event) {
    const CallbackMap::iterator callback = callback_map_.find(event.async_id);
    if (callback == callback_map_.end()) {
      LOG(ERROR) << "Received signal for unknown async_id " << event.async_id;
      return;
    }
    if (callback->second)
      callback->second->OnComplete(event.return_status, event.return_code);
    callback_map_.erase(callback);
  }

  bool CacheCallback(int async_id, Delegate* d, const char* error) {
    if (async_id == 0) {
      LOG(ERROR) << error;
      return false;
    }
    VLOG(1) << "Adding handler for " << async_id;
    callback_map_[async_id] = d;
    return true;
  }

  typedef base::hash_map<int, Delegate*> CallbackMap;
  mutable CallbackMap callback_map_;

  void* cryptohome_connection_;

  DISALLOW_COPY_AND_ASSIGN(CryptohomeLibraryImpl);
};

class CryptohomeLibraryStubImpl : public CryptohomeLibrary {
 public:
  CryptohomeLibraryStubImpl()
    : locked_(false) {}
  virtual ~CryptohomeLibraryStubImpl() {}

  bool CheckKey(const std::string& user_email, const std::string& passhash) {
    return true;
  }

  bool AsyncCheckKey(const std::string& user_email,
                     const std::string& passhash,
                     Delegate* callback) {
    BrowserThread::PostTask(
        BrowserThread::UI, FROM_HERE,
        NewRunnableFunction(&DoStubCallback, callback));
    return true;
  }

  bool MigrateKey(const std::string& user_email,
                  const std::string& old_hash,
                  const std::string& new_hash) {
    return true;
  }

  bool AsyncMigrateKey(const std::string& user_email,
                       const std::string& old_hash,
                       const std::string& new_hash,
                       Delegate* callback) {
    BrowserThread::PostTask(
        BrowserThread::UI, FROM_HERE,
        NewRunnableFunction(&DoStubCallback, callback));
    return true;
  }

  bool Mount(const std::string& user_email,
             const std::string& passhash,
             int* error_code) {
    // For testing password change.
    if (user_email ==
        CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
            switches::kLoginUserWithNewPassword)) {
      *error_code = kCryptohomeMountErrorKeyFailure;
      return false;
    }

    return true;
  }

  bool AsyncMount(const std::string& user_email,
                  const std::string& passhash,
                  const bool create_if_missing,
                  Delegate* callback) {
    BrowserThread::PostTask(
        BrowserThread::UI, FROM_HERE,
        NewRunnableFunction(&DoStubCallback, callback));
    return true;
  }

  bool MountForBwsi(int* error_code) {
    return true;
  }

  bool AsyncMountForBwsi(Delegate* callback) {
    BrowserThread::PostTask(
        BrowserThread::UI, FROM_HERE,
        NewRunnableFunction(&DoStubCallback, callback));
    return true;
  }

  bool Unmount() {
    return true;
  }

  bool Remove(const std::string& user_email) {
    return true;
  }

  bool AsyncRemove(const std::string& user_email, Delegate* callback) {
    BrowserThread::PostTask(
        BrowserThread::UI, FROM_HERE,
        NewRunnableFunction(&DoStubCallback, callback));
    return true;
  }

  bool IsMounted() {
    return true;
  }

  CryptohomeBlob GetSystemSalt() {
    CryptohomeBlob salt = CryptohomeBlob();
    salt.push_back(0);
    salt.push_back(0);
    return salt;
  }

  bool AsyncDoAutomaticFreeDiskSpaceControl(Delegate* callback) {
    BrowserThread::PostTask(
        BrowserThread::UI, FROM_HERE,
        NewRunnableFunction(&DoStubCallback, callback));
    return true;
  }

  bool AsyncSetOwnerUser(const std::string& username, Delegate* callback) {
    BrowserThread::PostTask(
        BrowserThread::UI, FROM_HERE,
        NewRunnableFunction(&DoStubCallback, callback));
    return true;
  }

  // Tpm begin ready after 20-th call.
  bool TpmIsReady() {
    static int counter = 0;
    return ++counter > 20;
  }

  bool TpmIsEnabled() {
    return true;
  }

  bool TpmIsOwned() {
    return true;
  }

  bool TpmIsBeingOwned() {
    return true;
  }

  bool TpmGetPassword(std::string* password) {
    *password = "Stub-TPM-password";
    return true;
  }

  void TpmCanAttemptOwnership() {}

  void TpmClearStoredPassword() {}

  bool InstallAttributesGet(const std::string& name, std::string* value) {
    if (install_attrs_.find(name) != install_attrs_.end()) {
      *value = install_attrs_[name];
      return true;
    }
    return false;
  }

  bool InstallAttributesSet(const std::string& name, const std::string& value) {
    install_attrs_[name] = value;
    return true;
  }

  int InstallAttributesCount() {
    return install_attrs_.size();
  }

  bool InstallAttributesFinalize() {
    locked_ = true;
    return true;
  }

  bool InstallAttributesIsReady() {
    return true;
  }

  bool InstallAttributesIsSecure() {
    return false;
  }

  bool InstallAttributesIsInvalid() {
    return false;
  }

  bool InstallAttributesIsFirstInstall() {
    return !locked_;
  }

  void Pkcs11GetTpmTokenInfo(std::string* label,
                             std::string* user_pin) {
    *label = "Stub TPM Token";
    *user_pin = "012345";
  }

  bool Pkcs11IsTpmTokenReady() { return true; }

 private:
  static void DoStubCallback(Delegate* callback) {
    if (callback)
      callback->OnComplete(true, kCryptohomeMountErrorNone);
  }

  std::map<std::string, std::string> install_attrs_;
  bool locked_;
  DISALLOW_COPY_AND_ASSIGN(CryptohomeLibraryStubImpl);
};

CryptohomeLibrary::CryptohomeLibrary() {}
CryptohomeLibrary::~CryptohomeLibrary() {}

// static
CryptohomeLibrary* CryptohomeLibrary::GetImpl(bool stub) {
  if (stub)
    return new CryptohomeLibraryStubImpl();
  else
    return new CryptohomeLibraryImpl();
}

} // namespace chromeos


text:
using namespace Microsoft::WRL;

class CGIWICBitmap;

class CGIWICBitmapLock : public RuntimeClass<RuntimeClassFlags<RuntimeClassType::ClassicCom>, IAgileObject, FtmBase, IWICBitmapLock> {
public:
    CGIWICBitmapLock(_In_ CGImageBacking* imageBacking, _In_ WICPixelFormatGUID pixelFormat)
        : m_imageBacking(imageBacking), m_pixelFormat(pixelFormat) {
        m_dataBuffer = static_cast<BYTE*>(m_imageBacking->LockImageData());
    }

    ~CGIWICBitmapLock() {
        m_imageBacking->ReleaseImageData();
        m_imageBacking = nullptr;
    }

    HRESULT STDMETHODCALLTYPE GetSize(_Out_ UINT* width, _Out_ UINT* height) {
        *width = m_imageBacking->Width();
        *height = m_imageBacking->Height();
        return S_OK;
    }

    HRESULT STDMETHODCALLTYPE GetStride(_Out_ UINT* stride) {
        *stride = m_imageBacking->BytesPerRow();
        return S_OK;
    }

    HRESULT STDMETHODCALLTYPE GetDataPointer(_Out_ UINT* bufferSize, _Outptr_ WICInProcPointer* data) {
        *bufferSize = m_imageBacking->Height() * m_imageBacking->BytesPerRow();
        *data = m_dataBuffer;
        return S_OK;
    }

    HRESULT STDMETHODCALLTYPE GetPixelFormat(_Out_ WICPixelFormatGUID* pixelFormat) {
        *pixelFormat = m_pixelFormat;
        return S_OK;
    }

private:
    CGImageBacking* m_imageBacking;
    WICPixelFormatGUID m_pixelFormat;
    BYTE* m_dataBuffer;
};

inline WICPixelFormatGUID SurfaceFormatToWICPixelFormat(__CGSurfaceFormat format) {
    switch (format) {
        case _ColorABGR:
        case _ColorXBGR:
            // XBGR is not supported by wic bitmap render target
            return GUID_WICPixelFormat32bppPRGBA;
        case _ColorARGB:
            return GUID_WICPixelFormat32bppPBGRA;
        case _ColorBGRX:
            return GUID_WICPixelFormat32bppBGR;
        case _ColorGrayscale:
        case _ColorA8:
            return GUID_WICPixelFormat8bppAlpha;
        case _ColorBGR:
        default:
            UNIMPLEMENTED_WITH_MSG("Unsupported pixel format (%d) used in CGIWICBitmap");
            break;
    }
    // our default format is alpha premultiplied BGRA
    return GUID_WICPixelFormat32bppPBGRA;
}

class CGIWICBitmap : public RuntimeClass<RuntimeClassFlags<RuntimeClassType::ClassicCom>, IAgileObject, FtmBase, IWICBitmap> {
public:
    CGIWICBitmap(_In_ CGImageBacking* imageBacking, _In_ __CGSurfaceFormat format)
        : m_imageBacking(imageBacking), m_pixelFormat(SurfaceFormatToWICPixelFormat(format)) {
    }

    // IWICBitmap interface
    // TODO::
    // Today we do not support locking a region of the WIC bitmap for rendering. We only support locking the complete bitmap. This will
    // suffice CoreText requirement but needs to be revisted for CoreGraphics usage in future.
    HRESULT STDMETHODCALLTYPE Lock(_In_ const WICRect* lockRect, _In_ DWORD flags, _COM_Outptr_ IWICBitmapLock** outLock) {
        ComPtr<IWICBitmapLock> lock = Make<CGIWICBitmapLock>(m_imageBacking, m_pixelFormat);
        *outLock = lock.Detach();
        return S_OK;
    }

    HRESULT STDMETHODCALLTYPE SetPalette(_In_ IWICPalette* palette) {
        UNIMPLEMENTED();
        return E_NOTIMPL;
    }

    HRESULT STDMETHODCALLTYPE SetResolution(_In_ double dpiX, _In_ double dpiY) {
        UNIMPLEMENTED();
        return E_NOTIMPL;
    }

    // IWICBitmapSource interface (that IWICBitmap inherits)
    HRESULT STDMETHODCALLTYPE GetSize(_Out_ UINT* width, _Out_ UINT* height) {
        *width = m_imageBacking->Width();
        *height = m_imageBacking->Height();
        return S_OK;
    }

    HRESULT STDMETHODCALLTYPE GetPixelFormat(_Out_ WICPixelFormatGUID* pixelFormat) {
        *pixelFormat = m_pixelFormat;
        return S_OK;
    }

    HRESULT STDMETHODCALLTYPE GetResolution(_Out_ double* dpiX, _Out_ double* dpiY) {
        UNIMPLEMENTED();
        return E_NOTIMPL;
    }

    HRESULT STDMETHODCALLTYPE CopyPalette(_In_ IWICPalette* palette) {
        UNIMPLEMENTED();
        return E_NOTIMPL;
    }

    HRESULT STDMETHODCALLTYPE CopyPixels(_In_opt_ const WICRect* copyRect,
                                         _In_ UINT stride,
                                         _In_ UINT bufferSize,
                                         _Out_writes_all_(cbBufferSize) BYTE* buffer) {
        UNIMPLEMENTED();
        return E_NOTIMPL;
    }

private:
    CGImageBacking* m_imageBacking;
    WICPixelFormatGUID m_pixelFormat;
};


text:
package org.apache.beam.runners.dataflow.util;

import static com.google.common.base.Preconditions.checkNotNull;

import com.google.api.client.json.GenericJson;
import com.google.api.client.util.Key;
import java.util.Map;
import javax.annotation.Nullable;

/**
 * A representation of an arbitrary Java object to be instantiated by Dataflow
 * workers.
 *
 *
Typically, an object to be written by the SDK to the Dataflow service will
 * implement a method (typically called {@code asCloudObject()}) that returns a
 * {@code CloudObject} to represent the object in the protocol.  Once the
 * {@code CloudObject} is constructed, the method should explicitly add
 * additional properties to be presented during deserialization, representing
 * child objects by building additional {@code CloudObject}s.
 */
public final class CloudObject extends GenericJson {
  /**
   * Constructs a {@code CloudObject} by copying the supplied serialized object
   * spec, which must represent an SDK object serialized for transport via the
   * Dataflow API.
   *
   *
The most common use of this method is during deserialization on the worker,
   * where it's used as a binding type during instance construction.
   *
   * @param spec supplies the serialized form of the object as a nested map
   * @throws RuntimeException if the supplied map does not represent an SDK object
   */
  public static CloudObject fromSpec(Map<String, Object> spec) {
    CloudObject result = new CloudObject();
    result.putAll(spec);
    if (result.className == null) {
      throw new RuntimeException("Unable to create an SDK object from " + spec
          + ": Object class not specified (missing \""
          + PropertyNames.OBJECT_TYPE_NAME + "\" field)");
    }
    return result;
  }

  /**
   * Constructs a {@code CloudObject} to be used for serializing an instance of
   * the supplied class for transport via the Dataflow API.  The instance
   * parameters to be serialized must be supplied explicitly after the
   * {@code CloudObject} is created, by using {@link CloudObject#put}.
   *
   * @param cls the class to use when deserializing the object on the worker
   */
  public static CloudObject forClass(Class<?> cls) {
    CloudObject result = new CloudObject();
    result.className = checkNotNull(cls).getName();
    return result;
  }

  /**
   * Constructs a {@code CloudObject} to be used for serializing data to be
   * deserialized using the supplied class name the supplied class name for
   * transport via the Dataflow API.  The instance parameters to be serialized
   * must be supplied explicitly after the {@code CloudObject} is created, by
   * using {@link CloudObject#put}.
   *
   * @param className the class to use when deserializing the object on the worker
   */
  public static CloudObject forClassName(String className) {
    CloudObject result = new CloudObject();
    result.className = checkNotNull(className);
    return result;
  }

  /**
   * Constructs a {@code CloudObject} representing the given value.
   * @param value the scalar value to represent.
   */
  public static CloudObject forString(String value) {
    CloudObject result = forClassName(CloudKnownType.TEXT.getUri());
    result.put(PropertyNames.SCALAR_FIELD_NAME, value);
    return result;
  }

  /**
   * Constructs a {@code CloudObject} representing the given value.
   * @param value the scalar value to represent.
   */
  public static CloudObject forBoolean(Boolean value) {
    CloudObject result = forClassName(CloudKnownType.BOOLEAN.getUri());
    result.put(PropertyNames.SCALAR_FIELD_NAME, value);
    return result;
  }

  /**
   * Constructs a {@code CloudObject} representing the given value.
   * @param value the scalar value to represent.
   */
  public static CloudObject forInteger(Long value) {
    CloudObject result = forClassName(CloudKnownType.INTEGER.getUri());
    result.put(PropertyNames.SCALAR_FIELD_NAME, value);
    return result;
  }

  /**
   * Constructs a {@code CloudObject} representing the given value.
   * @param value the scalar value to represent.
   */
  public static CloudObject forInteger(Integer value) {
    CloudObject result = forClassName(CloudKnownType.INTEGER.getUri());
    result.put(PropertyNames.SCALAR_FIELD_NAME, value);
    return result;
  }

  /**
   * Constructs a {@code CloudObject} representing the given value.
   * @param value the scalar value to represent.
   */
  public static CloudObject forFloat(Float value) {
    CloudObject result = forClassName(CloudKnownType.FLOAT.getUri());
    result.put(PropertyNames.SCALAR_FIELD_NAME, value);
    return result;
  }

  /**
   * Constructs a {@code CloudObject} representing the given value.
   * @param value the scalar value to represent.
   */
  public static CloudObject forFloat(Double value) {
    CloudObject result = forClassName(CloudKnownType.FLOAT.getUri());
    result.put(PropertyNames.SCALAR_FIELD_NAME, value);
    return result;
  }

  /**
   * Constructs a {@code CloudObject} representing the given value of a
   * well-known cloud object type.
   * @param value the scalar value to represent.
   * @throws RuntimeException if the value does not have a
   * {@link CloudKnownType} mapping
   */
  public static CloudObject forKnownType(Object value) {
    @Nullable CloudKnownType ty = CloudKnownType.forClass(value.getClass());
    if (ty == null) {
      throw new RuntimeException("Unable to represent value via the Dataflow API: " + value);
    }
    CloudObject result = forClassName(ty.getUri());
    result.put(PropertyNames.SCALAR_FIELD_NAME, value);
    return result;
  }

  @Key(PropertyNames.OBJECT_TYPE_NAME)
  private String className;

  private CloudObject() {}

  /**
   * Gets the name of the Java class that this CloudObject represents.
   */
  public String getClassName() {
    return className;
  }

  @Override
  public CloudObject clone() {
    return (CloudObject) super.clone();
  }
}


text:
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.

defined('MOODLE_INTERNAL') || die();

function xmldb_editor_tinymce_upgrade($oldversion) {
    global $CFG, $DB;

    if ($oldversion < 2014062900) {
        // We only want to delete DragMath from the customtoolbar setting if the directory no longer exists. If
        // the directory is present then it means it has been restored, so do not remove any settings.
        if (!check_dir_exists($CFG->libdir . '/editor/tinymce/plugins/dragmath', false)) {
            // Remove the DragMath plugin from the 'customtoolbar' setting (if it exists) as it has been removed.
            $currentorder = get_config('editor_tinymce', 'customtoolbar');
            $newtoolbarrows = array();
            $currenttoolbarrows = explode("\n", $currentorder);
            foreach ($currenttoolbarrows as $currenttoolbarrow) {
                $currenttoolbarrow = implode(',', array_diff(str_getcsv($currenttoolbarrow), array('dragmath')));
                $newtoolbarrows[] = $currenttoolbarrow;
            }
            $neworder = implode("\n", $newtoolbarrows);
            unset_config('customtoolbar', 'editor_tinymce');
            set_config('customtoolbar', $neworder, 'editor_tinymce');
        }

        upgrade_plugin_savepoint(true, 2014062900, 'editor', 'tinymce');
    }

    // Moodle v2.8.0 release upgrade line.
    // Put any upgrade step following this.

    // Moodle v2.9.0 release upgrade line.
    // Put any upgrade step following this.

    // Moodle v3.0.0 release upgrade line.
    // Put any upgrade step following this.

    // Moodle v3.1.0 release upgrade line.
    // Put any upgrade step following this.

    return true;
}


text:
package com.clarkware.junitperf;

import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;

/**
 * The ExampleTestCase is an example
 * stateless TestCase.
 *
 * @author Mike Clark
 * @author Clarkware Consulting, Inc.
 */

public class ExampleTestCase extends TestCase {

    public ExampleTestCase(String name) {
        super(name);
    }

	protected void setUp() {
	}

	protected void tearDown() {
	}

	public void testOneSecondResponse() throws Exception {
		Thread.sleep(1000);
	}

	public static Test suite() {
		return new TestSuite(ExampleTestCase.class);
	}

	public static void main(String args[]) {
		junit.textui.TestRunner.run(suite());
	}
}


text:
function initMap() {

    var map = new google.maps.Map(document.getElementById('map'), {
        center: {
            // Glasgow, UK
            lat: 55.864237,
            lng: -4.251806
        },
        zoom: 10
    });

//	var infoWindow = new google.maps.InfoWindow({
//		map : map
//	});

    // Try HTML5 geolocation.
    if (navigator.geolocation) {

        navigator.geolocation.getCurrentPosition(function (position) {

            var pos = {
                lat: position.coords.latitude,
                lng: position.coords.longitude
            };

            $.ajax({
                type: "POST",
                url: "postLatLong.html",
                data: {
                    "latitude": position.coords.latitude,
                    "longitude": position.coords.longitude
                },

                success: function (response) {

                    setMarkers(map);
                    map.setCenter(pos);
                }
            });

            //alert(position.coords.latitude);

            //infoWindow.setPosition(pos);
            //infoWindow.setContent('Location found.');

        }, function () {

            // set markers geo position denied
            setMarkers(map);
        });
    } else {

        // Browser doesn't support Geolocation
        setMarkers(map);
    }
}

//function handleLocationError(browserHasGeolocation, infoWindow, pos) {
//	infoWindow.setPosition(pos);
//	infoWindow
//			.setContent(browserHasGeolocation ? 'Error: The Geolocation service failed.'
//					: 'Error: Your browser doesn\'t support geolocation.');
//}

function setMarkers(map) {
    // Adds markers to the map.

    $.ajax({
        type: "GET",
        url: "getUsers.html",

        success: function (response) {

            // response is a json list of users
            var users = JSON.parse(response);

            for (var i = 0; i < users.length; i++) {

                var user = users[i];

                makeMarker(map, user);
            }
        }
    });
}

function makeMarker(map, user) {

    if (user.hasProfilePic)
        var imagePath = 'profile_images/' + user.id + '.png';
    else
        var imagePath = 'images/profile_default.png';

    var contentString = '
' +
        '' +
        '
' + user.username + '
' +
        '
';

    var infowindow = new google.maps.InfoWindow({
        content: contentString
    });

    var marker = new google.maps.Marker({
        position: {
            lat: user.latitude,
            lng: user.longitude
        },
        map: map,
        //icon : image,
        //shape : shape,
        title: user.username
    });

    marker.addListener('click', function () {
        infowindow.open(map, marker);
    });

}


text:
AliAnalysisTaskADCent* AddTaskADCent() {
  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
  if (!mgr) {
    Error("AddTask_ADCent", "No analysis manager found.");
    return NULL;
  }

  if (!mgr->GetInputEventHandler()) {
    Error("AddTask_ADCent", "This task requires an input event handler");
    return NULL;
  }

  AliAnalysisTaskADCent *task = new AliAnalysisTaskADCent();
  mgr->AddTask(task);

  task->SelectCollisionCandidates(AliVEvent::kINT7);

  // Create containers for input/output
  AliAnalysisDataContainer *cinput  = mgr->GetCommonInputContainer();
  AliAnalysisDataContainer *coutput = mgr->CreateContainer("TE",
							   TTree::Class(),
							   AliAnalysisManager::kOutputContainer,
                                                           AliAnalysisManager::GetCommonFileName());

  // Connect input/output
  mgr->ConnectInput (task, 0, cinput);
  mgr->ConnectOutput(task, 1, coutput);

  return task;
}


text:
<!DOCTYPE html>

  <meta charset="utf-8"/>
  <link rel="stylesheet" href="../nih-man.css" type="text/css" media="all"/>
  <title>ZIP_DELETE(3)</title>

    ZIP_DELETE(3)
    Library Functions Manual
    ZIP_DELETE(3)

NAME

zip_delete —

delete file from zip archive

LIBRARY

libzip (-lzip)

SYNOPSIS

#include <zip.h>

<var class="Ft">int</var>

  zip_delete(<var class="Fa" style="white-space: nowrap;">zip_t
    *archive</var>, <var class="Fa" style="white-space: nowrap;">zip_uint64_t
    index</var>);

DESCRIPTION

The file at position <var class="Ar">index</var> in the zip archive
  <var class="Ar">archive</var> is marked as deleted.

RETURN
  VALUES

Upon successful completion 0 is returned. Otherwise, -1 is returned and the
  error code in <var class="Ar">archive</var> is set to indicate the error.

ERRORS

zip_delete() fails if:

[ZIP_ER_INVAL]

<var class="Ar">index</var> is not a valid file index in
      <var class="Ar">archive</var>.

SEE
  ALSO

libzip(3),
  zip_unchange(3)

HISTORY

zip_delete() was added in libzip 0.6. In libzip 0.10 the
  type of <var class="Ar">index</var> was changed from <var class="Vt">int</var>
  to <var class="Vt">zip_uint64_t</var>.

AUTHORS

Dieter Baron
  <dillo@nih.at> and
  Thomas Klausner
  <tk@giga.or.at>

    December 18, 2017
    NiH


text:
int main(int argc, char** argv)
{
	MinVR::DataFileUtils::addFileSearchPath("$(MinVR_DIR)/share/vrsetup");
	MinVR::DataFileUtils::addFileSearchPath("$(MinVR_DIR)/share/shaders");
	MinVR::DataFileUtils::addFileSearchPath("C:/Users/Jenweil/Desktop/AnchoredGestures/app/shaders");
	MinVR::DataFileUtils::addFileSearchPath("C:/vis/sw/user-checkouts/bjackson/src/tinker-lab/AnchoredGestures/app/shaders");

	FreeImage_Initialise();

	MinVR::AbstractMVREngine *engine = new MinVR::MVREngineGLFW();
	engine->init(argc, argv);
	MinVR::AbstractMVRAppRef app(new App());
	engine->runApp(app);

	FreeImage_DeInitialise();
	delete engine;

	return 0;
}


text:
/* Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.activiti.engine.impl.persistence.entity;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.activiti.engine.ActivitiException;
import org.activiti.engine.delegate.event.impl.ActivitiEventBuilder;
import org.activiti.engine.impl.db.PersistentObject;
import org.activiti.engine.impl.persistence.AbstractManager;
import org.activiti.engine.task.Comment;
import org.activiti.engine.task.Event;
import org.flowable.common.engine.api.delegate.event.FlowableEngineEventType;

/**
 * @author Tom Baeyens
 */
public class CommentEntityManager extends AbstractManager {

    @Override
    public void delete(PersistentObject persistentObject) {
        checkHistoryEnabled();
        super.delete(persistentObject);

        Comment comment = (Comment) persistentObject;
        if (getProcessEngineConfiguration().getEventDispatcher().isEnabled()) {
            // Forced to fetch the process-instance to associate the right process definition
            String processDefinitionId = null;
            String processInstanceId = comment.getProcessInstanceId();
            if (comment.getProcessInstanceId() != null) {
                ExecutionEntity process = getProcessInstanceManager().findExecutionById(comment.getProcessInstanceId());
                if (process != null) {
                    processDefinitionId = process.getProcessDefinitionId();
                }
            }
            getProcessEngineConfiguration().getEventDispatcher().dispatchEvent(
                    ActivitiEventBuilder.createEntityEvent(FlowableEngineEventType.ENTITY_DELETED, persistentObject, processInstanceId, processInstanceId, processDefinitionId));
        }
    }

    @Override
    public void insert(PersistentObject persistentObject) {
        checkHistoryEnabled();
        super.insert(persistentObject);

        Comment comment = (Comment) persistentObject;
        if (getProcessEngineConfiguration().getEventDispatcher().isEnabled()) {
            // Forced to fetch the process-instance to associate the right process definition
            String processDefinitionId = null;
            String processInstanceId = comment.getProcessInstanceId();
            if (comment.getProcessInstanceId() != null) {
                ExecutionEntity process = getProcessInstanceManager().findExecutionById(comment.getProcessInstanceId());
                if (process != null) {
                    processDefinitionId = process.getProcessDefinitionId();
                }
            }
            getProcessEngineConfiguration().getEventDispatcher().dispatchEvent(
                    ActivitiEventBuilder.createEntityEvent(FlowableEngineEventType.ENTITY_CREATED, persistentObject, processInstanceId, processInstanceId, processDefinitionId));
            getProcessEngineConfiguration().getEventDispatcher().dispatchEvent(
                    ActivitiEventBuilder.createEntityEvent(FlowableEngineEventType.ENTITY_INITIALIZED, persistentObject, processInstanceId, processInstanceId, processDefinitionId));
        }
    }

    @SuppressWarnings("unchecked")
    public List<Comment> findCommentsByTaskId(String taskId) {
        checkHistoryEnabled();
        return getDbSqlSession().selectList("selectCommentsByTaskId", taskId);
    }

    @SuppressWarnings("unchecked")
    public List<Comment> findCommentsByTaskIdAndType(String taskId, String type) {
        checkHistoryEnabled();
        Map<String, Object> params = new HashMap<>();
        params.put("taskId", taskId);
        params.put("type", type);
        return getDbSqlSession().selectListWithRawParameter("selectCommentsByTaskIdAndType", params, 0, Integer.MAX_VALUE);
    }

    @SuppressWarnings("unchecked")
    public List<Comment> findCommentsByType(String type) {
        checkHistoryEnabled();
        return getDbSqlSession().selectList("selectCommentsByType", type);
    }

    @SuppressWarnings("unchecked")
    public List<Event> findEventsByTaskId(String taskId) {
        checkHistoryEnabled();
        return getDbSqlSession().selectList("selectEventsByTaskId", taskId);
    }

    @SuppressWarnings("unchecked")
    public List<Event> findEventsByProcessInstanceId(String processInstanceId) {
        checkHistoryEnabled();
        return getDbSqlSession().selectList("selectEventsByProcessInstanceId", processInstanceId);
    }

    public void deleteCommentsByTaskId(String taskId) {
        checkHistoryEnabled();
        getDbSqlSession().delete("deleteCommentsByTaskId", taskId);
    }

    public void deleteCommentsByProcessInstanceId(String processInstanceId) {
        checkHistoryEnabled();
        getDbSqlSession().delete("deleteCommentsByProcessInstanceId", processInstanceId);
    }

    @SuppressWarnings("unchecked")
    public List<Comment> findCommentsByProcessInstanceId(String processInstanceId) {
        checkHistoryEnabled();
        return getDbSqlSession().selectList("selectCommentsByProcessInstanceId", processInstanceId);
    }

    public List<Comment> findCommentsByProcessInstanceId(String processInstanceId, String type) {
        checkHistoryEnabled();
        Map<String, Object> params = new HashMap<>();
        params.put("processInstanceId", processInstanceId);
        params.put("type", type);
        return getDbSqlSession().selectListWithRawParameter("selectCommentsByProcessInstanceIdAndType", params, 0, Integer.MAX_VALUE);
    }

    public Comment findComment(String commentId) {
        return getDbSqlSession().selectById(CommentEntity.class, commentId);
    }

    public Event findEvent(String commentId) {
        return getDbSqlSession().selectById(CommentEntity.class, commentId);
    }

    protected void checkHistoryEnabled() {
        if (!getHistoryManager().isHistoryEnabled()) {
            throw new ActivitiException("In order to use comments, history should be enabled");
        }
    }
}


text:
.. _azure_vnet:

Virtual Networks
================

Filters
-------
- Standard Value Filter (see :ref:`filters`)
      - Model: `VirtualNetwork <https://docs.microsoft.com/en-us/python/api/azure.mgmt.network.v2018_02_01.models.virtualnetwork?view=azure-python>`_
- ARM Resource Filters (see :ref:`azure_genericarmfilter`)
    - Tag Filter - Filter on tag presence and/or values
    - Marked-For-Op Filter - Filter on tag that indicates a scheduled operation for a resource

Actions
-------
- ARM Resource Actions (see :ref:`azure_genericarmaction`)

Example Policies
----------------

This set of policies will find all Virtual Networks that do not have DDOS protection enabled.

.. code-block:: yaml

    policies:
      - name: find-vnets-ddos-protection-disabled
        resource: azure.vnet
        filters:
          - type: value
            key: properties.enableDdosProtection
            op: equal
            value: False


text:
<?php
/**
 * Fields class layer for ActiveRecord.
 *
 * @package     Creovel
 * @subpackage  Core
 * @license     http://creovel.org/license MIT License
 * @since       Class available since Release 0.4.x
 * @author      Nesbert Hidalgo
 **/
class ActiveRecordField extends CObject
{
    /**
     * Field type (CHAR, VARCHAR, TEXT, etc).
     *
     * @var string
     **/
    public $type = '';

    /**
     * Field size.
     *
     * @var string
     **/
    public $size = '';

    /**
     * Field allowed to be null (YES, NO).
     *
     * @var string
     **/
    public $null = 'NO';

    /**
     * Field has changed flag.
     *
     * @var boolean
     **/
    public $has_changed = false;

    /**
     * Field is identity flag.
     *
     * @var string
     **/
    public $is_identity = false;

    /**
     * Field key (PK, FR, blank).
     *
     * @var string
     **/
    public $key = '';

    /**
     * Field key name.
     *
     * @var string
     **/
    public $key_name = '';

    /**
     * Field default value.
     *
     * @var mixed
     **/
    public $default;

    /**
     * Field value.
     *
     * @var mixed
     **/
    public $value;

    /**
     * Pass a object of database table column attributes and map them to a
     * common structure used be active record.
     *
     * @return void
     **/
    public function __construct($attributes = null)
    {
        parent::__construct();

        if (is_array($attributes)) {
            $this->init_with_array($attributes);
        }

        if (is_object($attributes)) {
            $this->init_with_object($attributes);
        }
    }

    /**
     * Set values by an object.
     *
     * @param object $attributes
     * @return void
     **/
    public function init_with_object($attributes = stdClass)
    {
        if (empty($attributes->adapter_type)
            || !is_object($attributes)) return false;

        switch (strtolower($attributes->adapter_type)) {
            case 'db2':
                $this->type = $attributes->TYPE_NAME;

                switch (true) {
                    case $this->type == 'DECIMAL':
                        $this->size = "{$attributes->NUM_PREC_RADIX},{$attributes->DECIMAL_DIGITS}";
                        break;
                    case $this->type == 'VARCHAR':
                    case $this->type == 'CHAR':
                    case !empty($attributes->COLUMN_SIZE):
                        $this->size = $attributes->COLUMN_SIZE;
                        break;
                    default:
                        unset($this->size);
                        break;
                }

                if (!empty($attributes->KEY) && ($attributes->KEY == 'PRI' || $attributes->KEY == 'PK')) {
                    $this->key = 'PK';
                    $this->key_name = $attributes->KEY_NAME;
                } else {
                    unset($this->key);
                    unset($this->key_name);
                }

                if (!empty($attributes->IS_IDENTITY)) {
                    $this->is_identity = true;
                } else {
                    unset($this->is_identity);
                }

                $this->null = (bool) $attributes->NULLABLE;
                $this->default = $attributes->COLUMN_DEF;
                if ($this->null == 'NO' && empty($this->default)) {
                    $this->default = '';
                }
                break;

            // mysql & mysqli adpater field routine
            default:
                $attributes->type = trim(str_replace(
                            array('unsigned'), '', $attributes->type));

                if (CString::contains('(', $attributes->type)) {
                    $this->type = strtoupper(preg_replace('/(\w+)\((.*)\)/i', '${1}', $attributes->type));
                    $this->size = preg_replace('/(\w+)\((.*)\)/i', '${2}', $attributes->type);
                } else {
                    $this->type = strtoupper($attributes->type);
                    unset($this->size);
                }

                if ($attributes->key == 'PK' ||
                    $attributes->key == 'PRI') {
                    $this->key = 'PK';
                    $this->key_name = 'PRIMARY';
                } else {
                    unset($this->key);
                    unset($this->key_name);
                }

                if ($attributes->extra == 'auto_increment') {
                    $this->is_identity = true;
                } else {
                    unset($this->is_identity);
                }

                $this->null = $attributes->null == 'YES';
                $this->default = $attributes->default;
                break;
        }

        $this->value = $this->default;
    }

    /**
     * Set values by an array.
     *
     * @param object $attributes
     * @return void
     **/
    public function init_with_array($attributes = array())
    {
        if (empty($attributes['type'])
            || !is_array($attributes)) return false;

        $this->type = $attributes['type'];

        if (!empty($attributes['size'])) {
        $this->size = $attributes['size'];
        } else {
            unset($this->size);
        }

        if (!empty($attributes['key']) && $attributes['key'] == 'PK') {
            $this->key = $attributes['key'];
            $this->key_name = $attributes['key_name'];
        } else {
            unset($this->key);
            unset($this->key_name);
        }

        if (isset($attributes['extra'])) {
            if ($attributes['extra'] == 'auto_increment') {
                $this->is_identity = true;
            } else {
                unset($this->is_identity);
            }
        } elseif (isset($attributes['identity'])) {
        	if (!empty($attributes['identity'])) {
                $this->is_identity = true;
            } else {
                unset($this->is_identity);
            }
        }

        if (isset($attributes['null'])) {
            $this->null = $attributes['null'] == 'YES' || $attributes['null'] == true
                            ? true : false;
        } else {
            $this->null = false;
        }

        $this->default = @$attributes['default'];
        $this->value = $this->default;
    }

    /**
     * Return a loaded object of ActiveRecordField.
     *
     * @param object $attributes
     * @return object ActiveRecordField
     **/
    public static function object($attributes)
    {
        return new ActiveRecordField($attributes);
    }
} // END class ActiveRecordField extends CObject


text:
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="HoneypotRuleCollection.cs" company="Web Advanced">
// Copyright 2012 Web Advanced (www.webadvanced.com)
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0

// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
// --------------------------------------------------------------------------------------------------------------------
namespace SimpleHoneypot.Core {
    using System;
    using System.Collections;
    using System.Collections.Generic;
    using System.Collections.Specialized;

    using SimpleHoneypot.Core.Common;

    public class HoneypotRuleCollection : IEnumerable<Func<NameValueCollection, bool>> {
        #region Constants and Fields

        private readonly List<Func<NameValueCollection, bool>> rules = new List<Func<NameValueCollection, bool>>();

        #endregion

        #region Public Methods and Operators

        /// <summary>
        /// A func that returns true if request is a bot
        /// </summary>
        /// <param name="func"></param>
        public void Add(Func<NameValueCollection, bool> func) {
            Check.Argument.IsNotNull(func, "func");
            this.rules.Add(func);
        }

        public void Clear() {
            this.rules.Clear();
        }

        public IEnumerator<Func<NameValueCollection, bool>> GetEnumerator() {
            return this.rules.GetEnumerator();
        }

        #endregion

        #region Explicit Interface Methods

        IEnumerator IEnumerable.GetEnumerator() {
            return this.GetEnumerator();
        }

        #endregion
    }
}


text:
using Machine.Specifications;
using PushNotifications.Contracts;
using PushNotifications.Contracts.Subscriptions;
using PushNotifications.Subscriptions;

namespace PushNotifications.Tests.PushNotifications
{
    [Subject(nameof(TopicSubscription))]
    public class When_unsubscribing_from_topic_and_subscribing_again
    {
        Establish context = () =>
        {
            var tenant = "elders";
            topic = new Topic("topic");
            subscriberId = new SubscriberId("id", tenant);
            topicSubscriptionId = new TopicSubscriptionId(subscriberId, topic, tenant);
            aggregate = new TopicSubscription(topicSubscriptionId);
            aggregate.UnsubscribeFromTopic(topicSubscriptionId);
        };

        Because of = () => aggregate.SubscribeToTopic(topicSubscriptionId);

        It should = () => aggregate.RootState().IsSubscriptionActive.ShouldBeTrue();

        It should_have_the_same_topic = () => aggregate.RootState().Id.Topic.ShouldEqual(topic);

        It should_have_the_same_subscriber_id = () => aggregate.RootState().Id.SubscriberId.ShouldEqual(subscriberId);

        It should_have_the_same_topic_subscription_id = () => aggregate.RootState().Id.ShouldEqual(topicSubscriptionId);

        It should_have_two_topic_subscribed_events = () => aggregate.ShouldHaveEventsCount<Contracts.Subscriptions.Events.SubscribedToTopic>(2);

        static TopicSubscription aggregate;
        static TopicSubscriptionId topicSubscriptionId;
        static SubscriberId subscriberId;
        static Topic topic;
    }
}


text:
package org.darkphoenixs.pool.kafka;

import org.junit.Assert;
import org.junit.Test;

public class KafkaConfigTest {

    @Test
    public void test() throws Exception {

        Assert.assertEquals(KafkaConfig.DEFAULT_BROKERS, "localhost:9092");
        Assert.assertEquals(KafkaConfig.DEFAULT_TYPE, "sync");
        Assert.assertEquals(KafkaConfig.DEFAULT_ACKS, "0");
        Assert.assertEquals(KafkaConfig.DEFAULT_CODEC, "none");
        Assert.assertEquals(KafkaConfig.DEFAULT_BATCH, "200");

        Assert.assertEquals(KafkaConfig.BROKERS_LIST_PROPERTY, "metadata.broker.list");
        Assert.assertEquals(KafkaConfig.PRODUCER_TYPE_PROPERTY, "producer.type");
        Assert.assertEquals(KafkaConfig.REQUEST_ACKS_PROPERTY, "request.required.acks");
        Assert.assertEquals(KafkaConfig.COMPRESSION_CODEC_PROPERTY, "compression.codec");
        Assert.assertEquals(KafkaConfig.BATCH_NUMBER_PROPERTY, "batch.num.messages");
    }
}


text:
@interface MZCatalogueTableViewController () <MZRelationalCollectionControllerDelegate>
@property MZRelationalCollectionController *artistsController;
@end

@implementation MZCatalogueTableViewController

#pragma mark - UITableViewDelegate & UITableViewDatasource

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return self.artistsController.collection.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"artistCell" forIndexPath:indexPath];
    Artist *artist = self.artistsController.collection[indexPath.row];
    cell.textLabel.text = artist.name;
    cell.detailTextLabel.text = [NSString stringWithFormat:@"%ld albums", (unsigned long)artist.albums.count];
    return cell;
}

- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return UITableViewCellEditingStyleDelete;
}

- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
    Artist *artist = self.artistsController.collection[indexPath.row];
    [[self.catalogue mutableSetValueForKey:@"artists"] removeObject:artist];
}

#pragma mark - Segues

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    if ([segue.identifier isEqualToString:@"showArtist"]) {
        NSIndexPath *indexPath = [self.tableView indexPathForCell:sender];
        Artist *artist = self.artistsController.collection[indexPath.row];
        ((MZArtistTableViewController *)segue.destinationViewController).artist = artist;
    } else if ([segue.identifier isEqualToString:@"editArtist"]) {
        NSIndexPath *indexPath = [self.tableView indexPathForCell:sender];
        Artist *artist = self.artistsController.collection[indexPath.row];
        segue.destinationViewController.navigationItem.leftBarButtonItem = nil;
        segue.destinationViewController.navigationItem.rightBarButtonItem = nil;
        segue.destinationViewController.title = @"Edit Artist";
        ((MZArtistEditViewController *)segue.destinationViewController).artist = artist;
    } else if ([segue.identifier isEqualToString:@"newArtist"]) {
        Artist *artist = [Artist new];
        UINavigationController *navigationController = segue.destinationViewController;
        navigationController.viewControllers.firstObject.title = @"New Artist";
        ((MZArtistEditViewController *)navigationController.viewControllers.firstObject).artist = artist;
    }
}

- (IBAction)cancel:(UIStoryboardSegue *)unwindSegue
{
    // NOP
}

- (IBAction)done:(UIStoryboardSegue *)unwindSegue
{
    Artist *artist = ((MZArtistEditViewController *)unwindSegue.sourceViewController).artist;
    [[self.catalogue mutableSetValueForKey:@"artists"] addObject:artist];
}

#pragma mark - Data management

- (void)setCatalogue:(Catalogue *)catalogue
{
    _catalogue = catalogue;
    self.artistsController = [MZRelationalCollectionController collectionControllerForRelation:@"artists"
                                                                                onObject:self.catalogue
                                                                                filteredBy:nil
                                                                                sortedBy:@[[NSSortDescriptor sortDescriptorWithKey:@"name" ascending:YES]]
                                                                        observingChildKeyPaths:@[@"name", @"albums"]
                                                                                delegate:self];
}

#pragma mark - MZRelationalCollectionControllerDelegate

- (void)relationalCollectionControllerWillChangeContent:(MZRelationalCollectionController *)controller
{
    [self.tableView beginUpdates];
}

- (void)relationalCollectionController:(MZRelationalCollectionController *)controller insertedObject:(id)object atIndex:(NSUInteger)index
{
    [self.tableView insertRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:index inSection:0]] withRowAnimation:UITableViewRowAnimationAutomatic];
}

- (void)relationalCollectionController:(MZRelationalCollectionController *)controller removedObject:(id)object atIndex:(NSUInteger)index
{
    [self.tableView deleteRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:index inSection:0]] withRowAnimation:UITableViewRowAnimationAutomatic];
}

- (void)relationalCollectionController:(MZRelationalCollectionController *)controller movedObject:(id)object fromIndex:(NSUInteger)fromIndex toIndex:(NSUInteger)toIndex
{
    [self.tableView moveRowAtIndexPath:[NSIndexPath indexPathForRow:fromIndex inSection:0] toIndexPath:[NSIndexPath indexPathForRow:toIndex inSection:0]];
}

- (void)relationalCollectionController:(MZRelationalCollectionController *)controller updatedObject:(id)object atIndex:(NSUInteger)index changedKeyPath:(NSString *)keyPath
{
    [self.tableView reloadRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:index inSection:0]] withRowAnimation:UITableViewRowAnimationAutomatic];
}

- (void)relationalCollectionControllerDidChangeContent:(MZRelationalCollectionController *)controller
{
    [self.tableView endUpdates];
}

@end


text:
#pragma once

#include "UIElement.h"

namespace Atomic
{

namespace SystemUI
{

static const int DEFAULT_FONT_SIZE = 12;

class Font;
class FontFace;
struct FontGlyph;

/// Text effect.
enum TextEffect
{
    TE_NONE = 0,
    TE_SHADOW,
    TE_STROKE
};

/// Cached character location and size within text. Used for queries related to text editing.
struct CharLocation
{
    /// Position.
    IntVector2 position_;
    /// Size.
    IntVector2 size_;
};

/// Glyph and its location within the text. Used when preparing text rendering.
struct GlyphLocation
{
    // Construct.
    GlyphLocation(int x, int y, const FontGlyph* glyph) :
        x_(x),
        y_(y),
        glyph_(glyph)
    {
    }

    /// X coordinate.
    int x_;
    /// Y coordinate.
    int y_;
    /// Glyph.
    const FontGlyph* glyph_;
};

/// %Text %UI element.
class ATOMIC_API Text : public UIElement
{
    OBJECT(Text);

    friend class Text3D;

public:
    /// Construct.
    Text(Context* context);
    /// Destruct.
    virtual ~Text();
    /// Register object factory.
    static void RegisterObject(Context* context);

    /// Apply attribute changes that can not be applied immediately.
    virtual void ApplyAttributes();
    /// Return UI rendering batches.
    virtual void GetBatches(PODVector<SystemUIBatch>& batches, PODVector<float>& vertexData, const IntRect& currentScissor);
    /// React to resize.
    virtual void OnResize();
    /// React to indent change.
    virtual void OnIndentSet();

    /// Set font and font size and use signed distance field.
    bool SetFont(const String& fontName, int size = DEFAULT_FONT_SIZE);
    /// Set font and font size and use signed distance field.
    bool SetFont(Font* font, int size = DEFAULT_FONT_SIZE);
    /// Set text. Text is assumed to be either ASCII or UTF8-encoded.
    void SetText(const String& text);
    /// Set row alignment.
    void SetTextAlignment(HorizontalAlignment align);
    /// Set row spacing, 1.0 for original font spacing.
    void SetRowSpacing(float spacing);
    /// Set wordwrap. In wordwrap mode the text element will respect its current width. Otherwise it resizes itself freely.
    void SetWordwrap(bool enable);
    /// The text will be automatically translated. The text value used as string identifier.
    void SetAutoLocalizable(bool enable);
    /// Set selection. When length is not provided, select until the text ends.
    void SetSelection(unsigned start, unsigned length = M_MAX_UNSIGNED);
    /// Clear selection.
    void ClearSelection();
    /// Set selection background color. Color with 0 alpha (default) disables.
    void SetSelectionColor(const Color& color);
    /// Set hover background color. Color with 0 alpha (default) disables.
    void SetHoverColor(const Color& color);
    /// Set text effect.
    void SetTextEffect(TextEffect textEffect);
    /// Set effect color.
    void SetEffectColor(const Color& effectColor);

    /// Return font.
    Font* GetFont() const { return font_; }

    /// Return font size.
    int GetFontSize() const { return fontSize_; }

    /// Return text.
    const String& GetText() const { return text_; }

    /// Return row alignment.
    HorizontalAlignment GetTextAlignment() const { return textAlignment_; }

    /// Return row spacing.
    float GetRowSpacing() const { return rowSpacing_; }

    /// Return wordwrap mode.
    bool GetWordwrap() const { return wordWrap_; }

    /// Return auto localizable mode.
    bool GetAutoLocalizable() const { return autoLocalizable_; }

    /// Return selection start.
    unsigned GetSelectionStart() const { return selectionStart_; }

    /// Return selection length.
    unsigned GetSelectionLength() const { return selectionLength_; }

    /// Return selection background color.
    const Color& GetSelectionColor() const { return selectionColor_; }

    /// Return hover background color.
    const Color& GetHoverColor() const { return hoverColor_; }

    /// Return text effect.
    TextEffect GetTextEffect() const { return textEffect_; }

    /// Return effect color.
    const Color& GetEffectColor() const { return effectColor_; }

    /// Return row height.
    int GetRowHeight() const { return rowHeight_; }

    /// Return number of rows.
    unsigned GetNumRows() const { return rowWidths_.Size(); }

    /// Return number of characters.
    unsigned GetNumChars() const { return unicodeText_.Size(); }

    /// Return width of row by index.
    int GetRowWidth(unsigned index) const;
    /// Return position of character by index relative to the text element origin.
    IntVector2 GetCharPosition(unsigned index);
    /// Return size of character by index.
    IntVector2 GetCharSize(unsigned index);

    /// Set used in Text3D.
    void SetUsedInText3D(bool usedInText3D);
    /// Set text effect Z bias. Zero by default, adjusted only in 3D mode.
    void SetEffectDepthBias(float bias);

    /// Return effect Z bias.
    float GetEffectDepthBias() const { return effectDepthBias_; }

    /// Set font attribute.
    void SetFontAttr(const ResourceRef& value);
    /// Return font attribute.
    ResourceRef GetFontAttr() const;

protected:
    /// Filter implicit attributes in serialization process.
    virtual bool FilterImplicitAttributes(XMLElement& dest) const;
    /// Update text when text, font or spacing changed.
    void UpdateText(bool onResize = false);
    /// Update cached character locations after text update, or when text alignment or indent has changed.
    void UpdateCharLocations();
    /// Validate text selection to be within the text.
    void ValidateSelection();
    /// Return row start X position.
    int GetRowStartPosition(unsigned rowIndex) const;
    /// Contruct batch.
    void ConstructBatch
        (SystemUIBatch& pageBatch, const PODVector<GlyphLocation>& pageGlyphLocation, int dx = 0, int dy = 0, Color* color = 0,
            float depthBias = 0.0f);

    /// Used in Text3D.
    bool usedInText3D_;
    /// Font.
    SharedPtr<Font> font_;
    /// Current face.
    WeakPtr<FontFace> fontFace_;
    /// Font size.
    int fontSize_;
    /// UTF-8 encoded text.
    String text_;
    /// Row alignment.
    HorizontalAlignment textAlignment_;
    /// Row spacing.
    float rowSpacing_;
    /// Wordwrap mode.
    bool wordWrap_;
    /// Char positions dirty flag.
    bool charLocationsDirty_;
    /// Selection start.
    unsigned selectionStart_;
    /// Selection length.
    unsigned selectionLength_;
    /// Selection background color.
    Color selectionColor_;
    /// Hover background color.
    Color hoverColor_;
    /// Text effect.
    TextEffect textEffect_;
    /// Effect color.
    Color effectColor_;
    /// Text effect Z bias.
    float effectDepthBias_;
    /// Row height.
    int rowHeight_;
    /// Text as Unicode characters.
    PODVector<unsigned> unicodeText_;
    /// Text modified into printed form.
    PODVector<unsigned> printText_;
    /// Mapping of printed form back to original char indices.
    PODVector<unsigned> printToText_;
    /// Row widths.
    PODVector<int> rowWidths_;
    /// Glyph locations per each texture in the font.
    Vector<PODVector<GlyphLocation> > pageGlyphLocations_;
    /// Cached locations of each character in the text.
    PODVector<CharLocation> charLocations_;
    /// The text will be automatically translated.
    bool autoLocalizable_;
    /// Storage string id. Used when enabled autoLocalizable.
    String stringId_;
    /// Handle change Language.
    void HandleChangeLanguage(StringHash eventType, VariantMap& eventData);
    /// UTF8 to Unicode.
    void DecodeToUnicode();
};

}

}


text:
#ifndef CLICK_STRIPDSRHEADER_HH
#define CLICK_STRIPDSRHEADER_HH
#include <click/element.hh>
CLICK_DECLS

/*
 * =c
 * StripDSRHeader()
 * =s Grid
 * strips DSR header, saves offset to VLAN_ANNO
 * =d
 *
 * Strips the DSR header from DSR packets, saving the offset to
 * the VLAN_ANNO tag. Control packets are not stripped.
 *
 * This element helps if one wants to modify the payload inside a DSR data
 * packet. The code to parse the DSR header is taken from Click's grid
 * elements (DSRRouteTable etc).
 *
 * The IP header is set to the payload of the DSR packet.  After modifying the
 * inner IP packet, UnstripDSRHeader can be used to restore the DSR header.
 *
 * Based on Click's StripIPHeader and DSRRouteTable elements.
 *
 * =a CheckIPHeader, MarkIPHeader, StripIPHeader, DSRRouteTable
 *
 * =e
 * //DSR routing packets should go to input 1 of the DSR router
 * DSR_classifier::Classifier(09/C8,-)
 *    -> StripDSRHeader
 *    -> [... modify payload, stamp in timestamp or so ...]
 *    -> UnstripDSRHeader
 *    -> [1]dsr_rt::DSRRouteTable(...);
 */

class StripDSRHeader : public Element { public:

    StripDSRHeader() CLICK_COLD;
    ~StripDSRHeader() CLICK_COLD;

    const char *class_name() const		{ return "StripDSRHeader"; }
    const char *port_count() const		{ return PORTS_1_1; }

    Packet *simple_action(Packet *);

    Packet *swap_headers(Packet *);
};

CLICK_ENDDECLS
#endif


text:
"use strict";
var { createRandomArray, isSorted } = require("./index");

test("createRandomArray - arrays should have the expect length", () => {
  var arr1, arr2, arr3;
  arr1 = createRandomArray(10);
  arr2 = createRandomArray(50);
  arr3 = createRandomArray(100);
  expect(arr1).toHaveLength(10);
  expect(arr2).toHaveLength(50);
  expect(arr3).toHaveLength(100);
});

test("createRandomArray - arrays should be different", () => {
  var arr1, arr2, arr3;
  arr1 = createRandomArray(100);
  arr2 = createRandomArray(100);
  arr3 = createRandomArray(100);
  expect(arr1).not.toBe(arr2);
  expect(arr2).not.toBe(arr3);
  expect(arr1).not.toBe(arr3);
});

test("isSorted - return true on sorted arrays", () => {
  var arr1, arr2;
  arr1 = [1, 2, 3, 4, 100, 5000, 10000];
  arr2 = [];
  expect(isSorted(arr1)).toBeTruthy();
  expect(isSorted(arr2)).toBeTruthy();
});

test("isSorted - should throw on unsorted arrays", () => {
  var arr1;
  arr1 = [900, 1, 340, 200, 10000, 4];
  expect(() => isSorted(arr1)).toThrow();
});


text:
package com.datasift.client.examples;

import com.datasift.client.DataSiftClient;
import com.datasift.client.DataSiftConfig;
import com.datasift.client.core.Stream;
import com.datasift.client.push.PulledInteractions;
import com.datasift.client.push.PushSubscription;
import com.datasift.client.push.pull.LastInteraction;
import com.datasift.client.push.pull.PullJsonType;
import com.datasift.client.stream.Interaction;
import org.joda.time.DateTime;

import java.util.Date;

public class PullApi {
    private PullApi() {
    }

    public static void main(String... args) throws InterruptedException {
        DateTime.now();
        new Date();
        DataSiftConfig config = new DataSiftConfig("zcourts", "acbf4788f875db9fdf6bbd2131b10752");
        final DataSiftClient datasift = new DataSiftClient(config);
        Stream stream = Stream.fromString("13e9347e7da32f19fcdb08e297019d2e");

        PushSubscription streamSubscription = datasift.push()
                .createPull(PullJsonType.JSON_NEW_LINE, stream, "pull test").sync();

        PulledInteractions streamSubscriptions = datasift.push().pull(streamSubscription).sync();

        Interaction interaction;
        //non-blocking loop - if no data is available at the time of request the loop will be exited
        //if using this approach you must remember to manually call streamSubscriptions.stopPulling();
        for (Interaction i : streamSubscriptions) {
            System.out.println(i);
        }
        // recommended : "take" blocks until some data is fetched, the client automatically continues to pull
        //from DataSift until the subscription is finished or failed for some reason.
        //if you want to stop the automatic fetching call streamSubscriptions.stopPulling();
        //alternatively, use the take(upto,time unit) method to specify the maximum time to wait for interactions to
        //become available
        while (!((interaction = streamSubscriptions.take()) instanceof LastInteraction)) {
            System.out.println(interaction);
        }
        System.out.println("We're done!");
    }
}


text:
<!DOCTYPE html>
<html lang="en">
    {% include head.html %}
    <body {% if page.class %} class="{{ page.class }}" {% endif %}>
        <!-- PAGE NAV  -->
        {% include nav.html %}
        <!-- PAGE SECTIONS -->
        {% include about.html %}
        {% include feature.html %}
        {% include join.html %}
        {% include we-need-you.html %}
        <!-- {{ content }} -->
        {% include footer.html %}
    </body>
</html>