text:
import { browser, by, element, ElementArrayFinder, ElementFinder, ExpectedConditions } from 'protractor';
import { Helpers } from './../helpers/helpers';
import { LoginPageObject } from './login-page-object';
import { SettingArchivePageObject } from './setting-archive-page-object';

export class EntriesPageObject {
  public readonly settingsButton: ElementFinder = element(by.id('settingsButton'));
  public readonly entriesItem: ElementFinder = element(by.id('entriesItem34617'));
  public readonly medicineEntriesItem: ElementFinder = element(by.id('entriesItem75'));
  public readonly entriesTitle: ElementFinder = this.entriesItem.element(by.tagName('h1'));
  public readonly entriesFields: ElementArrayFinder = this.entriesItem.all(by.css('.entries-fields'));
  public readonly entriesFirstMetaDataField: ElementFinder = this.entriesFields.get(0);
  public readonly entriesSecondMetaDataField: ElementFinder = this.entriesFields.get(1);
  // tslint:disable-next-line:no-magic-numbers
  public readonly entriesThirdMetaDataField: ElementFinder = this.entriesFields.get(2);
  public readonly entriesGalleryButton: ElementFinder = this.entriesItem.element(by.css('.galleryButton'));
  public readonly entriesFileUpload: ElementFinder = this.entriesItem.element(by.css('.fileUpload'));

  public readonly settingArchivePageObject: SettingArchivePageObject = new SettingArchivePageObject();
  public readonly loginPage: LoginPageObject = new LoginPageObject();

  public loadPage(): void {
    this.settingArchivePageObject.loadPage();
    this.settingArchivePageObject.selectPoliceArchiveWithFilter42();
    this.waitEntriesPageLoaded();
  }

  public reloadPage(): void {
    this.loginPage.login();
    this.waitEntriesPageLoaded();
  }

  public pushToSettingsPage(): void {
    Helpers.waitUntilElementIsReady(this.settingsButton);
    this.settingsButton.click();
  }

  public pushEntriesGalleryButtonOnEntry34617(): void {
    Helpers.waitUntilElementIsReady(this.entriesGalleryButton);
    this.entriesGalleryButton.click();
    Helpers.chooseJPEGImagesInFileDialog(this.entriesFileUpload);
  }

  public verifyEntriesTitleVisible(): void {
    browser.wait(ExpectedConditions.visibilityOf(this.entriesTitle), Helpers.DEFAULT_WAIT_TIMEOUT);
  }

  public verifyNoFieldsVisible(): void {
    browser.wait(ExpectedConditions.and(
      ExpectedConditions.invisibilityOf(this.entriesFirstMetaDataField),
      ExpectedConditions.invisibilityOf(this.entriesSecondMetaDataField),
      ExpectedConditions.invisibilityOf(this.entriesThirdMetaDataField)
    ), Helpers.DEFAULT_WAIT_TIMEOUT);
  }

  public verifyOnlyFirstFieldVisible(): void {
    browser.wait(ExpectedConditions.and(
      ExpectedConditions.invisibilityOf(this.entriesSecondMetaDataField),
      ExpectedConditions.invisibilityOf(this.entriesThirdMetaDataField)
    ), Helpers.DEFAULT_WAIT_TIMEOUT);
  }

  public verifyOnlyFirstTwoFieldsVisible(): void {
    browser.wait(ExpectedConditions.invisibilityOf(this.entriesThirdMetaDataField), Helpers.DEFAULT_WAIT_TIMEOUT);
  }

  public verifyFirstFieldName(text: string): void {
    this.verifyFieldName(text, this.entriesFirstMetaDataField);
  }

  public verifySecondFieldName(text: string): void {
    this.verifyFieldName(text, this.entriesSecondMetaDataField);
  }

  public verifyDragoverlayVisible(): void {
    browser.wait(ExpectedConditions.visibilityOf(element(by.className('drag'))), Helpers.DEFAULT_WAIT_TIMEOUT);
  }

  public verifyDragoverlayInvisible(): void {
    browser.wait(ExpectedConditions.invisibilityOf(element(by.className('drag'))), Helpers.DEFAULT_WAIT_TIMEOUT);
  }

  public sendDropEvent(): void {
    this.removeEventlistenerFromFilePicker();
    this.pushEntriesGalleryButtonOnEntry34617();
    this.createDropEvent();
  }

  public createDragEnterEvent(): void {
    this.entriesItem.getAttribute('id').then(entriesItemId => Helpers.sendDragEnterEventToElement(entriesItemId));
  }

  public createDragLeaveEvent(): void {
    this.entriesItem.getAttribute('id').then(entriesItemId => Helpers.sendDragLeaveEventToElement(entriesItemId));
  }

  private verifyFieldName(expectedFieldname: string, field: ElementFinder): void {
    browser.wait(ExpectedConditions.visibilityOf(field), Helpers.DEFAULT_WAIT_TIMEOUT);
    field.getAttribute('fieldname').then(actualFieldname => expect(actualFieldname).toEqual(expectedFieldname));
  }

  private removeEventlistenerFromFilePicker(): void {
    this.entriesFileUpload.getAttribute('id').then(fileUploadId => Helpers.removeEventlistenerFromElement(fileUploadId));
  }

  private createDropEvent(): void {
    this.entriesFileUpload.getAttribute('id').then(
      uploadId => this.entriesItem.getAttribute('id').then(
        entriesId => Helpers.sendDragDropEventToElement(uploadId, entriesId)
      ));
  }

  private waitEntriesPageLoaded(): void {
    this.waitIonViewDidLoad();
    this.waitIonViewDidEnter();
  }

  private waitIonViewDidLoad(): void {
    browser.sleep(Helpers.DEFAULT_SLEEP_TIME);
    Helpers.waitUntilLoaderFinished();
  }

  private waitIonViewDidEnter(): void {
    browser.sleep(Helpers.DEFAULT_SLEEP_TIME);
    Helpers.waitUntilLoaderFinished();
  }
}


text:
namespace software_renderer
{
class SoftwareRenderer;

class CPUDrawer
{
public:
  struct Params
  {
    Params(std::string const & resourcesPrefix, double visualScale)
      : m_resourcesPrefix(resourcesPrefix)
      , m_visualScale(visualScale)
    {}

    std::string m_resourcesPrefix;
    double m_visualScale;
  };

  CPUDrawer(Params const & params);
  ~CPUDrawer();

  void BeginFrame(uint32_t width, uint32_t height, dp::Color const & bgColor);
  void Flush();
  void DrawMyPosition(m2::PointD const & myPxPotision);
  void DrawSearchResult(m2::PointD const & pxPosition);
  void DrawSearchArrow(double azimut);
  void EndFrame(FrameImage & image);

  GlyphCache * GetGlyphCache() const;

  double GetVisualScale() const { return m_visualScale; }

  ScreenBase CalculateScreen(m2::PointD const & center, int zoomModifier,
                             uint32_t pxWidth, uint32_t pxHeight,
                             FrameSymbols const & symbols, int & resultZoom);

  void Draw(FeatureData const & data);

protected:
  void DrawSymbol(m2::PointD const & pt, dp::Anchor pos, DrawRule const & rule);
  void DrawPath(PathInfo const & path, DrawRule const * rules, size_t count);
  void DrawArea(AreaInfo const & area, DrawRule const & rule);
  void DrawText(m2::PointD const & pt, dp::Anchor pos,
                FeatureStyler const & fs, DrawRule const & rule);
  void DrawPathText(PathInfo const & info, FeatureStyler const & fs, DrawRule const & rule);
  void DrawPathNumber(PathInfo const & path, FeatureStyler const & fs, DrawRule const & rule);

  using TRoadNumberCallbackFn = std::function<void(m2::PointD const & pt, dp::FontDecl const & font,
                                                   std::string const & text)>;

  void GenerateRoadNumbers(PathInfo const & path, dp::FontDecl const & font,
                           FeatureStyler const & fs, TRoadNumberCallbackFn const & fn);

  void DrawFeatureStart(FeatureID const & id);
  void DrawFeatureEnd(FeatureID const & id);
  FeatureID const & GetCurrentFeatureID() const;

  int GetGeneration() { return m_generationCounter++; }

  FeatureID const & Insert(PathInfo const & info);
  FeatureID const & Insert(AreaInfo const & info);
  FeatureID const & Insert(FeatureStyler const & styler);
  FeatureID const & Insert(std::string const & text);

private:
  void Render();

private:
  std::unique_ptr<SoftwareRenderer> m_renderer;
  int m_generationCounter;

  enum EShapeType
  {
    TYPE_INVALID,
    TYPE_SYMBOL,
    TYPE_CIRCLE,
    TYPE_AREA,
    TYPE_PATH,
    TYPE_PATH_TEXT,
    TYPE_TEXT,
    TYPE_ROAD_NUMBER
  };

  struct BaseShape
  {
    BaseShape(DrawRule const & rule, int generation, EShapeType type)
      : m_drawRule(rule)
      , m_generation(generation)
      , m_type(type)
    {}

    DrawRule m_drawRule;
    int m_generation = 0;
    EShapeType m_type = TYPE_INVALID;
  };

  struct PointShape : BaseShape
  {
    PointShape(m2::PointD const & pt, dp::Anchor anchor, EShapeType type,
               DrawRule const & rule, int generation)
      : BaseShape(rule, generation, type)
      , m_position(pt)
      , m_anchor(anchor)
    {
      ASSERT(type == TYPE_SYMBOL || type == TYPE_CIRCLE, ());
    }

    m2::PointD m_position = m2::PointD::Zero();
    dp::Anchor m_anchor = dp::Center;
  };

  struct ComplexShape : BaseShape
  {
    ComplexShape(FeatureID const & geomID, DrawRule const & rule, int generation, EShapeType type)
      : BaseShape(rule, generation, type)
      , m_geomID(geomID)
    {
      ASSERT(type == TYPE_AREA ||
             type == TYPE_PATH ||
             type == TYPE_PATH_TEXT ||
             type == TYPE_TEXT ||
             type == TYPE_ROAD_NUMBER, ());

      ASSERT(type == TYPE_ROAD_NUMBER || m_drawRule.m_rule != nullptr, ());
    }

    FeatureID m_geomID;
  };

  struct TextShape : ComplexShape
  {
    TextShape(m2::PointD const & pt, dp::Anchor anchor, FeatureID const & id,
              DrawRule const & rule, int generation, EShapeType type)
      : ComplexShape(id, rule, generation, type)
      , m_position(pt)
      , m_anchor(anchor)
    {}

    m2::PointD m_position = m2::PointD::Zero();
    dp::Anchor m_anchor = dp::Center;
  };

  void DrawSymbol(PointShape const * shape);
  void DrawCircle(PointShape const * shape);
  void DrawPath(ComplexShape const * shape);
  void DrawArea(ComplexShape const * shape);
  void DrawPathText(ComplexShape const * shape);
  void DrawRoadNumber(TextShape const * shape);
  void DrawText(TextShape const * shape);

  class CPUOverlayTree;
  struct OverlayWrapper
  {
    OverlayWrapper(BaseShape const ** rules, size_t count)
      : m_ruleCount(count)
    {
      ASSERT(count > 0 && count < 3, ());
      m_rules[0] = rules[0];
      if (m_ruleCount == 2)
        m_rules[1] = rules[1];
    }

    BaseShape const * m_rules[2];
    size_t m_ruleCount;
    std::vector<m2::RectD> m_rects;
    m2::RectD m_boundRect;
  };

  OverlayWrapper & AddOverlay(BaseShape const * shape1, BaseShape const * shape2 = nullptr);

  using TTextRendererCall =
      std::function<void(m2::PointD const &, dp::Anchor, dp::FontDecl const &, dp::FontDecl const &,
                         strings::UniString const &, strings::UniString const &)>;

  void CallTextRendererFn(TextShape const * shape, TTextRendererCall const & fn);

  using TRoadNumberRendererCall = std::function<void(
      m2::PointD const &, dp::Anchor, dp::FontDecl const &, strings::UniString const &)>;

  void CallTextRendererFn(TextShape const * shape, TRoadNumberRendererCall const & fn);

  using TPathTextRendererCall = std::function<void (PathInfo const &, dp::FontDecl const &,
                                                    strings::UniString const & text)>;
  void CallTextRendererFn(ComplexShape const * shape, TPathTextRendererCall const & fn);

  std::list<ComplexShape> m_areaPathShapes;

  // overlay part
  std::list<PointShape> m_pointShapes;
  std::list<ComplexShape> m_pathTextShapes;
  std::list<TextShape> m_textShapes;
  std::list<OverlayWrapper> m_overlayList;

  std::map<FeatureID, FeatureStyler> m_stylers;
  std::map<FeatureID, AreaInfo> m_areasGeometry;
  std::map<FeatureID, PathInfo> m_pathGeometry;
  std::map<FeatureID, std::string> m_roadNames;
  dp::FontDecl m_roadNumberFont;

  double m_visualScale;

  FeatureID m_currentFeatureID;
};
}  // namespace software_renderer

redpajama_set_name: RedPajamaGithub


text:
package com.fly.bmark2.utils.LazyList;

import android.content.Context;

import java.io.File;

public class FileCache {

    private File cacheDir;

    public FileCache(Context context){
        //Find the dir to save cached images
        if (android.os.Environment.getExternalStorageState().equals(android.os.Environment.MEDIA_MOUNTED))
            cacheDir=new File(android.os.Environment.getExternalStorageDirectory(),"LazyList");
        else
            cacheDir=context.getCacheDir();
        if(!cacheDir.exists())
            cacheDir.mkdirs();
    }

    public File getFile(String url){
        //I identify images by hashcode. Not a perfect solution, good for the demo.
        String filename= String.valueOf(url.hashCode());
        //Another possible solution (thanks to grantland)
        //String filename = URLEncoder.encode(url);
        File f = new File(cacheDir, filename);
        return f;

    }

    public void clear(){
        File[] files=cacheDir.listFiles();
        if(files==null)
            return;
        for(File f:files)
            f.delete();
    }

}


text:
package net.techcable.pineapple;

import org.junit.Test;

import static net.techcable.pineapple.SimpleFormatter.format;
import static org.junit.Assert.*;

public class SimpleFormatterTest {
    @SuppressWarnings("PatternValidation")
    @Test(expected = IllegalArgumentException.class)
    public void testInvalidInput() {
        format("I am very smart but I like to use invalid data {");
    }

    @Test
    public void testNoArgs() {
        assertEquals(
                "I hate your new-fangled argument system!",
                format("I hate your new-fangled argument system!")
        );
        assertEquals(
                "When I was a kid I had to walk up the hill both ways to get to school!",
                format("When I was a kid I had to walk up the hill both ways to get to school!")
        );
        assertEquals(
                "When I was a kid, we had to get up before we went to bed.",
                format("When I was a kid, we had to get up before we went to bed.")
        );
    }

    @Test
    public void testIncrementalArgs() {
        assertEquals(
                "The letters of the alphabet are: a, b, c",
                format("The letters of the alphabet are: {}, {}, {}", "a", "b", "c")
        );
        assertEquals(
                "10 minus 5 is 5.",
                format("{} minus {} is {}.", 10, 5, 5)
        );
        assertEquals(
                "Who lives in a pineapple under the sea? Sponge Bob Square Pants",
                format("Who lives in a {} under the {}? Sponge {} Square {}", "pineapple", "sea", "Bob", "Pants")
        );
    }

    @Test
    public void testIndexedArguments() {
        assertEquals(
                "The three best things in the world are: cake, pizza, and fruit-rollups. Did I forget to mention cake?",
                format("The three best things in the world are: {}, {}, and {}. Did I forget to mention {0}?", "cake", "pizza", "fruit-rollups")
        );
        assertEquals(
                "Newton and Einstein are the best physicists ever. They are very smart physicists!",
                format("{} and {} are the best {}s ever. They are very smart {2}s!", "Newton", "Einstein", "physicist")
        );
        assertEquals(
                "md_5 and Thinkofdeath run Spigot, which is the successor to the Bukkit project. Spigot releases new versions much faster than the old Bukkit project.",
                format("{} and {} run {}, which is the successor to the {} project. {2} releases new versions much faster than the old {3} project.", "md_5", "Thinkofdeath", "Spigot", "Bukkit")
        );
        assertEquals(
                "My name is dave. I like to do things backwards because I'm crazy. My friends just call me crazy dave.",
                format("My name is {1}. I like to do things backwards because I'm {0}. My friends just call me {0} {1}.", "crazy", "dave")
        );
    }

    @Test
    public void testEscaping() {
        assertEquals(
                "This is the backslash of doom: \\",
                format("This is the backslash of {}: \\\\", "doom")
        );
        assertEquals(
                "Brackets are the most important part of programming. Here is what one looks like: '{'",
                format("Brackets are the most important part of {}. Here is what one looks like: '\\{'", "programming")
        );
    }

    @Test(expected = IndexOutOfBoundsException.class)
    public void testInsufficientArguments() {
        format("The answer to life is: {}");
    }

    @Test
    public void testTooManyArguments() {
        assertEquals(
                "The answer to life is: ",
                format("The answer to life is: ", 42)
        );
        assertEquals(
                "Do you want to build a snowman?",
                format("Do you want to {} a snowman?", "build", "skyscraper")
        );
        assertEquals(
                "How much wood could a woodchuck chuck if a woodchuck could chuck wood?",
                format(
                        "How much wood could a {1} {2} if a {1} could {2} wood?",
                        "tacoz",
                        "woodchuck",
                        "chuck"
                )
        );
    }

}


text:
<?php

function grs($length = 10) {
    $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
    $randomString = '';
    for ($i = 0; $i < $length; $i++) {
        $randomString .= $characters[rand(0, strlen($characters) - 1)];
    }
    return $randomString;
}

function checkLab($id) {
  // Make function to find id
  return;
}

function addUser($email, $password, $name, $class) {
  $password = password_hash(BCRYPT_PASSOWRD, $password);
  $
}

function editUser($option, $newsettings) {

}

function changePassword($email, ) {

}


text:
<?xml version="1.0"?>
<package format="2">
  <name>teleop_master</name>
  <version>0.1.0</version>
  <description>The teleop_master package</description>

  <maintainer email="p111026h@mail.kyutech.jp">yasu16</maintainer>
  <maintainer email="o111027y@mail.kyutech.jp">Doi Yusuke</maintainer>

  <license>BSD</license>
  <url type="website">http://cir-kit.github.io/</url>
  <author email="cirkit.infomation@gmail.com">CIR-KIT</author>
  <buildtool_depend>catkin</buildtool_depend>
  <depend>roscpp</depend>
  <depend>geometry_msgs</depend>

  <export>
  </export>
</package>


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

<meta charset="UTF-8"/>
<title>El primer script</title>

Esta página contiene el primer script, para poder visualizarlo debes tener activado el soporte JavaScript


text:
Return the name of the context setted with the [../mixins/_s-context.scss] mixin

### Parameters
Name  |  Type  |  Description  |  Status  |  Default
------------  |  ------------  |  ------------  |  ------------  |  ------------
$default  |  **{ [String](http://www.sass-lang.com/documentation/file.SASS_REFERENCE.html#sass-script-strings) }**  |  The name to return if no context exist  |  optional  |  null

Return **{ [String](http://www.sass-lang.com/documentation/file.SASS_REFERENCE.html#sass-script-strings) }** The context name

### Example
```scss
	// register a context
@include s-context-setup('my-context', (
		// override some settings here...
));

s-context('hello') // => 'hello'
@include s-context('my-context') {
		s-context('hello') // => 'my-context'
}
```
Author : Olivier Bossel [olivier.bossel@gmail.com](mailto:olivier.bossel@gmail.com) [https://olivierbossel.com](https://olivierbossel.com)


text:
import React from 'react';
import { Overlay, Button, Icon, Card, Divider } from 'uiw';
import Markdown from '../../../components/Markdown';
import './index.less';

export default function Page() {
  return (
    <Markdown
      path="https://github.com/uiwjs/uiw/tree/master/packages/react-overlay/README.md"
      dependencies={{ Overlay, Button, Icon, Card, Divider }}
      renderPage={async () => {
        const md = await import(
          'uiw/node_modules/@uiw/react-overlay/README.md'
        );
        return md.default || md;
      }}
    />
  );
}


text:
#include "krb5_locl.h"

/**
 * Free content of krb5_creds.
 *
 * @param context Kerberos 5 context.
 * @param c krb5_creds to free.
 *
 * @return Returns 0 to indicate success. Otherwise an kerberos et
 * error code is returned, see krb5_get_error_message().
 *
 * @ingroup krb5
 */

KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL
krb5_free_cred_contents (krb5_context context, krb5_creds *c)
{
    krb5_free_principal (context, c->client);
    c->client = NULL;
    krb5_free_principal (context, c->server);
    c->server = NULL;
    krb5_free_keyblock_contents (context, &c->session);
    krb5_data_free (&c->ticket);
    krb5_data_free (&c->second_ticket);
    free_AuthorizationData (&c->authdata);
    krb5_free_addresses (context, &c->addresses);
    memset(c, 0, sizeof(*c));
    return 0;
}

/**
 * Copy content of krb5_creds.
 *
 * @param context Kerberos 5 context.
 * @param incred source credential
 * @param c destination credential, free with krb5_free_cred_contents().
 *
 * @return Returns 0 to indicate success. Otherwise an kerberos et
 * error code is returned, see krb5_get_error_message().
 *
 * @ingroup krb5
 */

KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL
krb5_copy_creds_contents (krb5_context context,
			  const krb5_creds *incred,
			  krb5_creds *c)
{
    krb5_error_code ret;

    memset(c, 0, sizeof(*c));
    ret = krb5_copy_principal (context, incred->client, &c->client);
    if (ret)
	goto fail;
    ret = krb5_copy_principal (context, incred->server, &c->server);
    if (ret)
	goto fail;
    ret = krb5_copy_keyblock_contents (context, &incred->session, &c->session);
    if (ret)
	goto fail;
    c->times = incred->times;
    ret = krb5_data_copy (&c->ticket,
			  incred->ticket.data,
			  incred->ticket.length);
    if (ret)
	goto fail;
    ret = krb5_data_copy (&c->second_ticket,
			  incred->second_ticket.data,
			  incred->second_ticket.length);
    if (ret)
	goto fail;
    ret = copy_AuthorizationData(&incred->authdata, &c->authdata);
    if (ret)
	goto fail;
    ret = krb5_copy_addresses (context,
			       &incred->addresses,
			       &c->addresses);
    if (ret)
	goto fail;
    c->flags = incred->flags;
    return 0;

fail:
    krb5_free_cred_contents (context, c);
    return ret;
}

/**
 * Copy krb5_creds.
 *
 * @param context Kerberos 5 context.
 * @param incred source credential
 * @param outcred destination credential, free with krb5_free_creds().
 *
 * @return Returns 0 to indicate success. Otherwise an kerberos et
 * error code is returned, see krb5_get_error_message().
 *
 * @ingroup krb5
 */

KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL
krb5_copy_creds (krb5_context context,
		 const krb5_creds *incred,
		 krb5_creds **outcred)
{
    krb5_creds *c;

    c = calloc(1, sizeof(*c));
    if (c == NULL)
	return krb5_enomem(context);
    *outcred = c;
    return krb5_copy_creds_contents (context, incred, c);
}

/**
 * Free krb5_creds.
 *
 * @param context Kerberos 5 context.
 * @param c krb5_creds to free.
 *
 * @return Returns 0 to indicate success. Otherwise an kerberos et
 * error code is returned, see krb5_get_error_message().
 *
 * @ingroup krb5
 */

KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL
krb5_free_creds (krb5_context context, krb5_creds *c)
{
    if (c != NULL)
        krb5_free_cred_contents(context, c);
    free(c);
    return 0;
}

/* XXX this do not belong here */
static krb5_boolean
krb5_times_equal(const krb5_times *a, const krb5_times *b)
{
    return a->starttime == b->starttime &&
	a->authtime == b->authtime &&
	a->endtime == b->endtime &&
	a->renew_till == b->renew_till;
}

/**
 * Return TRUE if `mcreds' and `creds' are equal (`whichfields'
 * determines what equal means).
 *
 *
 * The following flags, set in whichfields affects the comparison:
 * - KRB5_TC_MATCH_SRV_NAMEONLY Consider all realms equal when comparing the service principal.
 * - KRB5_TC_MATCH_KEYTYPE Compare enctypes.
 * - KRB5_TC_MATCH_FLAGS_EXACT Make sure that the ticket flags are identical.
 * - KRB5_TC_MATCH_FLAGS Make sure that all ticket flags set in mcreds are also present in creds .
 * - KRB5_TC_MATCH_TIMES_EXACT Compares the ticket times exactly.
 * - KRB5_TC_MATCH_TIMES Compares only the expiration times of the creds.
 * - KRB5_TC_MATCH_AUTHDATA Compares the authdata fields.
 * - KRB5_TC_MATCH_2ND_TKT Compares the second tickets (used by user-to-user authentication).
 * - KRB5_TC_MATCH_IS_SKEY Compares the existance of the second ticket.
 *
 * @param context Kerberos 5 context.
 * @param whichfields which fields to compare.
 * @param mcreds cred to compare with.
 * @param creds cred to compare with.
 *
 * @return return TRUE if mcred and creds are equal, FALSE if not.
 *
 * @ingroup krb5
 */

KRB5_LIB_FUNCTION krb5_boolean KRB5_LIB_CALL
krb5_compare_creds(krb5_context context, krb5_flags whichfields,
		   const krb5_creds * mcreds, const krb5_creds * creds)
{
    krb5_boolean match = TRUE;

    if (match && mcreds->server) {
	if (whichfields & (KRB5_TC_DONT_MATCH_REALM | KRB5_TC_MATCH_SRV_NAMEONLY))
	    match = krb5_principal_compare_any_realm (context, mcreds->server,
						      creds->server);
	else
	    match = krb5_principal_compare (context, mcreds->server,
					    creds->server);
    }

    if (match && mcreds->client) {
	if(whichfields & KRB5_TC_DONT_MATCH_REALM)
	    match = krb5_principal_compare_any_realm (context, mcreds->client,
						      creds->client);
	else
	    match = krb5_principal_compare (context, mcreds->client,
					    creds->client);
    }

    if (match && (whichfields & KRB5_TC_MATCH_KEYTYPE))
        match = mcreds->session.keytype == creds->session.keytype;

    if (match && (whichfields & KRB5_TC_MATCH_FLAGS_EXACT))
	match = mcreds->flags.i == creds->flags.i;

    if (match && (whichfields & KRB5_TC_MATCH_FLAGS))
	match = (creds->flags.i & mcreds->flags.i) == mcreds->flags.i;

    if (match && (whichfields & KRB5_TC_MATCH_TIMES_EXACT))
	match = krb5_times_equal(&mcreds->times, &creds->times);

    if (match && (whichfields & KRB5_TC_MATCH_TIMES))
	/* compare only expiration times */
	match = (mcreds->times.renew_till <= creds->times.renew_till) &&
	    (mcreds->times.endtime <= creds->times.endtime);

    if (match && (whichfields & KRB5_TC_MATCH_AUTHDATA)) {
	unsigned int i;
	if(mcreds->authdata.len != creds->authdata.len)
	    match = FALSE;
	else
	    for(i = 0; match && i < mcreds->authdata.len; i++)
		match = (mcreds->authdata.val[i].ad_type ==
			 creds->authdata.val[i].ad_type) &&
		    (krb5_data_cmp(&mcreds->authdata.val[i].ad_data,
				   &creds->authdata.val[i].ad_data) == 0);
    }
    if (match && (whichfields & KRB5_TC_MATCH_2ND_TKT))
	match = (krb5_data_cmp(&mcreds->second_ticket, &creds->second_ticket) == 0);

    if (match && (whichfields & KRB5_TC_MATCH_IS_SKEY))
	match = ((mcreds->second_ticket.length == 0) ==
		 (creds->second_ticket.length == 0));

    return match;
}

/**
 * Returns the ticket flags for the credentials in creds.
 * See also krb5_ticket_get_flags().
 *
 * @param creds credential to get ticket flags from
 *
 * @return ticket flags
 *
 * @ingroup krb5
 */

KRB5_LIB_FUNCTION unsigned long KRB5_LIB_CALL
krb5_creds_get_ticket_flags(krb5_creds *creds)
{
    return TicketFlags2int(creds->flags.b);
}


text:
function corsRedirect(desc, redirectUrl, redirectLocation, redirectStatus, expectedOrigin) {
  var uuid_token = token();
  var url = redirectUrl;
  var urlParameters = "?token=" + uuid_token + "&max_age=0";
  urlParameters += "&redirect_status=" + redirectStatus;
  urlParameters += "&location=" + encodeURIComponent(redirectLocation);

  var requestInit = {"mode": "cors", "redirect": "follow"};

  return promise_test(function(test) {
    return fetch(RESOURCES_DIR + "clean-stash.py?token=" + uuid_token).then(function(resp) {
      return fetch(url + urlParameters, requestInit).then(function(resp) {
        assert_equals(resp.status, 200, "Response's status is 200");
        assert_equals(resp.headers.get("x-did-preflight"), "0", "No preflight request has been made");
        assert_equals(resp.headers.get("x-origin"), expectedOrigin, "Origin is correctly set after redirect");
      });
    });
  }, desc);
}

var redirPath = dirname(location.pathname) + RESOURCES_DIR + "redirect.py";
var preflightPath = dirname(location.pathname) + RESOURCES_DIR + "preflight.py";

var host_info = get_host_info();

var localRedirect = host_info.HTTP_ORIGIN + redirPath;
var remoteRedirect = host_info.HTTP_REMOTE_ORIGIN + redirPath;

var localLocation = host_info.HTTP_ORIGIN + preflightPath;
var remoteLocation = host_info.HTTP_REMOTE_ORIGIN + preflightPath;
var remoteLocation2 = host_info.HTTP_ORIGIN_WITH_DIFFERENT_PORT + preflightPath;

for (var code of [301, 302, 303, 307, 308]) {
  corsRedirect("Redirect " + code + ": cors to same cors", remoteRedirect, remoteLocation, code, location.origin);
  corsRedirect("Redirect " + code + ": cors to another cors", remoteRedirect, remoteLocation2, code, "null");
  corsRedirect("Redirect " + code + ": same origin to cors", localRedirect, remoteLocation, code, location.origin);
  corsRedirect("Redirect " + code + ": cors to same origin", remoteRedirect, localLocation, code, "null");
}


text:
en: tiller
pl: rumpel
layout: dict_word
date: 2014-01-01
cat: deck
---

Drążek służący do sterowania [[helm](/dict/h/helm/)] jachtem.

W przeciwieństwie do koła sterowego [[wheel](/dict/w/wheel/)] należy wychylić w kierunku przeciwnym do tego do którego mamy zamiar płynąć.


text:
<?php

namespace SkNd\MediaBundle\Tests\MediaAPI;
use SkNd\MediaBundle\MediaAPI\AmazonAPI;
use SkNd\MediaBundle\Entity\MediaSelection;
use SkNd\MediaBundle\Entity\Decade;
use SkNd\MediaBundle\Entity\Genre;
use SkNd\MediaBundle\Entity\MediaType;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
require_once 'src\SkNd\MediaBundle\MediaAPI\AmazonSignedRequest.php';

class AmazonAPITest extends WebTestCase {

    private $access_params;
    private $mediaSelection;
    private $testASR;
    protected static $kernel;
    protected static $em;

    public static function setUpBeforeClass(){
        self::$kernel = static::createKernel();
        self::$kernel->boot();
        self::$em = self::$kernel->getContainer()->get('doctrine.orm.entity_manager');
    }

    public static function tearDownAfterClass(){
        self::$kernel = null;
        self::$em = null;
    }

    protected function setUp(){
        $this->access_params = array(
            'amazon_public_key'     => 'apk',
            'amazon_private_key'    => 'aupk',
            'amazon_associate_tag'  => 'aat',
        );

        $mediaType = self::$em->getRepository('SkNdMediaBundle:MediaType')->getMediaTypeBySlug('film');
        $this->mediaSelection = new MediaSelection();
        $this->mediaSelection->setMediaType($mediaType);

        $this->testASR = $this->getMockBuilder('\\SkNd\\MediaBundle\\MediaAPI\\AmazonSignedRequest')
                ->setMethods(array(
                    'aws_signed_request',
                ))
                ->getMock();
    }

    protected function tearDown(){
        unset($this->access_params);
        unset($this->mediaSelection);
        unset($this->testASR);
    }

    /**
     * @expectedException RuntimeException
     * @expectedExceptionMessage Could not connect to Amazon
     */
    public function testGetListingsNoConnectionThrowsException(){

        $this->testASR->expects($this->any())
                ->method('aws_signed_request')
                ->will($this->returnValue(False));

        $api = new AmazonAPI($this->access_params, $this->testASR);
        $response = $api->getListings($this->mediaSelection);

    }

    /**
     * @expectedException LengthException
     * @expectedExceptionMessage No results were returned
     */
    public function testGetListingsEmptyDataSetThrowsException(){
        $empty_xml_data_set = simplexml_load_file('src\SkNd\MediaBundle\Tests\MediaAPI\SampleResponses\empty_xml_response.xml');

        $this->testASR->expects($this->any())
                ->method('aws_signed_request')
                ->will($this->returnValue($empty_xml_data_set));

        $api = new AmazonAPI($this->access_params, $this->testASR);
        $response = $api->getListings($this->mediaSelection);
    }

    public function testGetListingsValidDataSetReturnsResponse(){
        $valid_xml_data_set = simplexml_load_file('src\SkNd\MediaBundle\Tests\MediaAPI\SampleResponses\valid_xml_response.xml');

        $this->testASR->expects($this->any())
                ->method('aws_signed_request')
                ->will($this->returnValue($valid_xml_data_set));

        $api = new AmazonAPI($this->access_params, $this->testASR);
        $response = $api->getListings($this->mediaSelection);
        $this->assertTrue((int)$response->TotalResults > 0);
    }

    /**
     * @expectedException RuntimeException
     * @expectedExceptionMessage Could not connect to Amazon
     */
    public function testGetDetailsWithNoResponseThrowsException(){
        $this->testASR->expects($this->any())
                ->method('aws_signed_request')
                ->will($this->returnValue(False));

        $api = new AmazonAPI($this->access_params, $this->testASR);
        $response = $api->getDetails(array());
    }

    /**
     * @expectedException RuntimeException
     */
    public function testGetDetailsWithErrorResponseThrowsException(){
        $invalid_xml_data_set = simplexml_load_file('src\SkNd\MediaBundle\Tests\MediaAPI\SampleResponses\invalidSampleAmazonDetails.xml');
        $this->testASR->expects($this->any())
                ->method('aws_signed_request')
                ->will($this->returnValue($invalid_xml_data_set));

        $api = new AmazonAPI($this->access_params, $this->testASR);
        $response = $api->getDetails(array());
    }

    public function testGetDecadeFromXMLReturnsDecadeSlugForExistingYear(){
        $valid_xml_data_set = simplexml_load_file('src\SkNd\MediaBundle\Tests\MediaAPI\SampleResponses\sampleAmazonDetailsReturnedFromAPI.xml');

        $this->testASR->expects($this->any())
                ->method('aws_signed_request')
                ->will($this->returnValue($valid_xml_data_set));

        $api = new AmazonAPI($this->access_params, $this->testASR);

        $response = $api->getDecadeFromXML($valid_xml_data_set);
        $this->assertEquals($response, '2000s', "didn't return valid decade");
    }

    public function testGetDecadeFromXMLReturnsNullForNonexistentDecadeInTitle(){
        $valid_xml_data_set = simplexml_load_file('src\SkNd\MediaBundle\Tests\MediaAPI\SampleResponses\sampleAmazonDetailsReturnedFromAPI.xml');
        $valid_xml_data_set->ItemAttributes->Title = "Elf [DVD] no year";

        $this->testASR->expects($this->any())
                ->method('aws_signed_request')
                ->will($this->returnValue($valid_xml_data_set));

        $api = new AmazonAPI($this->access_params, $this->testASR);

        $response = $api->getDecadeFromXML($valid_xml_data_set);
        $this->assertNull($response, "didn't return null");
    }

    /*public function testBatchProcessMoreThanThresholdNumberOfItemsTrimsArray(){
        $ids = array(1,2,3,4,5,6,7,8,9,10,11);
        $api = new AmazonAPI($this->access_params, $this->testASR);
        $response = $api->getBatch($ids);

        $this->assertTrue($api->)
    }*/

}

?>


text:
import java.io.IOException;

import net.java.games.input.Component;
import net.java.games.input.Component.Identifier.Axis;
import net.java.games.input.Component.Identifier.Button;
import net.java.games.input.Controller;
import net.java.games.input.ControllerEnvironment;
import net.java.games.input.Event;
import net.java.games.input.EventQueue;
import net.java.games.input.Keyboard;
import nl.fcdonders.fieldtrip.bufferclient.BufferClientClock;
import nl.fcdonders.fieldtrip.bufferclient.BufferEvent;
import nl.fcdonders.fieldtrip.bufferclient.Header;

public class KeyBoardHandler implements Runnable {

	Keyboard keyboard;
	//Component x_axis;
//	Component w_button;
//	Component a_button;
//	Component s_button;
//	Component d_button;
//	Component esc_button;

	Header hdr;
	BufferClientClock c;

	public KeyBoardHandler()
	{
		//connectBuffer();

		Controller[] ca = ControllerEnvironment.getDefaultEnvironment()
				.getControllers();

		// find the joystick
		for (int i = 0; i < ca.length; i++)
		{
			System.out.println(ca[i].getType().toString());

			if (ca[i].getType() ==Controller.Type.KEYBOARD )
			{
				keyboard = (Keyboard) ca[i];
				//x_axis = keyboard.getComponent(Component.Identifier.Butt);

			}
		}
		//print components
//		for (Component c : keyboard.getComponents())
//		{
//			System.out.println(c);
//			if (c.toString().equals("W"))
//			{
//				System.out.println("Yay");
//			}
//
//		}
	}

	private void connectBuffer() {
		String hostname = ConnectionInfo.BUFFER_HOSTNAME;
		int port = ConnectionInfo.BUFFER_PORT;

		c = new BufferClientClock();

		hdr = null;
		while (hdr == null) {
			try {
				System.out.println("Connecting to " + hostname + ":" + port);
				c.connect(hostname, port);
				// C.setAutoReconnect(true);
				if (c.isConnected()) {
					System.out.println("GETHEADER");
					hdr = c.getHeader();
				}
			} catch (IOException e) {
				hdr = null;
			}
			if (hdr == null) {
				System.out.println("Invalid Header... waiting");
				try {
					Thread.sleep(1000);
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
			//bufferConnected = true;

		}
	}
	@Override
	public void run() {
		// TODO Auto-generated method stub
		String keypressed = null;
		EventQueue queue = keyboard.getEventQueue();
        Event event = new Event();
		while (true)
		{
			queue.getNextEvent(event);
			System.out.println(event);
			try {
			Thread.sleep(500);
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

			//x_axis.getPollData();
//			try {
//				c.putEvent(new BufferEvent("Joystick", x_axis.getPollData(), -1 ));
//			} catch (IOException e) {
//				// TODO Auto-generated catch block
//				e.printStackTrace();
//			}
//			try {
//				Thread.sleep(500);
//			} catch (InterruptedException e) {
//				// TODO Auto-generated catch block
//				e.printStackTrace();
//			}

		}

	}

}