text:
package org.regenstrief.xhl7;

import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.UnsupportedEncodingException;
import java.io.Writer;

import org.xml.sax.Attributes;
import org.xml.sax.ContentHandler;
import org.xml.sax.SAXException;

/** A SAX ContentHandler that produces traditionally encoded HL7
    messages from XML/SAX events. Message is sent to the OutputStream
    set for the Writer.

This ContentHandler is also its own facotry.

    @author Gunther Schadow
    @version $Id: HL7XMLWriter.java 2224 2006-01-17 17:29:22Z gunterze $
*/
public class HL7XMLWriter implements ContentHandler, HL7XMLLiterate, XMLWriter
{
  private static final String ISO_8859_1 = "ISO-8859-1";
  private Writer _output = new OutputStreamWriter(System.out);
  private char _delimiters[] = DEFAULT_DELIMITERS.toCharArray();

  /** Default constructor used when instantiated by reflection. */
  public HL7XMLWriter() { }

  /** Convenient constructor that calls setOutputStream.

      @param outputStream where the serialized HL7 goes.
   */
  public HL7XMLWriter(OutputStream outputStream) {
    setOutputStream(outputStream);
  }

  /** Set the output stream destination.

      @param outputStream where the serialized HL7 goes.
   */
  public void setOutputStream(OutputStream outputStream) {
    try {
		this._output = new OutputStreamWriter(outputStream, ISO_8859_1);
	} catch (UnsupportedEncodingException e) {
		throw new RuntimeException(e);
	}
  }

  /** Get the content handler. This HL7XMLWriter is itself a
      content handler, so it returns itself. But the XMLWriter interface
      is written such that the content handler could be a helper
      object.

If no outputStream was set previously, an output stream to
      standard out is used instead.

      @return itself as a content handler.
  */
  public ContentHandler getContentHandler() {
    return this;
  }

  /** For the ContentHandler interface. */
  public void characters(char[] ch, int start, int length)
    throws SAXException
  {
    try {
      int nextWritePosition = start;
      int endPosition = start + length;
    main_loop:
      while(nextWritePosition < endPosition) {
	int unescapeableRegionPosition = nextWritePosition;
	while(unescapeableRegionPosition < endPosition) {
	  char c = ch[unescapeableRegionPosition++];
	  for(int i = 0; i < NUMBER_OF_DELIMITERS; i++) {
	    if(c == this._delimiters[i]) {
	      int writeLength
		= unescapeableRegionPosition - 1 - nextWritePosition;
	      if(writeLength > 0) {
		this._output.write(ch, nextWritePosition, writeLength);
	      }
	      this._output.write(this._delimiters[N_DEL_ESCAPE]);
	      this._output.write(DELIMITER_ESCAPES.charAt(i));
	      this._output.write(this._delimiters[N_DEL_ESCAPE]);
	      nextWritePosition = unescapeableRegionPosition;
	      continue main_loop;
	    }
	  }
	  if(c=='\r' || c=='\n') {
	    int writeLength
	      = unescapeableRegionPosition - 1 - nextWritePosition;
	    if(unescapeableRegionPosition < endPosition) {
	      char nextc = ch[unescapeableRegionPosition];
	      if(c=='\r' && nextc=='\n')
		unescapeableRegionPosition++;
	    }
	    if(writeLength > 0) {
	      this._output.write(ch, nextWritePosition, writeLength);
	    }
	    this._output.write(this._delimiters[N_DEL_ESCAPE]);
	    this._output.write(".br");
	    this._output.write(this._delimiters[N_DEL_ESCAPE]);
	    nextWritePosition = unescapeableRegionPosition;
	    continue main_loop;
	  }
	}
	int writeLength = unescapeableRegionPosition - nextWritePosition;
	if(writeLength > 0)
	  this._output.write(ch, nextWritePosition, writeLength);
	nextWritePosition = unescapeableRegionPosition;
      }
    } catch(Exception ex) {
      throw new SAXException(ex);
    }
  }

  /** For the ContentHandler interface. */
  public void startElement(String namespaceURI, String localName,
			   String qName, Attributes atts)
    throws SAXException
  {
    try {
      localName = localName.intern();
      if(localName == TAG_FIELD) {
	this._output.write(this._delimiters[N_DEL_FIELD]);
      } else if(localName == TAG_REPEAT) {
	this._output.write(this._delimiters[N_DEL_REPEAT]);
      } else if(localName == TAG_COMPONENT) {
	this._output.write(this._delimiters[N_DEL_COMPONENT]);
      } else if(localName == TAG_SUBCOMPONENT) {
	this._output.write(this._delimiters[N_DEL_SUBCOMPONENT]);
      } else if(localName == TAG_ESCAPE) {
	this._output.write(this._delimiters[N_DEL_ESCAPE]);
      } else if(localName == "FHS"
		|| localName == "BHS"
		|| localName == "MSH") {
	String fieldDelimiter = atts.getValue(ATT_DEL_FIELD);
	if(fieldDelimiter != null)
	  this._delimiters[N_DEL_FIELD] = fieldDelimiter.charAt(0);
	String repeatDelimiter = atts.getValue(ATT_DEL_REPEAT);
	if(repeatDelimiter != null)
	  this._delimiters[N_DEL_REPEAT] = repeatDelimiter.charAt(0);
	String componentDelimiter = atts.getValue(ATT_DEL_COMPONENT);
	if(componentDelimiter != null)
	  this._delimiters[N_DEL_COMPONENT] = componentDelimiter.charAt(0);
	String subcomponentDelimiter = atts.getValue(ATT_DEL_SUBCOMPONENT);
	if(subcomponentDelimiter != null)
	  this._delimiters[N_DEL_SUBCOMPONENT]
	    = subcomponentDelimiter.charAt(0);
	String escapeDelimiter = atts.getValue(ATT_DEL_ESCAPE);
	if(escapeDelimiter != null)
	  this._delimiters[N_DEL_ESCAPE] = escapeDelimiter.charAt(0);
	this._output.write(localName);
	this._output.write(this._delimiters);
      } else if(localName == TAG_ROOT) {
      } else {
	this._output.write(localName);
      }
    } catch(Exception ex) {
      throw new SAXException(ex);
    }
  }

  /** For the ContentHandler interface. */
  public void endElement(String namespaceURI,
			 String localName, String qName)
    throws SAXException
  {
    try {
      localName = localName.intern();
      if(localName == TAG_FIELD) {
      } else if(localName == TAG_REPEAT) {
      } else if(localName == TAG_COMPONENT) {
      } else if(localName == TAG_SUBCOMPONENT) {
      } else if(localName == TAG_ESCAPE) {
	this._output.write(this._delimiters[N_DEL_ESCAPE]);
      } else if(localName == TAG_ROOT) {
      } else {
	this._output.write('\r');
	this._output.flush();
      }
    } catch(Exception ex) {
      throw new SAXException(ex);
    }
  }

  /** For the ContentHandler interface - a no-op. */
  public void startDocument() {}
  /** For the ContentHandler interface - a no-op. */
  public void endDocument() { }
  /** For the ContentHandler interface - a no-op. */
  public void startPrefixMapping(String prefix, String uri) {}
  /** For the ContentHandler interface - a no-op. */
  public void endPrefixMapping(String prefix) {}
  /** For the ContentHandler interface - a no-op. */
  public void ignorableWhitespace(char[] ch, int start, int length) {}
  /** For the ContentHandler interface - a no-op. */
  public void processingInstruction(String target, String data) {}
  /** For the ContentHandler interface - a no-op. */
  public void setDocumentLocator(org.xml.sax.Locator locator) {}
  /** For the ContentHandler interface - a no-op. */
  public void skippedEntity(String name) {}
}


text:
package atlas

import (
	"fmt"
	"reflect"
	"testing"

	"github.com/hashicorp/terraform/helper/resource"
	"github.com/hashicorp/terraform/terraform"
)

func TestAccArtifact_basic(t *testing.T) {
	resource.Test(t, resource.TestCase{
		PreCheck:  func() { testAccPreCheck(t) },
		Providers: testAccProviders,
		Steps: []resource.TestStep{
			resource.TestStep{
				Config: testAccArtifact_basic,
				Check: resource.ComposeTestCheckFunc(
					testAccCheckArtifactState("name", "hashicorp/tf-provider-test"),
				),
			},
		},
	})
}

func TestAccArtifact_metadata(t *testing.T) {
	resource.Test(t, resource.TestCase{
		PreCheck:  func() { testAccPreCheck(t) },
		Providers: testAccProviders,
		Steps: []resource.TestStep{
			resource.TestStep{
				Config: testAccArtifact_metadata,
				Check: resource.ComposeTestCheckFunc(
					testAccCheckArtifactState("name", "hashicorp/tf-provider-test"),
					testAccCheckArtifactState("id", "x86"),
					testAccCheckArtifactState("metadata_full.arch", "x86"),
				),
			},
		},
	})
}

func TestAccArtifact_metadataSet(t *testing.T) {
	resource.Test(t, resource.TestCase{
		PreCheck:  func() { testAccPreCheck(t) },
		Providers: testAccProviders,
		Steps: []resource.TestStep{
			resource.TestStep{
				Config: testAccArtifact_metadataSet,
				Check: resource.ComposeTestCheckFunc(
					testAccCheckArtifactState("name", "hashicorp/tf-provider-test"),
					testAccCheckArtifactState("id", "x64"),
					testAccCheckArtifactState("metadata_full.arch", "x64"),
				),
			},
		},
	})
}

func TestAccArtifact_buildLatest(t *testing.T) {
	resource.Test(t, resource.TestCase{
		PreCheck:  func() { testAccPreCheck(t) },
		Providers: testAccProviders,
		Steps: []resource.TestStep{
			resource.TestStep{
				Config: testAccArtifact_buildLatest,
				Check: resource.ComposeTestCheckFunc(
					testAccCheckArtifactState("name", "hashicorp/tf-provider-test"),
				),
			},
		},
	})
}

func TestAccArtifact_versionAny(t *testing.T) {
	resource.Test(t, resource.TestCase{
		PreCheck:  func() { testAccPreCheck(t) },
		Providers: testAccProviders,
		Steps: []resource.TestStep{
			resource.TestStep{
				Config: testAccArtifact_versionAny,
				Check: resource.ComposeTestCheckFunc(
					testAccCheckArtifactState("name", "hashicorp/tf-provider-test"),
				),
			},
		},
	})
}

func testAccCheckArtifactState(key, value string) resource.TestCheckFunc {
	return func(s *terraform.State) error {
		rs, ok := s.RootModule().Resources["atlas_artifact.foobar"]
		if !ok {
			return fmt.Errorf("Not found: %s", "atlas_artifact.foobar")
		}

		if rs.Primary.ID == "" {
			return fmt.Errorf("No ID is set")
		}

		p := rs.Primary
		if p.Attributes[key] != value {
			return fmt.Errorf(
				"%s != %s (actual: %s)", key, value, p.Attributes[key])
		}

		return nil
	}
}

func TestCleanMetadata(t *testing.T) {
	in := map[string]string{
		"region.us-east-1": "in",
		"what is	this?": "out",
	}
	exp := map[string]string{
		"region-us-east-1": "in",
		"what-is-this-":    "out",
	}
	out := cleanMetadata(in)
	if !reflect.DeepEqual(out, exp) {
		t.Fatalf("bad: %#v", out)
	}
}

const testAccArtifact_basic = `
resource "atlas_artifact" "foobar" {
	name = "hashicorp/tf-provider-test"
	type = "foo"
}`

const testAccArtifact_metadata = `
resource "atlas_artifact" "foobar" {
	name = "hashicorp/tf-provider-test"
	type = "foo"
	metadata {
		arch = "x86"
	}
	version = "any"
}`

const testAccArtifact_metadataSet = `
resource "atlas_artifact" "foobar" {
	name = "hashicorp/tf-provider-test"
	type = "foo"
	metadata_keys = ["arch"]
	version = "any"
}`

const testAccArtifact_buildLatest = `
resource "atlas_artifact" "foobar" {
	name = "hashicorp/tf-provider-test"
	type = "foo"
	build = "latest"
	metadata {
		arch = "x86"
	}
}`

const testAccArtifact_versionAny = `
resource "atlas_artifact" "foobar" {
	name = "hashicorp/tf-provider-test"
	type = "foo"
	version = "any"
}`

redpajama_set_name: RedPajamaGithub


text:
/*
 * vie_file_image.h
 */

#ifndef WEBRTC_VIDEO_ENGINE_MAIN_SOURCE_VIE_FILE_IMAGE_H_
#define WEBRTC_VIDEO_ENGINE_MAIN_SOURCE_VIE_FILE_IMAGE_H_

#include "typedefs.h"
#include "vie_file.h"
#include "module_common_types.h"
namespace webrtc {
class ViEFileImage
{
public:
    static int ConvertJPEGToVideoFrame(int engineId,
                                       const char* fileNameUTF8,
                                       VideoFrame& videoFrame);
    static int ConvertPictureToVideoFrame(int engineId,
                                          const ViEPicture& picture,
                                          VideoFrame& videoFrame);
};
} // namespace webrtc

#endif // WEBRTC_VIDEO_ENGINE_MAIN_SOURCE_VIE_FILE_IMAGE_H_


text:
using System;
using System.Collections.Generic;

namespace Soat.Cra.Model
{
	public class CRA
	{
        public int IdCol { get; set; }

        public Dictionary<int, Mission> Missions { get; set; }

        public DateTime Month { get; set; }
	}
}


text:
using UnityEngine;
using System.Collections;

public class Dog : MonoBehaviour
{
    [SerializeField]
    private AudioSource audio = null;

    [SerializeField]
    private Hands playerHands = null;

    [SerializeField]
    private Poop poopPrefab = null;

    [SerializeField]
    private Vector3 poopOffset = Vector3.zero;

    private bool hasPooped = false;

    public bool HasPooped
    {
        get
        {
            return this.hasPooped;
        }
    }

	private void OnCollisionEnter(Collision collision)
	{
        Weapons weaponType = Weapon.GetWeaponType(collision.gameObject);
        if (weaponType != Weapons.None)
        {
            ScenarioManager.GetCurrentScenario().SetFlag(weaponType, DogRoomScenario.Flags.DogDestroyed, true);
		}
	}

    private void Update()
    {
        if (!this.HasPooped && this.playerHands.HeldWeapon != null && this.playerHands.HeldWeapon.WeaponType == Weapons.Gun && Input.GetMouseButtonDown(0))
        {
            Instantiate(poopPrefab, this.transform.position + this.poopOffset, Quaternion.identity);

            this.hasPooped = true;

            this.audio.Stop();
        }
    }

    private void OnDrawGizmosSelected()
    {
        Gizmos.color = Color.red;
        Gizmos.DrawWireSphere(this.transform.position + this.poopOffset, 0.3f);
    }
}


text:
/* @flow */

/**
 * External dependencies
 */
import * as React from 'react';

/**
 * Internal dependencies
 */
import './style.scss';
import IconButton from '../../components/icon-button';

/**
 * Flow types
 */
type Props = {
  onHeaderSidebarToggleClick?: (SyntheticEvent<HTMLAnchorElement | HTMLButtonElement>) => void
};

const ContentHeader = (props: Props): React.Node => {
  const { onHeaderSidebarToggleClick } = props;

  return (
    <header className="app-content-header">
      <IconButton
        className="app-content-header__sidebar-toggle"
        onClick={ onHeaderSidebarToggleClick }
        icon="far fa-align-left fa-fw"
      />
    </header>
  );
};

export default ContentHeader;


text:
<!doctype html>

    <title>PubNub Clock Sync Drift Detection</title>

PubNub Clock Sync Drift Detection

40

Checking drift once per second.


text:
@interface MYChildClientViewController : UIViewController
@property(nonatomic) int rowIndex;
@property(nonatomic,strong) MYBluetoothBlocksClient *childClient;
@property(nonatomic,strong) IBOutlet UILabel *centralRSSILabel;

@property(nonatomic,strong) IBOutlet UILabel *centralNotifyLabel;
@property(nonatomic,strong) IBOutlet UIButton *centralSubscribeButton;

@property(nonatomic,strong) IBOutlet UITextField *centralWriteDataTextField;
@property(nonatomic,strong) IBOutlet UIButton *centralWriteDataButton;

@property(nonatomic,strong) IBOutlet UILabel *centralReadDataLabel;
@property(nonatomic,strong) IBOutlet UIButton *centralReadDataButton;
@property(nonatomic,strong) IBOutlet UIButton *updateRSSIButton;
@property(nonatomic,strong) IBOutlet UIImageView *peripheralImage;
@property(nonatomic,strong) IBOutlet UIImageView *centralImage;
@property(nonatomic,strong) dispatch_source_t timer;
@end


text:
using UnityEngine;
using System;
using LuaInterface;
using SLua;
using System.Collections.Generic;
public class Lua_UnityEngine_HumanPoseHandler : LuaObject {
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int constructor(IntPtr l) {
		try {
			UnityEngine.HumanPoseHandler o;
			UnityEngine.Avatar a1;
			checkType(l,2,out a1);
			UnityEngine.Transform a2;
			checkType(l,3,out a2);
			o=new UnityEngine.HumanPoseHandler(a1,a2);
			pushValue(l,true);
			pushValue(l,o);
			return 2;
		}
		catch(Exception e) {
			return error(l,e);
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int Dispose(IntPtr l) {
		try {
			UnityEngine.HumanPoseHandler self=(UnityEngine.HumanPoseHandler)checkSelf(l);
			self.Dispose();
			pushValue(l,true);
			return 1;
		}
		catch(Exception e) {
			return error(l,e);
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int GetHumanPose(IntPtr l) {
		try {
			UnityEngine.HumanPoseHandler self=(UnityEngine.HumanPoseHandler)checkSelf(l);
			UnityEngine.HumanPose a1;
			checkValueType(l,2,out a1);
			self.GetHumanPose(ref a1);
			pushValue(l,true);
			pushValue(l,a1);
			return 2;
		}
		catch(Exception e) {
			return error(l,e);
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int SetHumanPose(IntPtr l) {
		try {
			UnityEngine.HumanPoseHandler self=(UnityEngine.HumanPoseHandler)checkSelf(l);
			UnityEngine.HumanPose a1;
			checkValueType(l,2,out a1);
			self.SetHumanPose(ref a1);
			pushValue(l,true);
			pushValue(l,a1);
			return 2;
		}
		catch(Exception e) {
			return error(l,e);
		}
	}
	static public void reg(IntPtr l) {
		getTypeTable(l,"UnityEngine.HumanPoseHandler");
		addMember(l,Dispose);
		addMember(l,GetHumanPose);
		addMember(l,SetHumanPose);
		createTypeMetatable(l,constructor, typeof(UnityEngine.HumanPoseHandler));
	}
}


text:
MFLoading
=========

Simple Javascript util for displaying loading indicators


text:
from setuptools import setup, find_packages

setup(
    name='CommandoMaths',
    author='John Crickett',
    author_email='john@trivialbusiness.co.uk',
    version='0.1.0.dev',
    packages=find_packages(),
    package_data={'commandomaths': ['resources/*']},
    license='See LICENSE',
    long_description=open('README.md').read(),
    install_requires=["pygame >= 1.9.2a0"
                      ],
    entry_points={
        'console_scripts': [
            'commandomaths=commandomaths.main:main',
        ],
    },
    zip_safe=True,
    include_package_data=True
)


text:
<!DOCTYPE html>

  <meta charset="UTF-8">
  <title>MQBE. JQuery Media Query Breakpoint Events Sample</title>
  <link rel="stylesheet" href="../dist/mqbe.css"/>

Resize your window to test!


text:
namespace g{namespace Android{namespace android{namespace media{struct MediaPlayer;}}}}
namespace g{namespace Android{namespace Fallbacks{struct Android_android_media_MediaPlayerDLROnVideoSizeChangedListener;}}}

namespace g{
namespace Android{
namespace Fallbacks{

// public sealed extern class Android_android_media_MediaPlayerDLROnVideoSizeChangedListener :27832
// {
struct Android_android_media_MediaPlayerDLROnVideoSizeChangedListener_type : ::g::Android::java::lang::Object_type
{
    ::g::Android::android::media::MediaPlayerDLROnVideoSizeChangedListener interface2;
};

Android_android_media_MediaPlayerDLROnVideoSizeChangedListener_type* Android_android_media_MediaPlayerDLROnVideoSizeChangedListener_typeof();
void Android_android_media_MediaPlayerDLROnVideoSizeChangedListener__onVideoSizeChanged_fn(Android_android_media_MediaPlayerDLROnVideoSizeChangedListener* __this, ::g::Android::android::media::MediaPlayer* arg0, int* arg1, int* arg2);
void Android_android_media_MediaPlayerDLROnVideoSizeChangedListener__onVideoSizeChanged_IMPL_9443_fn(bool* arg0_, jobject* arg1_, uObject* arg2_, int* arg3_, int* arg4_);

struct Android_android_media_MediaPlayerDLROnVideoSizeChangedListener : ::g::Android::java::lang::Object
{
    static jmethodID onVideoSizeChanged_9443_ID_;
    static jmethodID& onVideoSizeChanged_9443_ID() { return onVideoSizeChanged_9443_ID_; }

    void onVideoSizeChanged(::g::Android::android::media::MediaPlayer* arg0, int arg1, int arg2);
    static void onVideoSizeChanged_IMPL_9443(bool arg0_, jobject arg1_, uObject* arg2_, int arg3_, int arg4_);
};
// }

}}} // ::g::Android::Fallbacks


text:
package org.jdal.swing.action;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Collection;
import java.util.Vector;

import javax.swing.DefaultComboBoxModel;
import javax.swing.JComboBox;

import org.springframework.beans.BeanWrapper;
import org.springframework.beans.PropertyAccessorFactory;

/**
 * Links two combos by a property name
 *
 * @author Jose Luis Martin - (jlm@joseluismartin.info)
 */
@SuppressWarnings("rawtypes")
public class ComboLinker implements ActionListener {

	private JComboBox primary;
	private JComboBox dependent;
	private String propertyName;

	public ComboLinker(JComboBox<?> primary, JComboBox<?> dependent, String propertyName) {
		this.primary = primary;
		this.dependent = dependent;
		this.propertyName = propertyName;

		primary.addActionListener(this);
	}

	/**
	 * {@inheritDoc}
	 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
	 */

	@SuppressWarnings("unchecked")
	public void actionPerformed(ActionEvent e) {
		Object selected = primary.getSelectedItem();
		if (selected != null) {
			BeanWrapper wrapper = PropertyAccessorFactory.forBeanPropertyAccess(selected);
			Collection<Object> collection = (Collection<Object>) wrapper.getPropertyValue(propertyName);
			DefaultComboBoxModel model = new DefaultComboBoxModel(new Vector<Object>(collection));
			dependent.setModel(model);
		}
	}
}


text:
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { ModalModule } from 'ngx-bootstrap/modal';
import { PopoverModule } from 'ngx-bootstrap/popover';
import { Fabric8WitModule } from 'ngx-fabric8-wit';
import { DependencyCheckService } from 'ngx-launcher';
import { AutofocusModule } from 'ngx-widgets';
import { AppLauncherDependencyCheckService } from '../app-launcher/services/app-launcher-dependency-check.service';
import { CodebasesService } from '../create/codebases/services/codebases.service';
import { AddAppOverlayComponent } from './add-app-overlay.component';

@NgModule({
  imports: [
    AutofocusModule,
    CommonModule,
    Fabric8WitModule,
    FormsModule,
    ModalModule.forRoot(),
    PopoverModule.forRoot(),
  ],
  declarations: [AddAppOverlayComponent],
  exports: [AddAppOverlayComponent],
  providers: [
    CodebasesService,
    { provide: DependencyCheckService, useClass: AppLauncherDependencyCheckService },
  ],
})
export class AddAppOverlayModule {}


text:
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Game.Rulesets.Mania.Objects.Drawables;
using osu.Game.Rulesets.Mania.Skinning.Default;
using osu.Game.Rulesets.Objects.Drawables;
using osuTK.Graphics;

namespace osu.Game.Rulesets.Mania.Skinning.Argon
{
    /// <summary>
    /// Represents length-wise portion of a hold note.
    /// </summary>
    public class ArgonHoldBodyPiece : CompositeDrawable, IHoldNoteBody
    {
        protected readonly Bindable<Color4> AccentColour = new Bindable<Color4>();
        protected readonly IBindable<bool> IsHitting = new Bindable<bool>();

        private Drawable background = null!;
        private Box foreground = null!;

        public ArgonHoldBodyPiece()
        {
            RelativeSizeAxes = Axes.Both;

            // Without this, the width of the body will be slightly larger than the head/tail.
            Masking = true;
            CornerRadius = ArgonNotePiece.CORNER_RADIUS;
            Blending = BlendingParameters.Additive;
        }

        [BackgroundDependencyLoader(true)]
        private void load(DrawableHitObject? drawableObject)
        {
            InternalChildren = new[]
            {
                background = new Box { RelativeSizeAxes = Axes.Both },
                foreground = new Box
                {
                    RelativeSizeAxes = Axes.Both,
                    Blending = BlendingParameters.Additive,
                    Alpha = 0,
                },
            };

            if (drawableObject != null)
            {
                var holdNote = (DrawableHoldNote)drawableObject;

                AccentColour.BindTo(holdNote.AccentColour);
                IsHitting.BindTo(holdNote.IsHitting);
            }

            AccentColour.BindValueChanged(colour =>
            {
                background.Colour = colour.NewValue.Darken(1.2f);
                foreground.Colour = colour.NewValue.Opacity(0.2f);
            }, true);

            IsHitting.BindValueChanged(hitting =>
            {
                const float animation_length = 50;

                foreground.ClearTransforms();

                if (hitting.NewValue)
                {
                    // wait for the next sync point
                    double synchronisedOffset = animation_length * 2 - Time.Current % (animation_length * 2);

                    using (foreground.BeginDelayedSequence(synchronisedOffset))
                    {
                        foreground.FadeTo(1, animation_length).Then()
                                  .FadeTo(0.5f, animation_length)
                                  .Loop();
                    }
                }
                else
                {
                    foreground.FadeOut(animation_length);
                }
            });
        }

        public void Recycle()
        {
            foreground.ClearTransforms();
            foreground.Alpha = 0;
        }
    }
}


text:
import React, {Component, PropTypes} from 'react';
import ClockNumber from './ClockNumber';
import ClockPointer from './ClockPointer';
import {getTouchEventOffsetValues, rad2deg} from './timeUtils';

class ClockMinutes extends Component {
  static propTypes = {
    initialMinutes: PropTypes.number,
    onChange: PropTypes.func,
  };

  static defaultProps = {
    initialMinutes: new Date().getMinutes(),
    onChange: () => {},
  };

  static contextTypes = {
    muiTheme: PropTypes.object.isRequired,
  };

  componentDidMount() {
    const clockElement = this.refs.mask;

    this.center = {
      x: clockElement.offsetWidth / 2,
      y: clockElement.offsetHeight / 2,
    };

    this.basePoint = {
      x: this.center.x,
      y: 0,
    };
  }

  isMousePressed(event) {
    if (typeof event.buttons === 'undefined') {
      return event.nativeEvent.which;
    }
    return event.buttons;
  }

  handleUp = (event) => {
    event.preventDefault();
    this.setClock(event.nativeEvent, true);
  };

  handleMove = (event) => {
    event.preventDefault();
    if (this.isMousePressed(event) !== 1 ) return;
    this.setClock(event.nativeEvent, false);
  };

  handleTouch = (event) => {
    event.preventDefault();
    this.setClock(event.changedTouches[0], false);
  };

  setClock(event, finish) {
    if (typeof event.offsetX === 'undefined') {
      const offset = getTouchEventOffsetValues(event);

      event.offsetX = offset.offsetX;
      event.offsetY = offset.offsetY;
    }

    const minutes = this.getMinutes(event.offsetX, event.offsetY);

    this.props.onChange(minutes, finish);
  }

  getMinutes(offsetX, offsetY) {
    const step = 6;
    const x = offsetX - this.center.x;
    const y = offsetY - this.center.y;
    const cx = this.basePoint.x - this.center.x;
    const cy = this.basePoint.y - this.center.y;

    const atan = Math.atan2(cx, cy) - Math.atan2(x, y);

    let deg = rad2deg(atan);
    deg = Math.round(deg / step ) * step;
    deg %= 360;

    const value = Math.floor(deg / step) || 0;

    return value;
  }

  getMinuteNumbers() {
    const minutes = [];
    for (let i = 0; i < 12; i++) {
      minutes.push(i * 5);
    }
    const selectedMinutes = this.props.initialMinutes;
    let hasSelected = false;

    const numbers = minutes.map((minute) => {
      const isSelected = selectedMinutes === minute;
      if (isSelected) hasSelected = true;
      return (
        <ClockNumber
          key={minute} isSelected={isSelected} type="minute"
          value={minute}
        />
      );
    });

    return {
      numbers: numbers,
      hasSelected: hasSelected,
      selected: selectedMinutes,
    };
  }

  render() {
    const styles = {
      root: {
        height: '100%',
        width: '100%',
        borderRadius: '100%',
        position: 'relative',
        pointerEvents: 'none',
        boxSizing: 'border-box',
      },

      hitMask: {
        height: '100%',
        width: '100%',
        pointerEvents: 'auto',
      },
    };

    const {prepareStyles} = this.context.muiTheme;
    const minutes = this.getMinuteNumbers();

    return (
      <div ref="clock" style={prepareStyles(styles.root)} >
        <ClockPointer value={minutes.selected} type="minute" />
        {minutes.numbers}
        <div
          ref="mask"
          style={prepareStyles(styles.hitMask)}
          hasSelected={minutes.hasSelected}
          onTouchMove={this.handleTouch}
          onTouchEnd={this.handleTouch}
          onMouseUp={this.handleUp}
          onMouseMove={this.handleMove}
        />
      </div>
    );
  }
}

export default ClockMinutes;


text:
package com.marklogic.client.test.example.cookbook;

import static org.junit.Assert.assertTrue;

import java.io.IOException;

import org.junit.Test;

import com.marklogic.client.FailedRequestException;
import com.marklogic.client.ForbiddenUserException;
import com.marklogic.client.ResourceNotFoundException;
import com.marklogic.client.ResourceNotResendableException;
import com.marklogic.client.example.cookbook.DocumentWriteTransform;

public class DocumentWriteTransformTest {
  @Test
  public void testMain()
    throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException, ResourceNotResendableException
  {
    boolean succeeded = false;
    try {
      DocumentWriteTransform.main(new String[0]);
      succeeded = true;
    } catch (IOException e) {
      e.printStackTrace();
    }
    assertTrue("DocumentWriteTransform example failed", succeeded);
  }
}


text:
package org.wso2.carbon.identity.mgt.impl.util;

import java.util.UUID;

/**
 * Identity Management Util.
 */
public class IdentityUserMgtUtil {

    private IdentityUserMgtUtil() {

    }

    /**
     * Generate UUID.
     *
     * @return UUID as a string.
     */
    public static String generateUUID() {

        String random = UUID.randomUUID().toString();
        random = random.replace("/", "_");
        random = random.replace("=", "a");
        random = random.replace("+", "f");
        return random;
    }

}


text:
TaskName
========

_Describe main goal an use cases of the task_

Task reference
--------------

* **Service**: `ClassName`

Accepted inputs
---------------

_Description of allowed types_

Possible outputs
----------------

_Description of possible types_

Options
-------

| Code | Type | Required | Default | Description |
| ---- | ---- | :------: | ------- | ----------- |
| `code` | `type` | **X** _or nothing_ | `default value` _if available_ | _description_ |

Examples
--------

_YAML samples and explanations_

* Example 1
  - details
  - details

```yaml
# Task configuration level
code:
    service: '@service_ref'
    options:
        a: 1
        b: 2
```


text:
package com.github.koraktor.steamcondenser.community;

/**
 * An abstract class implementing basic functionality for classes representing
 * player classes
 *
 * @author Sebastian Staudt
 */
public abstract class GameClass {

    protected String name;

    protected int playTime;

    /**
     * Returns the name of this class
     *
     * @return [String] The name of this class
     */
    public String getName() {
        return this.name;
    }

    /**
     * Returns the time in minutes the player has played with this class
     *
     * @return The time this class has been played
     */
    public int getPlayTime() {
        return this.playTime;
    }

}


text:
package org.openkilda.wfm.topology.flowhs.fsm.common.actions;

import org.openkilda.wfm.topology.flowhs.fsm.common.WithHistorySupportFsm;

import org.squirrelframework.foundation.fsm.AnonymousAction;

public class ReportErrorAction<T extends WithHistorySupportFsm<T, S, E, C>, S, E, C>
        extends AnonymousAction<T, S, E, C> {
    @Override
    public void execute(S from, S to, E event, C context, T stateMachine) {
        stateMachine.reportError(event);
    }
}


text:
This extensions integrates [JMESPath](http://jmespath.org/) with VS Code.

![jpdemo](https://cloud.githubusercontent.com/assets/368057/21634458/500507e6-d20c-11e6-8cdb-db524c41305e.gif)

It adds these commands:

 * `JMESPath: Evaluate Expression` - Evaluate a JMESPath expression against
 the currently opened JSON document and write the result to an output window.
 Open the command palette (shift+cmd+P) and type "JMESPath: Evaluate Expression"
 to use this command.

## Release Notes

### 0.0.3

* Fix bug when user cancels input text

### 0.0.2

* Update misc package metadata

### 0.0.1

* Initial release of jmespath.vscode


text:
require 'rails_helper'

RSpec.describe SubTasksController, :type => :controller do

  let(:valid_attributes) {
    FactoryGirl.create(:sub_task).attributes
  }

  context "when logged out" do

    it "should not be able to create a new task" do
      xhr :post, :create, task_id: valid_attributes['task_id'] , sub_task: valid_attributes
      expect(response.status).to be_equal(302)
    end

    { post: :update, delete: :destroy}.each_pair do |method, action|
      it "should not be able to access #{action}" do
        xhr method, action, task_id: valid_attributes['task_id'] , id: valid_attributes['id']
        expect(response.status).to be_equal(302)
      end
    end

  end

  context "when logged in" do
    login_user_before_each
    let(:valid_attributes) {
      @task = FactoryGirl.create(:task, user_id: @current_user.id)
      FactoryGirl.build(:sub_task, task: @task).attributes
    }

    describe "#create" do
      it "should create a new sub_task for the current user" do
        expect {
          xhr :post, :create, format: :json, task_id: valid_attributes['task_id'], sub_task: valid_attributes
          }.to change(@current_user.sub_tasks, :count).by(1)
      end
    end

    describe "#update" do
      it "should update the sub_task" do
        task = FactoryGirl.create(:task, user_id: @current_user.id)
        sub_task = FactoryGirl.create(:sub_task, task: task)
        xhr :post, :update, format: :json,task_id: sub_task.task_id, id: sub_task.id, sub_task: {body: "New nice body"}
        expect(sub_task.reload.body).to include("New nice body")
      end

    end

    describe "#destroy" do
      it "should destroy the task" do
        task = FactoryGirl.create(:task, user_id: @current_user.id)
        sub_task = FactoryGirl.create(:sub_task, task: task)
        expect {
          xhr :delete, :destroy, format: :json,task_id: sub_task.task_id, id: sub_task.id
          }.to change(@current_user.sub_tasks, :count).by(-1)
      end
    end
  end
end


text:
package ru.andydevs.astraLaserForce.panels;

import ru.andydevs.astraLaserForce.Game;
import ru.andydevs.astraLaserForce.Main;

import javax.swing.*;
import javax.swing.border.Border;
import javax.swing.border.LineBorder;
import java.awt.*;
import java.awt.event.*;

/**
 * StartMenu panel
 */
public class StartMenu extends JPanel {
    private GameButton startGameButton = new GameButton("Start game");
    private GameButton settingsGameButton = new GameButton("Settings");
    private GameButton exitGameButton = new GameButton("Exit game");
    private Image bgImage = new ImageIcon(getClass().getClassLoader().getResource("ru/andydevs/astraLaserForce/bg.png")).getImage();
    private int posX;
    private int posY;
    final private int WIDTH=(int)Game.SCREEN_DIMENSION.getWidth()/3;
    final private int HEIGHT=(int)Game.SCREEN_DIMENSION.getHeight()/2;

    public StartMenu() {
        setLayout(new GridBagLayout());
        GridBagConstraints c = new GridBagConstraints();
        setSize(new Dimension(WIDTH, HEIGHT));
        posX=(int)Game.SCREEN_DIMENSION.getWidth()/2-WIDTH/2;
        posY=(int)Game.SCREEN_DIMENSION.getHeight()/2-HEIGHT/2;
        setBounds(posX, posY,WIDTH,HEIGHT);

        c.ipadx=95;
        c.ipady=15;

        c.fill = GridBagConstraints.HORIZONTAL;
        c.insets = new Insets(20,0,0,0);
        c.gridy=0;
        add(startGameButton, c);

        c.gridy=1;
        c.insets = new Insets(20,0,0,0);
        System.out.println(settingsGameButton.getWidth());
        add(settingsGameButton, c);

        c.gridy=2;
        c.insets = new Insets(20,0,0,0);
        add(exitGameButton, c);

        settingsGameButton.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                Game.container.add(new GameOptionsPanel());
            }
        });

        exitGameButton.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                Main.currentGame.stop();
            }
        });
    }

    public void paintComponent(Graphics g) {
        g.drawImage(bgImage,0,0,WIDTH,HEIGHT,null);
    }

}


text:
SHELL := /bin/bash -euo pipefail
PATH := node_modules/.bin:$(PATH)
MDRIP ?= $(JIRI_ROOT)/third_party/go/bin/mdrip

.DELETE_ON_ERROR:
.DEFAULT_GOAL := all

#############################################################################
# A note about debugging this Makefile
#
# Due to the way testing is managed there is a somewhat complex set of tasks
# and dependencies which can be hard to get a sense of by looking at the
# definitions in this Makefile. Additionally, targets for creating and testing
# shell scripts from tutorial content can take a while to run. Some tips are
# below to help anyone who might need to make edits or additions.
#
# Run a task with make's debug output. This will show information about the
# target being run as well as it's prerequisites and whether make will rebuild
# the target.
#
#     make <target> --debug
#
# Force the target and all prerequisites to build regardless of mtimes:
#
#     make <target> --always-make
#
# Do a dry run, this will spit out what will happen without actually building
# the targets. This is probably helpful for creating new targets with
# complex and/or slow prerequisites.
#
#     make <target> --dry-run
#

#############################################################################
# Tooling and infrastructure

# Find nodejs and add it to PATH.
NODE_BIN := $(shell jiri profile env --profiles=v23:base,v23:nodejs NODE_BIN=)
export PATH := $(NODE_BIN):$(PATH)

# Note, we run npm using 'node npm' to avoid relying
# on the shebang line in the npm script, which can exceed the Linux shebang
# length limit on Jenkins.
npm := node $(NODE_BIN)/npm

# mdrip is a tool for extracting shell scripts from any markdown content which
# might have code blocks in it (like the tutorials). The mdrip tool is also
# capable of running the extracted code in a subshell, simulating a user
# stepping through the tutorials in a step by step fashion.
$(MDRIP):
	jiri go install github.com/monopole/mdrip

#############################################################################
# Variables, functions, and helpers
TMPDIR := $(shell mktemp -d "$${TMPDIR:-/tmp}/XXXXXX")
HEAD := $(shell git rev-parse HEAD)

bundles := public/css public/js/bundle.js
haiku_inputs := $(shell find public/* content/* templates/*)

# A list of case-sensitive banned words.
BANNED_WORDS := Javascript node.js Oauth
.PHONY: banned_words
banned_words:
	@for WORD in $(BANNED_WORDS); do \
		if [ -n '`grep -rn "$$WORD" content templates`' ]; then \
		  echo '`grep -rn "$$WORD" content templates`'; \
		  echo "Found banned word (case-sensitive): $$WORD"; \
		  exit 1; \
		fi \
	done

define BROWSERIFY
	@mkdir -p $(dir $2)
	browserify $1 -d -o $2
endef

#############################################################################
# Variables, functions, and helpers
#
# It's important these are defined above any targets that may depend on them.

install_md = installation/step-by-step.md
install_sh = public/sh/vanadium-install.sh

tutSetup       = tutorials/setup
tutCheckup     = tutorials/checkup
tutCleanup     = tutorials/cleanup
tutWipeSlate   = tutorials/wipe-slate
tutHello       = tutorials/hello-world
tutBasics      = tutorials/basics
tutSyncbaseLocalPersist    = tutorials/syncbase/localPersist
tutSyncbaseSync  = tutorials/syncbase/sync
tutPrincipals  = tutorials/security/principals-and-blessings
tutPermsAuth   = tutorials/security/permissions-authorizer
tutCaveats1st  = tutorials/security/first-party-caveats
tutCaveats3rd  = tutorials/security/third-party-caveats
tutAgent       = tutorials/security/agent
tutCustomAuth  = tutorials/security/custom-authorizer
tutMountTable  = tutorials/naming/mount-table
tutNamespace   = tutorials/naming/namespace
tutSuffixPart1 = tutorials/naming/suffix-part1
tutSuffixPart2 = tutorials/naming/suffix-part2
tutGlobber     = tutorials/naming/globber
tutJavaAndroid = tutorials/java/android
tutJavaFortune = tutorials/java/fortune

syncbaseAndroidQuickstart = syncbase/quickstart
syncbaseAndroidFirstApp   = syncbase/first-app
syncbaseAndroidDataModel  = syncbase/guides/data-model
syncbaseAndroidDataFlow   = syncbase/guides/data-flow
syncbaseAndroidDataSync   = syncbase/guides/synchronization
syncbaseAndroidBatches    = syncbase/guides/batches

# Scripts that 'complete' the named tutorials, creating all relevant files
# (code, credentials, etc.) but skipping ephemeral steps like starting servers,
# running clients, etc. Such scripts need exist only for tutorials that create
# such files.
completer = public/sh/tut-completer
completerScripts = \
	$(completer)-hello-world.sh \
	$(completer)-basics.sh \
	$(completer)-syncbase-local-persist.sh \
	$(completer)-syncbase-sync.sh \
	$(completer)-permissions-authorizer.sh \
	$(completer)-custom-authorizer.sh \
	$(completer)-suffix-part1.sh \
	$(completer)-suffix-part2.sh \
	$(completer)-globber.sh

# Opaquely named copies of particular completer scripts, used to set up
# conditions for later tutorials. See individual targets for more explanation.
scenario = public/sh/scenario
setupScripts = \
	$(install_sh) \
	$(scenario)-a-setup.sh \
	$(scenario)-b-setup.sh \
	$(scenario)-c-setup.sh \
	$(scenario)-d-setup.sh \
	$(scenario)-e-setup.sh \
	$(scenario)-f-setup.sh

depsCommon = \
	content/$(tutSetup).md \
	content/$(tutCheckup).md \
	content/$(tutWipeSlate).md

scripts := $(completerScripts) $(setupScripts)

#############################################################################
# Target definitions

# Silence error output "make: `build' is up to date." for tools like watch by
# adding @true.
.PHONY: all
all: build
	@true

node_modules: package.json
	$(npm) prune
	$(npm) install
	touch $@

# NOTE(sadovsky): Some files under public/{css,js} were copied over from the
# node_modules directory as follows:
# cp node_modules/highlight.js/styles/github.css public/css
# cp node_modules/material-design-lite/material*css* public/css
# cp node_modules/material-design-lite/material*js* public/js

# NOTE(sadovsky): Newer versions of postcss-cli and autoprefixer use JavaScript
# Promises, which doesn't work with Vanadium's old version of node, 0.10.24.

# Generates a compiled css file for every less file in the themes directory.
public/css: $(shell find stylesheets/*) node_modules
	@for FILE in $(shell find stylesheets/themes/* -type f -print0 | xargs -0 -n1 basename) ; do \
		lessc -sm=on stylesheets/themes/$$FILE | postcss -u autoprefixer > $@/bundle.$${FILE%.*}.css ; \
	done
	touch $@

public/js/bundle.js: browser/index.js $(shell find browser) node_modules
	$(call BROWSERIFY,$<,$@)

build: $(bundles) $(scripts) $(haiku_inputs) node_modules | $(MDRIP)
	haiku build --helpers helpers.js --build-dir $@
	@touch $@

################################################################################
# Task definitions, targets without build artifacts.

.PHONY: serve
serve: build
	@static build -H '{"Cache-Control": "no-cache, must-revalidate"}'

# 'entr' can be installed on Debian/Ubuntu using 'apt-get install entr', and on
# OS X using 'brew install entr'.
.PHONY: watch
watch: browser/ content/ public/ stylesheets/ templates/
	@echo "Watching for changes in $^"
	@find $^ | entr $(MAKE) build

################################################################################
# Note: deploy target is automatically triggered by Jenkins by the
# 'vanadium-website-deploy' job after each successful build of the
# 'vanadium-website-site' job.
# If there are any changes, it commits and pushes to the vanadium.github.io
# repository, which is served by GitHub pages.
.PHONY: deploy
deploy: clean build
	git clone git@github.com:vanadium/vanadium.github.io.git $(TMPDIR)
	rm -rf $(TMPDIR)/*
	rsync -r build/* $(TMPDIR)
	cd $(TMPDIR) && \
	git add -A && \
	git diff-index --quiet HEAD || \
	git commit -m "pull $(HEAD)" && \
	git push

.PHONY: clean
clean:
	rm -rf build node_modules public/**/bundle.* public/sh public/tutorials

.PHONY: lint banned_words
lint: banned_words node_modules
	jshint .

################################################################################
# Tutorial script generation and tests

# Vanadium install script.
# This can be run as a prerequisite for tutorial setup.
$(install_sh): content/$(install_md) | $(MDRIP)
	mkdir -p $(@D)
	$(MDRIP) --preambled 3 test $^ > $@

# Targets of the form $(scenario)-{x}-setup.sh create scripts that are meant to
# be run by a user as an argument to 'source', so that they modify the user's
# active environment. They are prerequisite to particular tutorials.
#
# Each script has two sections: a preamble that should run error-free, setting
# env vars and defining shell functions, and a general section that runs as a
# subshell, capable of exiting on error. Error exits from a subshell won't close
# the terminal that issued the 'source' command.
#
# The preamble section is generated from the contents of the first filename
# argument to "$(MDRIP) --preambled". The remaining arguments define the
# subshell code. Code to verify setup and exit if something went wrong should
# appear in the subshell, not in the preamble.
$(scenario)-a-setup.sh: \
	content/$(tutSetup).md \
	content/$(tutCheckup).md | $(MDRIP)
	mkdir -p $(@D)
	$(MDRIP) --preambled 0 completer $^ > $@

# Targets of the from test-{tutorial-name} are meant for interactive use to test
# an individual tutorial and/or extract the code associated with said tutorial.
# The code winds up in $V_TUT/src, where $V_TUT is defined in tutSetup.

depsHello = $(depsCommon) content/$(tutHello).md
.PHONY: test-hello-world
test-hello-world: $(depsHello) | $(MDRIP)
	$(MDRIP) --subshell test $^
$(completer)-hello-world.sh: $(depsHello) | $(MDRIP)
	mkdir -p $(@D)
	$(MDRIP) --preambled 0 completer $^ > $@

depsBasics = $(depsCommon) content/$(tutBasics).md
.PHONY: test-basics
test-basics: $(depsBasics) | $(MDRIP)
	$(MDRIP) --subshell test $^
$(completer)-basics.sh: $(depsBasics) | $(MDRIP)
	mkdir -p $(@D)
	$(MDRIP) --preambled 0 completer $^ > $@
$(scenario)-b-setup.sh: $(completer)-basics.sh
	cp $^ $@

depsSyncbaseLocalPersist = $(depsBasics) content/$(tutSyncbaseLocalPersist).md
.PHONY: test-syncbase-local-persist
test-syncbase-local-persist: $(depsSyncbaseLocalPersist) | $(MDRIP)
	$(MDRIP) --subshell test $^
$(completer)-syncbase-local-persist.sh: $(depsSyncbaseLocalPersist) | $(MDRIP)
	mkdir -p $(@D)
	$(MDRIP) --preambled 0 completer $^ > $@
$(scenario)-f-setup.sh: $(completer)-syncbase-local-persist.sh
	cp $^ $@

depsSyncbaseSync = $(depsSyncbaseLocalPersist) content/$(tutSyncbaseSync).md
.PHONY: test-syncbase-sync
test-syncbase-sync: $(depsSyncbaseSync) | $(MDRIP)
	$(MDRIP) --subshell test $^
$(completer)-syncbase-sync.sh: $(depsSyncbaseSync) | $(MDRIP)
	mkdir -p $(@D)
	$(MDRIP) --preambled 0 completer $^ > $@

depsPrincipals = $(depsBasics) content/$(tutPrincipals).md
.PHONY: test-principals
test-principals: $(depsPrincipals) | $(MDRIP)
	$(MDRIP) --subshell test $^
$(scenario)-c-setup.sh: $(depsPrincipals) | $(MDRIP)
	mkdir -p $(@D)
	$(MDRIP) --preambled 0 completer $^ > $@

depsPermsAuth = $(depsPrincipals) content/$(tutPermsAuth).md
.PHONY: test-permissions-authorizer
test-permissions-authorizer: $(depsPermsAuth) | $(MDRIP)
	$(MDRIP) --subshell test $^
$(completer)-permissions-authorizer.sh: $(depsPermsAuth) | $(MDRIP)
	mkdir -p $(@D)
	$(MDRIP) --preambled 0 completer $^ > $@
$(scenario)-d-setup.sh: $(completer)-permissions-authorizer.sh
	cp $^ $@

depsMultiDisp = $(depsPermsAuth) content/$(tutSuffixPart1).md
.PHONY: test-multiservice-dispatcher
test-multiservice-dispatcher: $(depsMultiDisp) | $(MDRIP)
	$(MDRIP) --subshell test $^
$(completer)-multiservice-dispatcher.sh: $(depsMultiDisp) | $(MDRIP)
	mkdir -p $(@D)
	$(MDRIP) --preambled 0 completer $^ > $@
$(scenario)-e-setup.sh: $(completer)-multiservice-dispatcher.sh
	cp $^ $@

depsCaveats1st = $(depsPermsAuth) content/$(tutCaveats1st).md
.PHONY: test-caveats-1st
test-caveats-1st: $(depsCaveats1st) | $(MDRIP)
	$(MDRIP) --subshell test $^

depsCaveats3rd = $(depsPermsAuth) content/$(tutCaveats3rd).md
.PHONY: test-caveats-3rd
test-caveats-3rd: $(depsCaveats3rd) | $(MDRIP)
	$(MDRIP) --subshell test $^

depsAgent = $(depsPermsAuth) content/$(tutAgent).md
.PHONY: test-agent
test-agent: $(depsAgent) | $(MDRIP)
	$(MDRIP) --subshell test $^

depsCustomAuth = $(depsPermsAuth) content/$(tutCustomAuth).md
.PHONY: test-custom-auth
test-custom-auth: $(depsCustomAuth) | $(MDRIP)
	$(MDRIP) --subshell test $^
$(completer)-custom-authorizer.sh: $(depsCustomAuth) | $(MDRIP)
	mkdir -p $(@D)
	$(MDRIP) --preambled 0 completer $^ > $@

depsMountTable = $(depsBasics) content/$(tutMountTable).md
.PHONY: test-mount-table
test-mount-table: $(depsMountTable) | $(MDRIP)
	$(MDRIP) --subshell test $^

depsNamespace = $(depsBasics) content/$(tutNamespace).md
.PHONY: test-namespace
test-namespace: $(depsNamespace) | $(MDRIP)
	$(MDRIP) --subshell test $^

depsSuffixPart1 = $(depsBasics) content/$(tutSuffixPart1).md
.PHONY: test-suffix-part1
test-suffix-part1: $(depsSuffixPart1) | $(MDRIP)
	$(MDRIP) --subshell test $^
$(completer)-suffix-part1.sh: $(depsSuffixPart1) | $(MDRIP)
	mkdir -p $(@D)
	$(MDRIP) --preambled 0 completer $^ > $@

depsSuffixPart2 = $(depsMultiDisp) content/$(tutSuffixPart2).md
.PHONY: test-suffix-part2
test-suffix-part2: $(depsSuffixPart2) | $(MDRIP)
	$(MDRIP) --subshell test $^
$(completer)-suffix-part2.sh: $(depsSuffixPart2) | $(MDRIP)
	mkdir -p $(@D)
	$(MDRIP) --preambled 0 completer $^ > $@

depsGlobber = $(depsMultiDisp) content/$(tutGlobber).md
.PHONY: test-globber
test-globber: $(depsGlobber) | $(MDRIP)
	$(MDRIP) --subshell test $^
$(completer)-globber.sh: $(depsGlobber) | $(MDRIP)
	mkdir -p $(@D)
	$(MDRIP) --preambled 0 completer $^ > $@

# An ordering that lets us test all the tutorials faster than running the
# individual tests in sequence. This exploits the knowledge that, for example,
# tutCaveats3rd can be tested right after tutCaveats1st without reseting to a
# clean slate. WipeSlate and Basics are done where needed to reset state.
depsOneBigCoreTutorialTest = \
	content/$(tutSetup).md \
	content/$(tutCheckup).md \
	content/$(tutWipeSlate).md \
	content/$(tutHello).md \
	content/$(tutBasics).md \
	content/$(tutPrincipals).md \
	content/$(tutPermsAuth).md \
	content/$(tutCaveats1st).md \
	content/$(tutCaveats3rd).md \
	content/$(tutAgent).md \
	content/$(tutCustomAuth).md \
	content/$(tutWipeSlate).md \
	content/$(tutBasics).md \
	content/$(tutMountTable).md \
	content/$(tutNamespace).md \
	content/$(tutWipeSlate).md \
	content/$(tutBasics).md \
	content/$(tutPrincipals).md \
	content/$(tutPermsAuth).md \
	content/$(tutSuffixPart1).md \
	content/$(tutSuffixPart2).md \
	content/$(tutWipeSlate).md \
	content/$(tutBasics).md \
	content/$(tutSyncbaseLocalPersist).md \
	content/$(tutSyncbaseSync).md \

# An ordering that lets us test all the Java tutorials faster than running the
# individual tests in sequence.
# depsOneBigSyncbaseAndroidTest = content/$(syncbaseAndroidDataSync).md
depsOneBigSyncbaseAndroidTest = \
	content/$(syncbaseAndroidQuickstart).md \
	content/$(syncbaseAndroidFirstApp).md \
	content/$(syncbaseAndroidDataModel).md \
	content/$(syncbaseAndroidDataFlow).md \
	content/$(syncbaseAndroidDataSync).md \
	content/$(syncbaseAndroidBatches).md

.PHONY: test
test: test-site test-tutorials-core test-tutorials-java test-syncbase-android

.PHONY: test-site
test-site: build node_modules
	tape test/test-*.js

# Test core tutorials against an existing development install.
#
# This is the target to run to see if the tutorials work against Vanadium
# changes that have not been checked in.
#
# Called from v.io/x/devtools/jiri-test/internal/test/website.go.
# This test fails if JIRI_ROOT isn't defined.
# This test defines V_TUT (a tutorial variable) appropriately in terms of
# JIRI_ROOT.
.PHONY: test-tutorials-core
test-tutorials-core: build
	jiri go install v.io/v23/... v.io/x/ref/...
	$(MDRIP) --subshell --blockTimeOut 1m test content/testing.md $(depsOneBigCoreTutorialTest)

# Test Java tutorials.
.PHONY: test-tutorials-java
test-tutorials-java: build
	$(MDRIP) --blockTimeOut 5m --subshell test $(depsOneBigJavaTutorialTest)

# Test Syncbase quickstart, guides and tutorials for Android.
# Called from v.io/x/devtools/jiri-test/internal/test/website.go.
test-syncbase-android: build
	$(MDRIP) --blockTimeOut 15m --subshell test $(depsOneBigSyncbaseAndroidTest)

# Test tutorials against fresh external install.
#
# This runs an install from v.io, then runs the tutorials against that install,
# exactly as an external user would run them. Local changes of Vanadium have no
# impact on this test. This test does not require definition of JIRI_ROOT; it
# uses VANADIUM_RELEASE instead, per the installation instructions on the external
# site.
ext_tut_jiri_root := ~/tutorial-install
.PHONY: test-tutorials-external
test-tutorials-external: build
	rm -rf $(ext_tut_jiri_root)
	JIRI_ROOT=$(ext_tut_jiri_root) $(MDRIP) --subshell --blockTimeOut 10m test content/$(install_md) $(depsOneBigCoreTutorialTest)

# Test tutorials without install. Assumes JIRI_ROOT and VANADIUM_RELEASE are defined.
#
# This runs tests without first doing any installation step, and assumes
# JIRI_ROOT and VANADIUM_RELEASE are properly defined. It's a time saver if you are
# happy with your installation and are just debugging tutorial code.
.PHONY: test-tutorials-no-install
test-tutorials-no-install: build
	$(MDRIP) --subshell test $(depsOneBigCoreTutorialTest)

# Used to upgrade all occurrences of
# dependencies {
#  compile 'io.v:syncbase:<version>'
# }
# to the constant $SYNCBASE_ANDROID_VERSION defined below.
#
# This target should be used as part of the release process to update
# the website to the stable release of Syncbase Android.
#
# Please run the `test-syncbase-android` after upgrade and fix
# any breaking API changes in the tutorials and code snippets before
# committing and submitting the changes.
#
# Example flow:
#
# # Change SYNCBASE_ANDROID_VERSION to the newest version.
# make upgrade-syncbase-android
# make test-syncbase-android
# git stage .
# git commit -m "Upgrading Syncbase Android Version"
# jiri cl mail
.PHONY: upgrade-syncbase-android
# Change this to the desired version before running the target.
SYNCBASE_ANDROID_VERSION=0.1.7
upgrade-syncbase-android:
	find content/syncbase -type f -exec sed -i "s/\(compile 'io.v:syncbase:\)\(.*\)'/\1$(SYNCBASE_ANDROID_VERSION)'/g" {} \;


text:
package org.keycloak.testsuite.auth.page.login;

import org.jboss.arquillian.graphene.page.Page;
import org.keycloak.representations.idm.UserRepresentation;
import org.keycloak.testsuite.page.Form;
import static org.keycloak.testsuite.admin.Users.getPasswordOf;
import org.keycloak.testsuite.auth.page.account.AccountFields;
import org.keycloak.testsuite.auth.page.account.PasswordFields;
import static org.keycloak.testsuite.util.WaitUtils.*;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;

/**
 *
 * @author tkyjovsk
 */
public class LoginForm extends Form {

    @Page
    private AccountFields accountFields;
    @Page
    private PasswordFields passwordFields;

    @FindBy(name = "login")
    private WebElement loginButton;
//    @FindBy(name = "cancel")
//    private WebElement cancelButton;

    @FindBy(xpath = "//div[@id='kc-registration']/span/a")
    private WebElement registerLink;
    @FindBy(linkText = "Forgot Password?")
    private WebElement forgottenPassword;
    @FindBy(id = "rememberMe")
    private WebElement rememberMe;

    public void setUsername(String username) {
        accountFields.setUsername(username);
    }

    public void setPassword(String password) {
        passwordFields.setPassword(password);
    }

    public void login(UserRepresentation user) {
        login(user.getUsername(), getPasswordOf(user));
    }

    public void login(String username, String password) {
        setUsername(username);
        setPassword(password);
        login();
    }

    public void register() {
        waitForUsernameInputPresent();
        waitUntilElement(registerLink).is().present();
        registerLink.click();
    }

    public void login() {
        waitUntilElement(loginButton).is().present();
        loginButton.click();
    }

    public void forgotPassword() {
        waitUntilElement(forgottenPassword).is().present();
        forgottenPassword.click();
    }

    public void rememberMe(boolean value) {
        waitForRememberMePresent();
        boolean selected = rememberMe.isSelected();
        if ((value && !selected) || !value && selected) {
            rememberMe.click();
        }
    }

//    @Override
//    public void cancel() {
//        waitUntilElement(cancelButton).is().present();
//        cancelButton.click();
//    }
    public void waitForUsernameInputPresent() {
        accountFields.waitForUsernameInputPresent();
    }

    public void waitForRegisterLinkNotPresent() {
        waitUntilElement(registerLink).is().not().present();
    }

    public void waitForResetPasswordLinkNotPresent() {
        waitUntilElement(forgottenPassword).is().not().present();
    }

    public void waitForRememberMePresent() {
        waitUntilElement(rememberMe).is().present();
    }

    public void waitForRememberMeNotPresent() {
        waitUntilElement(rememberMe).is().not().present();
    }

    public void waitForLoginButtonPresent() {
        waitUntilElement(loginButton).is().present();
    }

}


text:
title:  Studiehjälp
date:  04/09/2020
---

För en del år sedan beslöt en liten europeisk församling utanför en av kontinentens viktigaste städer att den ville göra något betydelsefullt för Herren. Församlingen hade stagnerat. Man hade inte haft några dop på många år. Om den nuvarande trenden fortsatte skulle församlingen knappast ha någon framtid. Pastorn och hans församlingsstyrelse bad intensivt och övervägde noga vad de kunde göra.

När de studerade Nya testamentet beslöt de sig för att starta en smågruppsverksamhet. Nio församlingsmedlemmar fångades av visionen. De gick in för att tillsammans be och studera hur de effektivt skulle starta sin smågruppsverksamhet. Snart beslöt de sig för att göra sina hem till evangelisationscentrum. Grupperna lärde sig att utöva sina gåvor på olika sätt. De startade böne- och omsorgsgrupper. De skapade vänskapsrelationer i sin omgivning. Genom vänskapliga handlingar sökte de kontakt med sina familjer, vänner och före detta adventister. Smågruppsledarna startade bibelstudier i nio hem med fyrtio besökare. De var förundrade över vad den heliga Anden gjorde. Till slut döptes sjutton av de fyrtio som kom. Vittnesbördet från den där lilla, stagnerade församlingen är att smågrupper gör en enorm skillnad. De är ett av Guds redskap för att engagera många församlingsmedlemmar i församlingens mission.

**Samtalsstart**

Vad tycker ni är fördelarna med att sitta som nu och samtala i en liten grupp?

**Förbön**

Be gärna om hur ni ska få uppleva mer av den smågruppsdynamik som studiet beskriver.

**Samtalsfrågor**

Finns på nästa sida

**Samtalsfrågor**

`1. 	Samtala i studiegruppen om de viktigaste inslagen i varje smågrupp som de presenteras i torsdagens studium. Vilka andra sorters verksamheter skulle en smågrupp kunna ägna sig åt? På vilka sätt kan en smågrupp hjälpa dem som har speciella gåvor att verkligen kunna använda dem som aldrig förr?`

`2. 	Varför är det så viktigt att en smågrupp håller inriktningen mot utåtriktad mission? Det vill säga: hur mycket en grupp än kan ge näring och stöd till sina medlemmar, varför behöver den alltid hålla i centrum sitt syfte att sprida evangelium? Varför är det så viktigt att en smågrupp också alltid är knuten till den lokala församlingskroppen?`

`3. 	Har du någonsin varit med eller hört om en smågrupp som inte fungerade effektivt utan till slut dog ut? Samtala om orsaker till att sådant kan hända.`

`4. 	Tänk på berättelsen tidigare om vad som hände i Europa med en smågruppsverksamhet. Varför tror du att det fungerade så bra? Vad gjorde de som på många sätt var så enkelt men ändå så effektivt? Varför kan det vara ett effektivare sätt att utgå från "tryggare" hemmiljöer, i motsats till en kyrkobyggnad, när vi börjar utåtriktad verksamhet i grannskapet eller i samhället?`


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace console
{
    public class _028_FindKthElement
    {

        /// <summary>
        /// Find the Kth element of an un sorted integer array.
        /// </summary>
        /// <param name="input">the array</param>
        /// <returns>the kth element</returns>
        public int FindKthElement(int[] input, int k)
        {
            if (input == null ||input.Length < k) return -1;
            return FindKthElement(input, 0, input.Length-1,k);
        }

        /// <summary>
        /// Worker method of find keht element.
        /// </summary>
        /// <param name="input"></param>
        /// <param name="start"></param>
        /// <param name="end"></param>
        /// <returns></returns>
        public int FindKthElement(int[] input, int start, int end, int k)
        {
            int tmp = start;
            int left = start;
            int right = end;

            while (start < end)
            {
                while (start < end && input[start] <= input[tmp]) start++;
                while (start < end && input[end] >= input[tmp]) end--;
                Swap(input, start, end);
                start++;
                end--;
            }

            if (end+1 == k) return input[tmp];
            else
            {
                Swap(input, tmp, end);
                if (end > k)
                {
                    return FindKthElement(input, left, end-1, k);
                }
                else
                {
                    return FindKthElement(input, end + 1, right, k);
                }
            }
        }

        /// <summary>
        /// swap 2 elements in a int array.
        /// </summary>
        /// <param name="input"></param>
        /// <param name="index1"></param>
        /// <param name="index2"></param>
        public void Swap(int[] input, int index1, int index2)
        {
            int tmp = input[index1];
            input[index1] = input[index2];
            input[index2] = tmp;
        }
    }
}


text:
require 'spec_helper'

try_spec do
  describe DataMapper::Property::StringArray do
    supported_by :all do
      before :all do
        class User
          include DataMapper::Resource
          property :id, Serial
          property :things, StringArray, :length => 10
        end

        @property = User.properties[:things]
      end

      describe '.load' do
        describe "argument is a string that is a string array" do
          before :all do
            @input = '{"10.1","2.3","4","5","6"}'
            @result = @property.load(@input)
          end

          it "parses the input into an array" do
            @result.should == ['10.1','2.3','4','5','6']
          end
        end
      end

      describe ".dump" do
        before :all do
          @input = ['foo','bar','baz','quux','foo,bar']
          @result = @property.dump(@input)
        end

        describe "when argument is an Array" do
          it "should result in a postgres array string" do
            @result.should == '{foo,bar,baz,quux,"foo,bar"}'
          end
        end
      end
    end
  end
end


text:
package org.apache.hadoop.mapreduce.lib.chain;

import java.io.IOException;
import java.net.URI;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.conf.Configuration.IntegerRanges;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.RawComparator;
import org.apache.hadoop.mapreduce.Counter;
import org.apache.hadoop.mapreduce.InputFormat;
import org.apache.hadoop.mapreduce.InputSplit;
import org.apache.hadoop.mapreduce.JobID;
import org.apache.hadoop.mapreduce.MapContext;
import org.apache.hadoop.mapreduce.Mapper;
import org.apache.hadoop.mapreduce.OutputCommitter;
import org.apache.hadoop.mapreduce.OutputFormat;
import org.apache.hadoop.mapreduce.Partitioner;
import org.apache.hadoop.mapreduce.RecordReader;
import org.apache.hadoop.mapreduce.RecordWriter;
import org.apache.hadoop.mapreduce.Reducer;
import org.apache.hadoop.mapreduce.TaskAttemptID;
import org.apache.hadoop.mapreduce.TaskInputOutputContext;
import org.apache.hadoop.security.Credentials;

/**
 * A simple wrapper class that delegates most of its functionality to the
 * underlying context, but overrides the methods to do with record readers ,
 * record writers and configuration.
 */
class ChainMapContextImpl<KEYIN, VALUEIN, KEYOUT, VALUEOUT> implements
    MapContext<KEYIN, VALUEIN, KEYOUT, VALUEOUT> {

  private RecordReader<KEYIN, VALUEIN> reader;
  private RecordWriter<KEYOUT, VALUEOUT> output;
  private TaskInputOutputContext<KEYIN, VALUEIN, KEYOUT, VALUEOUT> base;
  private Configuration conf;

  ChainMapContextImpl(
      TaskInputOutputContext<KEYIN, VALUEIN, KEYOUT, VALUEOUT> base,
      RecordReader<KEYIN, VALUEIN> rr, RecordWriter<KEYOUT, VALUEOUT> rw,
      Configuration conf) {
    this.reader = rr;
    this.output = rw;
    this.base = base;
    this.conf = conf;
  }

  @Override
  public KEYIN getCurrentKey() throws IOException, InterruptedException {
    return reader.getCurrentKey();
  }

  @Override
  public VALUEIN getCurrentValue() throws IOException, InterruptedException {
    return reader.getCurrentValue();
  }

  @Override
  public boolean nextKeyValue() throws IOException, InterruptedException {
    return reader.nextKeyValue();
  }

  @Override
  public InputSplit getInputSplit() {
    if (base instanceof MapContext) {
      MapContext<KEYIN, VALUEIN, KEYOUT, VALUEOUT> mc =
        (MapContext<KEYIN, VALUEIN, KEYOUT, VALUEOUT>) base;
      return mc.getInputSplit();
    } else {
      return null;
    }
  }

  @Override
  public Counter getCounter(Enum<?> counterName) {
    return base.getCounter(counterName);
  }

  @Override
  public Counter getCounter(String groupName, String counterName) {
    return base.getCounter(groupName, counterName);
  }

  @Override
  public OutputCommitter getOutputCommitter() {
    return base.getOutputCommitter();
  }

  @Override
  public void write(KEYOUT key, VALUEOUT value) throws IOException,
      InterruptedException {
    output.write(key, value);
  }

  @Override
  public String getStatus() {
    return base.getStatus();
  }

  @Override
  public TaskAttemptID getTaskAttemptID() {
    return base.getTaskAttemptID();
  }

  @Override
  public void setStatus(String msg) {
    base.setStatus(msg);
  }

  @Override
  public Path[] getArchiveClassPaths() {
    return base.getArchiveClassPaths();
  }

  @Override
  public String[] getArchiveTimestamps() {
    return base.getArchiveTimestamps();
  }

  @Override
  public URI[] getCacheArchives() throws IOException {
    return base.getCacheArchives();
  }

  @Override
  public URI[] getCacheFiles() throws IOException {
    return base.getCacheFiles();
  }

  @Override
  public Class<? extends Reducer<?, ?, ?, ?>> getCombinerClass()
      throws ClassNotFoundException {
    return base.getCombinerClass();
  }

  @Override
  public Configuration getConfiguration() {
    return conf;
  }

  @Override
  public Path[] getFileClassPaths() {
    return base.getFileClassPaths();
  }

  @Override
  public String[] getFileTimestamps() {
    return base.getFileTimestamps();
  }

  @Override
  public RawComparator<?> getCombinerKeyGroupingComparator() {
    return base.getCombinerKeyGroupingComparator();
  }

  @Override
  public RawComparator<?> getGroupingComparator() {
    return base.getGroupingComparator();
  }

  @Override
  public Class<? extends InputFormat<?, ?>> getInputFormatClass()
      throws ClassNotFoundException {
    return base.getInputFormatClass();
  }

  @Override
  public String getJar() {
    return base.getJar();
  }

  @Override
  public JobID getJobID() {
    return base.getJobID();
  }

  @Override
  public String getJobName() {
    return base.getJobName();
  }

  @Override
  public boolean userClassesTakesPrecedence() {
    return base.userClassesTakesPrecedence();
  }

  @Override
  public boolean getJobSetupCleanupNeeded() {
    return base.getJobSetupCleanupNeeded();
  }

  @Override
  public boolean getTaskCleanupNeeded() {
    return base.getTaskCleanupNeeded();
  }

  @Override
  public Path[] getLocalCacheArchives() throws IOException {
    return base.getLocalCacheArchives();
  }

  @Override
  public Path[] getLocalCacheFiles() throws IOException {
    return base.getLocalCacheArchives();
  }

  @Override
  public Class<?> getMapOutputKeyClass() {
    return base.getMapOutputKeyClass();
  }

  @Override
  public Class<?> getMapOutputValueClass() {
    return base.getMapOutputValueClass();
  }

  @Override
  public Class<? extends Mapper<?, ?, ?, ?>> getMapperClass()
      throws ClassNotFoundException {
    return base.getMapperClass();
  }

  @Override
  public int getMaxMapAttempts() {
    return base.getMaxMapAttempts();
  }

  @Override
  public int getMaxReduceAttempts() {
    return base.getMaxReduceAttempts();
  }

  @Override
  public int getNumReduceTasks() {
    return base.getNumReduceTasks();
  }

  @Override
  public Class<? extends OutputFormat<?, ?>> getOutputFormatClass()
      throws ClassNotFoundException {
    return base.getOutputFormatClass();
  }

  @Override
  public Class<?> getOutputKeyClass() {
    return base.getMapOutputKeyClass();
  }

  @Override
  public Class<?> getOutputValueClass() {
    return base.getOutputValueClass();
  }

  @Override
  public Class<? extends Partitioner<?, ?>> getPartitionerClass()
      throws ClassNotFoundException {
    return base.getPartitionerClass();
  }

  @Override
  public boolean getProfileEnabled() {
    return base.getProfileEnabled();
  }

  @Override
  public String getProfileParams() {
    return base.getProfileParams();
  }

  @Override
  public IntegerRanges getProfileTaskRange(boolean isMap) {
    return base.getProfileTaskRange(isMap);
  }

  @Override
  public Class<? extends Reducer<?, ?, ?, ?>> getReducerClass()
      throws ClassNotFoundException {
    return base.getReducerClass();
  }

  @Override
  public RawComparator<?> getSortComparator() {
    return base.getSortComparator();
  }

  @Override
  public boolean getSymlink() {
    return base.getSymlink();
  }

  @Override
  public String getUser() {
    return base.getUser();
  }

  @Override
  public Path getWorkingDirectory() throws IOException {
    return base.getWorkingDirectory();
  }

  @Override
  public void progress() {
    base.progress();
  }

  @Override
  public Credentials getCredentials() {
    return base.getCredentials();
  }

  @Override
  public float getProgress() {
    return base.getProgress();
  }
}


text:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.skysport.inerfaces.mapper.material.MembraneThicknessDao">
    <sql id="searchInfoSql">
		id AS id,
		mt_id AS natrualkey,
		mt_name AS name,
		del_flag AS delFlag,
		update_time AS updateTime,
		remark AS remark
	</sql>
    <select id="queryInfo" resultType="MembraneThicknessInfo">
        select
        <include refid="searchInfoSql"/>
        FROM t_wl_membrane_thickness
        WHERE mt_id =#{natrualkey}
        limit 1
    </select>

    <select id="listInfosCounts" resultType="Integer">
        SELECT COUNT(*) FROM
        t_wl_membrane_thickness where del_flag=0
    </select>

    <select id="listFilteredInfosCounts" resultType="Integer">
        SELECT COUNT(*) FROM t_wl_membrane_thickness where del_flag=0
        <if test="searchValue !=null and searchValue != ''">
            and (
            mt_name like concat('%',#{searchValue},'%') or
            remark like concat('%',#{searchValue},'%')
            )
        </if>

    </select>

    <select id="searchInfos" resultType="MembraneThicknessInfo">
        SELECT
        <include refid="searchInfoSql"/>
        FROM t_wl_membrane_thickness
        WHERE del_flag=0
        <if test="searchValue!=null and searchValue != ''">
            and (
            mt_name like concat('%',#{searchValue},'%') or
            remark like concat('%',#{searchValue},'%')
            )
        </if>
        <if test="orderColumn!=null and orderColumn != ''">
            ORDER BY ${orderColumn} ${orderDir}
        </if>
        limit #{start} ,#{length}

    </select>

    <update id="updateInfo">
        update t_wl_membrane_thickness 	set
        mt_name=#{name},
        remark=#{remark}
        WHERE mt_id =#{natrualkey}
    </update>

    <insert id="add">
        insert into
        t_wl_membrane_thickness (mt_id,mt_name,remark)
        values (#{natrualkey},#{name},#{remark})
    </insert>

    <update id="del">
        update t_wl_membrane_thickness
        set  del_flag=1
        where mt_id =#{natrualkey}
    </update>

    <select id="queryCurrentSeqNo" resultType="String">
        select case when  max(mt_id) is NULL then 0 else max(mt_id) end from t_wl_membrane_thickness
    </select>

    <!--信息下拉列表-->
    <select id="querySelectList" resultType="CommonBean">
		select
			mt_id AS natrualkey,
			mt_name AS name
		from t_wl_membrane_thickness
		where del_flag=0
        <if test="name!=null and name != ''">
            and upper(mt_name) like concat('%',#{name},'%')
        </if>
	</select>

</mapper>


text:
unsigned int elf_validate(struct elf_header *header)
{

    unsigned char id[] = {ELF_IDENTITY_MAGIC0, ELF_IDENTITY_MAGIC1, ELF_IDENTITY_MAGIC2, ELF_IDENTITY_MAGIC3};

    return buffer_match(header->identify, id, 4);

}


text:
package com.google.cloud.sqlcommenter.spring.backend.service;

import com.google.cloud.sqlcommenter.spring.backend.dao.PostRepository;
import com.google.cloud.sqlcommenter.spring.backend.dao.TagRepository;
import com.google.cloud.sqlcommenter.spring.backend.domain.Post;
import java.util.Arrays;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class ForumServiceImpl implements ForumService {

  @Autowired private PostRepository postRepository;

  @Autowired private TagRepository tagRepository;

  @Override
  @Transactional
  public Post newPost(String title, String... tags) {
    Post post = new Post();
    post.setTitle(title);
    post.getTags().addAll(tagRepository.findByNameIn(Arrays.asList(tags)));
    return postRepository.save(post);
  }

  @Override
  @Transactional(readOnly = true)
  public List<Post> findAllByTitle(String title) {
    return postRepository.findByTitle(title);
  }

  @Override
  @Transactional
  public Post findById(Long id) {
    return postRepository.findById(id).orElse(null);
  }
}


text:
module.exports = function(config) {
    var configuration = {
        basePath: '',
        frameworks: [
            'jasmine',
            'jasmine-matchers'
        ],
        files: [
            'test/*-spec.js'
        ],
        preprocessors: {
            'test/*-spec.js': ['webpack', 'sourcemap']
        },
        webpack: {
            devtool: 'inline-source-map'
        },
        webpackMiddleware: {
            noInfo: true
        },
        reporters: ['mocha'],
        port: 9876,
        colors: true,
        logLevel: config.LOG_INFO,
        autoWatch: true,
        browsers: ['Chrome'],
        singleRun: false,
        concurrency: Infinity,
        plugins: [
            require('karma-webpack'),
            require('karma-sourcemap-loader'),
            'karma-jasmine',
            'karma-jasmine-matchers',
            'karma-mocha-reporter',
            'karma-chrome-launcher'
        ]
    };
    config.set(configuration);
};


text:
package net.gini.jersey.security.smime;

import javax.ws.rs.core.MediaType;

/**
 * @author Bill Burke
 * @version $Revision: 1 $
 */
public class EnvelopedOutput extends SMIMEOutput {
    public EnvelopedOutput(Object obj, String mediaType) {
        super(obj, mediaType);
    }

    public EnvelopedOutput(Object obj, MediaType mediaType) {
        super(obj, mediaType);
    }
}


text:
import { bindActionCreators } from "redux"
import { Dispatch } from "redux"
import { dispatch } from "./"

import * as actions from "./internal-actions"

const boundActions = bindActionCreators<typeof actions, any>(
  actions,
  dispatch as any as Dispatch
)

export const createLog = boundActions.createLog as typeof actions.createLog
export const createPendingActivity =
  boundActions.createPendingActivity as typeof actions.createPendingActivity
export const setStatus = boundActions.setStatus as typeof actions.setStatus
export const startActivity =
  boundActions.startActivity as typeof actions.startActivity
export const endActivity =
  boundActions.endActivity as typeof actions.endActivity
export const updateActivity =
  boundActions.updateActivity as typeof actions.updateActivity
export const setActivityErrored =
  boundActions.setActivityErrored as typeof actions.setActivityErrored
export const setActivityStatusText =
  boundActions.setActivityStatusText as typeof actions.setActivityStatusText
export const setActivityTotal =
  boundActions.setActivityTotal as typeof actions.setActivityTotal
export const activityTick =
  boundActions.activityTick as typeof actions.activityTick
export const renderPageTree =
  boundActions.renderPageTree as typeof actions.renderPageTree


text:
  Belleray est
       un village
       localisé dans le département de Meuse en Lorraine. Elle comptait 423 habitants en 2008.

Si vous envisagez de demenager à Belleray, vous pourrez facilement trouver une maison à acheter.

La ville propose quelques  aménagements, elle dispose, entre autres, de un terrain de sport et deux boucles de randonnée.

Le nombre d'habitations, à Belleray, était réparti en 2011 en deux appartements et 202 maisons soit
 un marché plutôt équilibré.

À proximité de Belleray sont localisées les villes de
Dieue-sur-Meuse localisée à 7 km, 1 382 habitants,
Moulainville située à 7 km, 112 habitants,
Ancemont localisée à 6 km, 571 habitants,
Landrecourt-Lempire située à 5 km, 207 habitants,
Thierville-sur-Meuse à 5 km, 3 192 habitants,
Belrupt-en-Verdunois située à 3 km, 442 habitants,
 entre autres. De plus, Belleray est située à seulement trois km de Verdun.


text:
from openstack_dashboard.test.integration_tests import decorators
from openstack_dashboard.test.integration_tests import helpers
from openstack_dashboard.test.integration_tests.regions import messages

class TestKeypair(helpers.TestCase):
    """Checks that the user is able to create/delete keypair."""
    KEYPAIR_NAME = helpers.gen_random_resource_name("keypair")

    @decorators.skip_because(bugs=['1774697'])
    def test_keypair(self):
        keypair_page = self.home_pg.\
            go_to_project_compute_keypairspage()
        keypair_page.create_keypair(self.KEYPAIR_NAME)
        self.assertFalse(keypair_page.find_message_and_dismiss(messages.ERROR))

        keypair_page = self.home_pg.\
            go_to_project_compute_keypairspage()
        self.assertTrue(keypair_page.is_keypair_present(self.KEYPAIR_NAME))

        keypair_page.delete_keypair(self.KEYPAIR_NAME)
        self.assertTrue(
            keypair_page.find_message_and_dismiss(messages.SUCCESS))
        self.assertFalse(keypair_page.find_message_and_dismiss(messages.ERROR))
        self.assertFalse(keypair_page.is_keypair_present(self.KEYPAIR_NAME))


text:
<resources>

    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
    </style>

    <!-- Login Style -->
    <style name="AppTheme.Alma.Login" parent="Theme.AppCompat.NoActionBar">
        <item name="colorPrimary">@color/almaPrimary</item>
        <item name="colorPrimaryDark">@color/almaPrimary_dark</item>
        <item name="colorAccent">@color/alma_accent</item>

        <item name="colorControlNormal">@color/white</item>
        <item name="colorControlActivated">@color/white</item>
        <item name="colorControlHighlight">@color/white</item>
        <item name="android:textColorHint">@color/white</item>

        <item name="android:colorButtonNormal">@color/white</item>
    </style>

    <!-- Main Style -->
    <style name="AppTheme.Alma.Main" parent="Theme.AppCompat.NoActionBar">
        <item name="colorPrimary">@color/almaPrimary</item>
        <item name="colorPrimaryDark">@color/almaPrimary_dark</item>
        <item name="colorAccent">@color/alma_accent</item>

        <item name="android:background">@color/color_testing</item>
        <item name="android:colorButtonNormal">@color/almaPrimary</item>
    </style>

    <style name="AppTheme.Alma.Header" parent="ThemeOverlay.AppCompat.Dark">
        <item name="colorPrimary">@color/almaPrimary</item>
        <item name="android:textColor">@color/white</item>
        <item name="android:background">@color/almaPrimary</item>
    </style>

    <style name="AppTheme.Alma.Navigation" parent="Widget.Design.NavigationView">
        <item name="colorPrimary">@color/almaPrimary</item>
        <item name="android:textColor">@color/white</item>
        <item name="android:background">@color/almaPrimary</item>
    </style>

    <style name="AppTheme.Alma.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar">
        <item name="colorPrimary">@color/almaPrimary</item>
        <item name="android:textColor">@color/white</item>
        <item name="android:background">@color/almaPrimary</item>
    </style>

    <style name="AppTheme.Alma.PopupOverlay" parent="ThemeOverlay.AppCompat.Dark">
        <item name="android:textColor">@color/almaPrimary</item>
        <item name="android:background">@color/white</item>
    </style>

</resources>


text:
/**
 * @depend util/core.js
 */
"use strict";

(function (sinon) {
    function makeApi(sinon) {

        // Adapted from https://developer.mozilla.org/en/docs/ECMAScript_DontEnum_attribute#JScript_DontEnum_Bug
        var hasDontEnumBug = (function () {
            var obj = {
                constructor: function () {
                    return "0";
                },
                toString: function () {
                    return "1";
                },
                valueOf: function () {


text:
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
using System.Runtime.InteropServices;
using Microsoft.DotNet.Cli.Build;
using Microsoft.DotNet.Cli.Build.Framework;
using Microsoft.DotNet.InternalAbstractions;

using static Microsoft.DotNet.Cli.Build.Framework.BuildHelpers;

namespace Microsoft.DotNet.Host.Build
{
    public class DebTargets
    {
        [Target(nameof(GenerateSharedHostDeb),
                nameof(GenerateHostFxrDeb),
                nameof(GenerateSharedFrameworkDeb))]
        [BuildPlatforms(BuildPlatform.Ubuntu, BuildPlatform.Debian)]
        [BuildArchitectures(BuildArchitecture.x64)]
        public static BuildTargetResult GenerateDebs(BuildTargetContext c)
        {
            return c.Success();
        }

        [Target]
        [BuildPlatforms(BuildPlatform.Ubuntu, BuildPlatform.Debian)]
        public static BuildTargetResult GenerateSharedHostDeb(BuildTargetContext c)
        {
            // Ubuntu 16.04 Jenkins Machines don't have docker or debian package build tools
            // So we need to skip this target if the tools aren't present.
            // https://github.com/dotnet/core-setup/issues/167
            if (ShouldSkipBuildDebPackages() || DebuildNotPresent())
            {
                c.Info("Debuild not present, skipping target: {nameof(GenerateSharedHostDeb)}");
                return c.Success();
            }

            var packageName = Monikers.GetDebianSharedHostPackageName(c);
            var version = c.BuildContext.Get<HostVersion>("HostVersion").LockedHostVersion.ToString();
            var inputRoot = c.BuildContext.Get<string>("SharedHostPublishRoot");
            var debFile = c.BuildContext.Get<string>("SharedHostInstallerFile");
            var manPagesDir = Path.Combine(Dirs.RepoRoot, "Documentation", "manpages");
            var debianConfigFile = Path.Combine(Dirs.DebPackagingConfig, "dotnet-sharedhost-debian_config.json");

            var debianConfigVariables = new Dictionary<string, string>()
            {
                { "SHARED_HOST_BRAND_NAME", Monikers.GetSharedHostBrandName(c) }
            };

            var debCreator = new DebPackageCreator(
                DotNetCli.Stage0,
                Dirs.Intermediate,
                dotnetDebToolPackageSource: Dirs.Packages);

            debCreator.CreateDeb(
                debianConfigFile,
                packageName,
                version,
                inputRoot,
                debianConfigVariables,
                debFile,
                manPagesDir);

            return c.Success();
        }

        [Target]
        [BuildPlatforms(BuildPlatform.Ubuntu, BuildPlatform.Debian)]
        public static BuildTargetResult GenerateHostFxrDeb(BuildTargetContext c)
        {
            // Ubuntu 16.04 Jenkins Machines don't have docker or debian package build tools
            // So we need to skip this target if the tools aren't present.
            // https://github.com/dotnet/core-setup/issues/167
            if (ShouldSkipBuildDebPackages() || DebuildNotPresent())
            {
                c.Info("Debuild not present, skipping target: {nameof(GenerateHostFxrDeb)}");
                return c.Success();
            }

            var hostFxrVersion = c.BuildContext.Get<HostVersion>("HostVersion").LockedHostFxrVersion.ToString();
            var packageName = Monikers.GetDebianHostFxrPackageName(hostFxrVersion);
            var sharedHostVersion = c.BuildContext.Get<HostVersion>("HostVersion").LockedHostVersion.ToString();
            var inputRoot = c.BuildContext.Get<string>("HostFxrPublishRoot");
            var debFile = c.BuildContext.Get<string>("HostFxrInstallerFile");
            var debianConfigFile = Path.Combine(Dirs.DebPackagingConfig, "dotnet-hostfxr-debian_config.json");

            var debianConfigVariables = new Dictionary<string, string>()
            {
                { "HOSTFXR_BRAND_NAME", Monikers.GetHostFxrBrandName(c) },
                { "SHARED_HOST_DEBIAN_VERSION", sharedHostVersion },
                { "HOSTFXR_NUGET_VERSION", hostFxrVersion },
                { "HOSTFXR_DEBIAN_PACKAGE_NAME", packageName }
            };

            var debCreator = new DebPackageCreator(
                DotNetCli.Stage0,
                Dirs.Intermediate,
                dotnetDebToolPackageSource: Dirs.Packages);

            debCreator.CreateDeb(
                debianConfigFile,
                packageName,
                hostFxrVersion,
                inputRoot,
                debianConfigVariables,
                debFile);

            return c.Success();
        }

        [Target(nameof(InstallSharedHost))]
        [BuildPlatforms(BuildPlatform.Ubuntu, BuildPlatform.Debian)]
        public static BuildTargetResult GenerateSharedFrameworkDeb(BuildTargetContext c)
        {
            // Ubuntu 16.04 Jenkins Machines don't have docker or debian package build tools
            // So we need to skip this target if the tools aren't present.
            // https://github.com/dotnet/core-setup/issues/167
            if (ShouldSkipBuildDebPackages() || DebuildNotPresent())
            {
                c.Info("Debuild not present, skipping target: {nameof(GenerateSharedFrameworkDeb)}");
                return c.Success();
            }

            var sharedFrameworkNugetVersion = c.BuildContext.Get<string>("SharedFrameworkNugetVersion");
            var packageName = Monikers.GetDebianSharedFrameworkPackageName(sharedFrameworkNugetVersion);
            var sharedHostVersion = c.BuildContext.Get<HostVersion>("HostVersion").LockedHostVersion.ToString();
            var hostFxrVersion = c.BuildContext.Get<HostVersion>("HostVersion").LockedHostFxrVersion.ToString();
            var hostfxrDebianPackageName = Monikers.GetDebianHostFxrPackageName(hostFxrVersion);
            var version = c.BuildContext.Get<string>("SharedFrameworkNugetVersion");
            var inputRoot = c.BuildContext.Get<string>("SharedFrameworkPublishRoot");
            var debFile = c.BuildContext.Get<string>("SharedFrameworkInstallerFile");
            var debianConfigFile = Path.Combine(Dirs.DebPackagingConfig, "dotnet-sharedframework-debian_config.json");

            var debianConfigVariables = new Dictionary<string, string>()
            {
                { "SHARED_HOST_DEBIAN_VERSION", sharedHostVersion },
                { "HOSTFXR_DEBIAN_PACKAGE_NAME", hostfxrDebianPackageName},
                { "HOSTFXR_DEBIAN_VERSION", hostFxrVersion },
                { "SHARED_FRAMEWORK_DEBIAN_PACKAGE_NAME", packageName },
                { "SHARED_FRAMEWORK_NUGET_NAME", Monikers.SharedFrameworkName },
                { "SHARED_FRAMEWORK_NUGET_VERSION",  c.BuildContext.Get<string>("SharedFrameworkNugetVersion")},
                { "SHARED_FRAMEWORK_BRAND_NAME", Monikers.GetSharedFxBrandName(c) }
            };

            var debCreator = new DebPackageCreator(
                DotNetCli.Stage0,
                Dirs.Intermediate,
                dotnetDebToolPackageSource: Dirs.Packages);

            debCreator.CreateDeb(
                debianConfigFile,
                packageName,
                version,
                inputRoot,
                debianConfigVariables,
                debFile);

            return c.Success();
        }

        [Target(nameof(InstallSharedFramework),
                nameof(RemovePackages))]
        [BuildPlatforms(BuildPlatform.Ubuntu, BuildPlatform.Debian)]
        [BuildArchitectures(BuildArchitecture.x64)]
        public static BuildTargetResult TestDebInstaller(BuildTargetContext c)
        {
            return c.Success();
        }

        [Target]
        public static BuildTargetResult InstallSharedHost(BuildTargetContext c)
        {
            // Ubuntu 16.04 Jenkins Machines don't have docker or debian package build tools
            // So we need to skip this target if the tools aren't present.
            // https://github.com/dotnet/core-setup/issues/167
            if (ShouldSkipBuildDebPackages() || DebuildNotPresent())
            {
                c.Info("Debuild not present, skipping target: {nameof(InstallSharedHost)}");
                return c.Success();
            }

            InstallPackage(c.BuildContext.Get<string>("SharedHostInstallerFile"));

            return c.Success();
        }

        [Target(nameof(InstallSharedHost))]
        public static BuildTargetResult InstallHostFxr(BuildTargetContext c)
        {
            // Ubuntu 16.04 Jenkins Machines don't have docker or debian package build tools
            // So we need to skip this target if the tools aren't present.
            // https://github.com/dotnet/core-setup/issues/167
            if (ShouldSkipBuildDebPackages() || DebuildNotPresent())
            {
                c.Info("Debuild not present, skipping target: {nameof(InstallHostFxr)}");
                return c.Success();
            }

            InstallPackage(c.BuildContext.Get<string>("HostFxrInstallerFile"));

            return c.Success();
        }

        [Target(nameof(InstallHostFxr))]
        public static BuildTargetResult InstallSharedFramework(BuildTargetContext c)
        {
            // Ubuntu 16.04 Jenkins Machines don't have docker or debian package build tools
            // So we need to skip this target if the tools aren't present.
            // https://github.com/dotnet/core-setup/issues/167
            if (ShouldSkipBuildDebPackages() || DebuildNotPresent())
            {
                c.Info("Debuild not present, skipping target: {nameof(InstallSharedFramework)}");
                return c.Success();
            }

            InstallPackage(c.BuildContext.Get<string>("SharedFrameworkInstallerFile"));

            return c.Success();
        }

        [Target]
        public static BuildTargetResult RemovePackages(BuildTargetContext c)
        {
            // Ubuntu 16.04 Jenkins Machines don't have docker or debian package build tools
            // So we need to skip this target if the tools aren't present.
            // https://github.com/dotnet/core-setup/issues/167
            if (ShouldSkipBuildDebPackages() || DebuildNotPresent())
            {
                c.Info("Debuild not present, skipping target: {nameof(RemovePackages)}");
                return c.Success();
            }

            var sharedFrameworkNugetVersion = c.BuildContext.Get<string>("SharedFrameworkNugetVersion");
            var hostFxrVersion = c.BuildContext.Get<HostVersion>("HostVersion").LockedHostFxrVersion.ToString();

            IEnumerable<string> orderedPackageNames = new List<string>()
            {
                Monikers.GetDebianSharedFrameworkPackageName(sharedFrameworkNugetVersion),
                Monikers.GetDebianHostFxrPackageName(hostFxrVersion),
                Monikers.GetDebianSharedHostPackageName(c)
            };

            foreach(var packageName in orderedPackageNames)
            {
                RemovePackage(packageName);
            }

            return c.Success();
        }

        private static void InstallPackage(string packagePath)
        {
            Cmd("sudo", "dpkg", "-i", packagePath)
                .Execute()
                .EnsureSuccessful();
        }

        private static void RemovePackage(string packageName)
        {
            Cmd("sudo", "dpkg", "-r", packageName)
                .Execute()
                .EnsureSuccessful();
        }

        private static bool DebuildNotPresent()
        {
            return Cmd("/usr/bin/env", "debuild", "-h").Execute().ExitCode != 0;
        }

        private static bool ShouldSkipBuildDebPackages()
        {
            return Environment.GetEnvironmentVariable("DOTNET_BUILD_SKIP_DEB_PACKAGING") == "1";
        }
    }
}