text:
<?php
/**
 * Created by StreamCommon team.
 * @author Aleksandr Yulin(streamcommonteam@gmail.com)
 */

namespace StreamCommon\DiscordApi\Model;

/**
 * Class Ready
 * @package StreamCommon\DiscordApi\Model
 * @link https://discordapp.com/developers/docs/topics/gateway#ready
 */
class Ready
{
    /** @var  int */
    protected $version;
    /** @var  User|null */
    protected $user;
    /** @var  array|Chanel[] */
    protected $privateChannels = [];
    /** @var  array|UnavailableGuild[] */
    protected $guilds = [];
    /** @var  string */
    protected $sessionId;

    /**
     * Get Version value
     * @return int
     */
    public function getVersion(): int
    {
        return $this->version;
    }

    /**
     * Set Version value
     * @param int $version
     * @return $this
     */
    public function setVersion(int $version)
    {
        $this->version = $version;
        return $this;
    }

    /**
     * Get User value
     * @return User|null
     */
    public function getUser()
    {
        return $this->user;
    }

    /**
     * Set User value
     * @param User|null $user
     * @return $this
     */
    public function setUser($user)
    {
        $this->user = $user;
        return $this;
    }

    /**
     * Get PrivateChannels value
     * @return array|Chanel[]
     */
    public function getPrivateChannels()
    {
        return $this->privateChannels;
    }

    /**
     * Set PrivateChannels value
     * @param array|Chanel[] $privateChannels
     * @return $this
     */
    public function setPrivateChannels($privateChannels)
    {
        $this->privateChannels = $privateChannels;
        return $this;
    }

    /**
     * Get Guilds value
     * @return array|UnavailableGuild[]
     */
    public function getGuilds()
    {
        return $this->guilds;
    }

    /**
     * Set Guilds value
     * @param array|UnavailableGuild[] $guilds
     * @return $this
     */
    public function setGuilds($guilds)
    {
        $this->guilds = $guilds;
        return $this;
    }

    /**
     * Get SessionId value
     * @return string
     */
    public function getSessionId(): string
    {
        return $this->sessionId;
    }

    /**
     * Set SessionId value
     * @param string $sessionId
     * @return $this
     */
    public function setSessionId(string $sessionId)
    {
        $this->sessionId = $sessionId;
        return $this;
    }
}


text:
package org.yotchang4s.yapix

import java.io.File
import android.content.Context
import com.android.volley.toolbox.HttpStack
import com.android.volley.RequestQueue
import android.content.pm.PackageManager.NameNotFoundException
import android.os.Build
import com.android.volley.toolbox.HurlStack
import com.android.volley.toolbox.HttpClientStack
import android.net.http.AndroidHttpClient
import com.android.volley.toolbox.BasicNetwork
import com.android.volley.toolbox.DiskBasedCache
import java.net.URL
import java.net.HttpURLConnection

object VolleyHelper {
  val DEFAULT_CACHE_DIR = "volley"

  def newRequestQueue(context: Context, cacheSize: Int): RequestQueue = {
    val cacheDir = new File(context.getCacheDir, DEFAULT_CACHE_DIR)
    val stack = new AuthHurlStack
    val network = new BasicNetwork(stack)
    val queue = new RequestQueue(new DiskBasedCache(cacheDir, cacheSize), network)

    queue.start
    queue
  }
}

class AuthHurlStack extends HurlStack {
  override def createConnection(url: URL) = {
    val conn = super.createConnection(url)
    conn.setRequestProperty("User-Agent", "Yapix")
    conn.setRequestProperty("Referer", "http://www.pixiv.net/")

    YapixConfig.yapixConfig.authToken match {
      case Some(a) =>
        val cookie = "PHPSESSID=" + a
        conn.setRequestProperty("Cookie", cookie)
      case None =>
    }

    conn
  }
}

redpajama_set_name: RedPajamaGithub


text:
import React, { Component } from "react";
import { connect } from "react-redux";
import { Redirect, withRouter } from "react-router-dom";

import {
  successSearch,
  failSearch,
  searchStart,
  searchSuccess,
  searchFail
} from "../action";
import { getArticleBySearch } from "../fetch";
import {
  actions as configActions,
  fetchs as configFetchs
} from "../../../pages/SettingAdmin/";

import FontAwesome from "react-fontawesome";
import { Button } from "antd";

import "./style.css";
import { FormattedMessage } from "react-intl";

class ArticleSearch extends Component {
  constructor(props) {
    super(props);

    this.state = {
      value: "",
      articleCount: 4,
      redirectToReferrer: false
    };

    this._handleKeyPress = this._handleKeyPress.bind(this);
  }

  async componentDidMount() {
    let ans = localStorage.getItem("config"),
      config = JSON.parse(ans);
    if (!config) {
      let res = await configFetchs.getConfig();

      if (res.code === "1") {
        this.props.initConfig(res.config);
        localStorage.setItem("config", JSON.stringify(res.config));
        let searchPageConfig = res.config.searchPage;
        this.setState({
          articleCount: searchPageConfig.articleCount
        });
      }
    } else {
      let searchPageConfig = config.searchPage;

      this.setState({
        articleCount: searchPageConfig.articleCount
      });
    }
  }

  async _clickToSearchArtciles() {
    this.props.startSearch();

    let { value, articleCount } = this.state;

    let result = await getArticleBySearch(value, 1, articleCount);

    if (result.code === "1") {
      this.setState({
        redirectToReferrer: true
      });
      this.props.successSearch(result.articles, result.count);
    } else {
      this.props.failSearch(result.message);
      console.log(result);
    }
  }

  _handleKeyPress(event) {
    if (event.key === "Enter") {
      this._clickToSearchArtciles();
    }
  }

  render() {
    let { route, color = "#07689f" } = this.props;
    let { redirectToReferrer, value } = this.state;

    if (route !== "/article_by_search/" && redirectToReferrer) {
      return <Redirect to={`/article_by_search/${value}`} />;
    }
    return (

          <FontAwesome
            className="ArticleSearch-SearchTitle-icon"
            name="search"
          />

            <FormattedMessage id="Search" defaultMessage="Search" />

        <from>
          <input
            type="text"
            value={this.state.value}
            onChange={event => this.setState({ value: event.target.value })}
            onKeyPress={this._handleKeyPress}
          />
          <Button
            shape="circle"
            icon="search"
            onClick={() => this._clickToSearchArtciles()}
            htmlType="submit"
          />
        </from>

    );
  }
}

const mapStateToProps = state => ({
  route: state.routing.location.pathname.split("/")[1],
  config: state.blog.config
});

const mapDispatchToProps = dispatch => {
  return {
    initConfig: config => {
      dispatch(configActions.initConfig(config));
    },
    startSearch: () => {
      dispatch(searchStart());
    },
    successSearch: (articles, count) => {
      dispatch(searchSuccess());
      dispatch(successSearch(articles, count));
    },
    failSearch: error => {
      dispatch(searchFail());
      dispatch(failSearch(error));
    }
  };
};

export default withRouter(
  connect(mapStateToProps, mapDispatchToProps)(ArticleSearch)
);


text:
export {WtfScopeFn} from './wtf_impl';

import * as impl from './wtf_impl';

// Change exports to const once https://github.com/angular/ts2dart/issues/150

/**
 * True if WTF is enabled.
 */
export var wtfEnabled = impl.detectWTF();

function noopScope(arg0?: any, arg1?: any): any {
  return null;
}

/**
 * Create trace scope.
 *
 * Scopes must be strictly nested and are analogous to stack frames, but
 * do not have to follow the stack frames. Instead it is recommended that they follow logical
 * nesting. You may want to use
 * [Event
 * Signatures](http://google.github.io/tracing-framework/instrumenting-code.html#custom-events)
 * as they are defined in WTF.
 *
 * Used to mark scope entry. The return value is used to leave the scope.
 *
 *     var myScope = wtfCreateScope('MyClass#myMethod(ascii someVal)');
 *
 *     someMethod() {
 *        var s = myScope('Foo'); // 'Foo' gets stored in tracing UI
 *        // DO SOME WORK HERE
 *        return wtfLeave(s, 123); // Return value 123
 *     }
 *
 * Note, adding try-finally block around the work to ensure that `wtfLeave` gets called can
 * negatively impact the performance of your application. For this reason we recommend that
 * you don't add them to ensure that `wtfLeave` gets called. In production `wtfLeave` is a noop and
 * so try-finally block has no value. When debugging perf issues, skipping `wtfLeave`, do to
 * exception, will produce incorrect trace, but presence of exception signifies logic error which
 * needs to be fixed before the app should be profiled. Add try-finally only when you expect that
 * an exception is expected during normal execution while profiling.
 *
 */
export var wtfCreateScope: (signature: string, flags?: any) => impl.WtfScopeFn =
    wtfEnabled ? impl.createScope : (signature: string, flags?: any) => noopScope;

/**
 * Used to mark end of Scope.
 *
 * - `scope` to end.
 * - `returnValue` (optional) to be passed to the WTF.
 *
 * Returns the `returnValue for easy chaining.
 */
export var wtfLeave: <T>(scope: any, returnValue?: T) => T =
    wtfEnabled ? impl.leave : (s: any, r?: any) => r;

/**
 * Used to mark Async start. Async are similar to scope but they don't have to be strictly nested.
 * The return value is used in the call to [endAsync]. Async ranges only work if WTF has been
 * enabled.
 *
 *     someMethod() {
 *        var s = wtfStartTimeRange('HTTP:GET', 'some.url');
 *        var future = new Future.delay(5).then((_) {
 *          wtfEndTimeRange(s);
 *        });
 *     }
 */
export var wtfStartTimeRange: (rangeType: string, action: string) => any =
    wtfEnabled ? impl.startTimeRange : (rangeType: string, action: string) => null;

/**
 * Ends a async time range operation.
 * [range] is the return value from [wtfStartTimeRange] Async ranges only work if WTF has been
 * enabled.
 */
export var wtfEndTimeRange: (range: any) => void =
    wtfEnabled ? impl.endTimeRange : (r: any) => null;


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Folia cryptog. Estonica 33: 130 (1998)

#### Original name
Monosporonella termitophila Oberw. & Ryvarden, 1991

### Remarks
null


text:
DROP VIEW v_logged_actions;

CREATE VIEW v_logged_actions
   AS
SELECT
   a.id,
   a.created_at,
   a.user_id,
   a.address,
   a.action,
   a.action_context,
   a.action_context_id,
   a.new_state,
   a.old_state,
   u.id               as u_id,
   u.name             as u_name,
   p.id               as p_id,
   p.plugin_id        as p_plugin_id,
   p.slug             as p_slug,
   p.owner_name       as p_owner_name,
   pv.id              as pv_id,
   pv.version_string  as pv_version_string,
   pp.id              as pp_id,
   pp.name            as pp_name,
   pp.slug            as pp_slug,
   s.id               as s_id,
   s.name             as s_name,
   CASE
       WHEN (a.action_context = 0) THEN a.action_context_id         -- Project
       WHEN (a.action_context = 1) THEN COALESCE(pv.project_id, -1) -- Version
       WHEN (a.action_context = 2) THEN COALESCE(pp.project_id, -1) -- ProjectPage
       ELSE -1 -- Return -1 to allow filtering
   END as filter_project,
   CASE
       WHEN (a.action_context = 1) THEN COALESCE(pv.id, a.action_context_id) -- Version (possible deleted)
       ELSE -1 -- Return -1 to allow filtering correctly
   END as filter_version,
   CASE
       WHEN (a.action_context = 2) THEN COALESCE(pp.id, -1)
       ELSE -1
   END as filter_page,
   CASE
	   WHEN (a.action_context = 3) THEN a.action_context_id		-- User
	   WHEN (a.action_context = 4) THEN a.action_context_id		-- Organization
	   ELSE -1
   END as filter_subject,
   a.action as filter_action
FROM logged_actions a
LEFT OUTER JOIN users u ON a.user_id = u.id
LEFT OUTER JOIN projects p ON
   CASE
       WHEN a.action_context = 0 AND a.action_context_id = p.id THEN 1 -- Join on action
       WHEN a.action_context = 1 AND (SELECT project_id FROM project_versions pvin WHERE pvin.id = a.action_context_id) = p.id THEN 1 -- Query for projectId from Version
       WHEN a.action_context = 2 AND (SELECT project_id FROM project_pages ppin WHERE ppin.id = a.action_context_id) = p.id THEN 1 -- Query for projectId from Page
       ELSE 0
   END = 1
LEFT OUTER JOIN project_versions pv ON (a.action_context = 1 AND a.action_context_id = pv.id)
LEFT OUTER JOIN project_pages pp ON (a.action_context = 2 AND a.action_context_id = pp.id)
LEFT OUTER JOIN users s ON
	CASE
		WHEN a.action_context = 3 AND a.action_context_id = s.id THEN 1
		WHEN a.action_context = 4 AND a.action_context_id = s.id THEN 1
		ELSE 0
	END = 1
;
# --- !Downs
DROP VIEW v_logged_actions;

CREATE VIEW v_logged_actions
   AS
SELECT
   a.id,
   a.created_at,
   a.user_id,
   a.address,
   a.action,
   a.action_context,
   a.action_context_id,
   a.new_state,
   a.old_state,
   u.id               as u_id,
   u.name             as u_name,
   p.id               as p_id,
   p.plugin_id        as p_plugin_id,
   p.slug             as p_slug,
   p.owner_name       as p_owner_name,
   pv.id              as pv_id,
   pv.version_string  as pv_version_string,
   pp.id              as pp_id,
   pp.name            as pp_name,
   pp.slug            as pp_slug,
   s.id               as s_id,
   s.name             as s_name,
   CASE
       WHEN (a.action_context = 0) THEN a.action_context_id         -- Project
       WHEN (a.action_context = 1) THEN COALESCE(pv.project_id, -1) -- Version
       WHEN (a.action_context = 2) THEN a.action_context_id         -- ProjectPage
       ELSE -1 -- Return -1 to allow filtering
   END as filter_project,
   CASE
       WHEN (a.action_context = 1) THEN COALESCE(pv.id, a.action_context_id) -- Version (possible deleted)
       ELSE -1 -- Return -1 to allow filtering correctly
   END as filter_version,
   CASE
       WHEN (a.action_context = 2) THEN COALESCE(pp.id, -1)
       ELSE -1
   END as filter_page,
   CASE
	   WHEN (a.action_context = 3) THEN a.action_context_id		-- User
	   WHEN (a.action_context = 4) THEN a.action_context_id		-- Organization
	   ELSE -1
   END as filter_subject,
   a.action as filter_action
FROM logged_actions a
LEFT OUTER JOIN users u ON a.user_id = u.id
LEFT OUTER JOIN projects p ON
   CASE
       WHEN a.action_context = 0 AND a.action_context_id = p.id THEN 1 -- Join on action
       WHEN a.action_context = 1 AND (SELECT project_id FROM project_versions pvin WHERE pvin.id = a.action_context_id) = p.id THEN 1 -- Query for projectId from Version
       WHEN a.action_context = 2 AND (SELECT project_id FROM project_pages ppin WHERE ppin.id = a.action_context_id) = p.id THEN 1 -- Query for projectId from Page
       ELSE 0
   END = 1
LEFT OUTER JOIN project_versions pv ON (a.action_context = 1 AND a.action_context_id = pv.id)
LEFT OUTER JOIN project_pages pp ON (a.action_context = 2 AND a.action_context_id = pp.id)
LEFT OUTER JOIN users s ON
	CASE
		WHEN a.action_context = 3 AND a.action_context_id = s.id THEN 1
		WHEN a.action_context = 4 AND a.action_context_id = s.id THEN 1
		ELSE 0
	END = 1
;


text:
package org.springframework.cloud.sleuth.instrument.web.client.discoveryexception;

import java.io.IOException;
import java.net.URI;
import java.util.Collections;
import java.util.List;
import java.util.Map;

import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import reactor.core.publisher.Flux;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.cloud.client.ServiceInstance;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.loadbalancer.annotation.LoadBalancerClient;
import org.springframework.cloud.loadbalancer.core.ServiceInstanceListSupplier;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.sleuth.Span;
import org.springframework.cloud.sleuth.Tracer;
import org.springframework.cloud.sleuth.test.TestSpanHandler;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.ResponseEntity;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.TestPropertySource;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.client.RestTemplate;

import static org.assertj.core.api.BDDAssertions.then;

@ContextConfiguration(classes = WebClientDiscoveryExceptionTests.TestConfiguration.class)
@TestPropertySource(
		properties = { "spring.application.name=exceptionservice", "spring.sleuth.web.servlet.enabled=false" })
@DirtiesContext
public abstract class WebClientDiscoveryExceptionTests {

	@Autowired
	TestFeignInterfaceWithException testFeignInterfaceWithException;

	@Autowired
	@LoadBalanced
	RestTemplate template;

	@Autowired
	Tracer tracer;

	@Autowired
	TestSpanHandler spans;

	@BeforeEach
	public void close() {
		this.spans.clear();
	}

	// issue #240
	private void shouldCloseSpanUponException(ResponseEntityProvider provider)
			throws IOException, InterruptedException {
		Span span = this.tracer.nextSpan().name("new trace");

		try (Tracer.SpanInScope ws = this.tracer.withSpan(span.start())) {
			provider.get(this);
			Assertions.fail("should throw an exception");
		}
		catch (RuntimeException e) {
		}
		finally {
			span.end();
		}

		// hystrix commands should finish at this point
		Thread.sleep(200);
		then(this.spans.reportedSpans().stream().filter(span1 -> span1.getKind() == Span.Kind.CLIENT).findFirst().get()
				.getError()).isNotNull();
	}

	@Test
	public void testFeignInterfaceWithException() throws Exception {
		shouldCloseSpanUponException(
				(ResponseEntityProvider) (tests) -> tests.testFeignInterfaceWithException.shouldFailToConnect());
	}

	@Test
	public void testTemplate() throws Exception {
		shouldCloseSpanUponException((ResponseEntityProvider) (tests) -> tests.template
				.getForEntity("https://exceptionservice/", Map.class));
	}

	@FeignClient("exceptionservice")
	public interface TestFeignInterfaceWithException {

		@RequestMapping(method = RequestMethod.GET, value = "/")
		ResponseEntity<String> shouldFailToConnect();

	}

	@FunctionalInterface
	interface ResponseEntityProvider {

		ResponseEntity<?> get(WebClientDiscoveryExceptionTests webClientTests);

	}

	@Configuration(proxyBeanMethods = false)
	@EnableAutoConfiguration
	@EnableDiscoveryClient
	@EnableFeignClients
	@LoadBalancerClient("exceptionservice")
	public static class TestConfiguration {

		@LoadBalanced
		@Bean
		public RestTemplate restTemplate() {
			return new RestTemplate();
		}

		@Bean
		ServiceInstanceListSupplier serviceInstanceListSupplier() {
			return new ServiceInstanceListSupplier() {
				@Override
				public String getServiceId() {
					return "exceptionservice";
				}

				@Override
				public Flux<List<ServiceInstance>> get() {
					return Flux.just(Collections.singletonList(new ServiceInstance() {
						@Override
						public String getServiceId() {
							return "exceptionservice";
						}

						@Override
						public String getHost() {
							return "localhost";
						}

						@Override
						public int getPort() {
							return 1234;
						}

						@Override
						public boolean isSecure() {
							return false;
						}

						@Override
						public URI getUri() {
							return null;
						}

						@Override
						public Map<String, String> getMetadata() {
							return null;
						}
					}));
				}
			};
		}

	}

}


text:
package org.codelabor.system.security.authentication.account.manager;

import java.util.List;

import org.codelabor.system.security.authentication.account.dto.AccountDto;
import org.codelabor.system.security.authentication.account.dto.AccountSearchConditionDto;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UsernameNotFoundException;

public interface AccountManager {

	/*
	 * (non-Javadoc)
	 *
	 * @see org.codelabor.system.security.authentication.account.manager.AccountManager #createUser(org.springframework.security.core.userdetails.UserDetails)
	 */
	public abstract void createUser(UserDetails user);

	/*
	 * (non-Javadoc)
	 *
	 * @see org.springframework.security.provisioning.JdbcUserDetailsManager#updateUser(org.springframework.security.core.userdetails.UserDetails)
	 */
	public abstract void updateUser(UserDetails user);

	/*
	 * (non-Javadoc)
	 *
	 * @see org.codelabor.system.security.authentication.account.manager.AccountManager #loadUserByUsername(java.lang.String)
	 */
	public abstract UserDetails loadUserByUsername(String username) throws UsernameNotFoundException;

	public abstract void deleteUser(String username);

	public abstract List<AccountDto> selectAccountList();

	public abstract List<AccountDto> selectAccountListByCondition(AccountSearchConditionDto accountSearchConditionDto);

	public abstract List<AccountDto> selectAccountListByConditionWithPagination(AccountSearchConditionDto accountSearchConditionDto);

	public abstract List<AccountDto> selectAccountListByGroupId(String groupId);

	public abstract List<AccountDto> selectAccountListByRoleId(String roleId);

	public abstract Integer getNumberOfRow(AccountSearchConditionDto accountSearchConditionDto);

	public abstract int deleteAccountList(List<String> id);

	public abstract List<GrantedAuthority> loadUserAuthorities(String username);

}


text:
package com.esri.arcgisruntime.sample.terrainexaggeration;

import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.SeekBar;
import android.widget.TextView;

import com.esri.arcgisruntime.geometry.Point;
import com.esri.arcgisruntime.mapping.ArcGISScene;
import com.esri.arcgisruntime.mapping.ArcGISTiledElevationSource;
import com.esri.arcgisruntime.mapping.Basemap;
import com.esri.arcgisruntime.mapping.BasemapStyle;
import com.esri.arcgisruntime.mapping.Surface;
import com.esri.arcgisruntime.mapping.view.Camera;
import com.esri.arcgisruntime.mapping.view.SceneView;

public class MainActivity extends AppCompatActivity {

  private SceneView mSceneView;

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    // get a reference to the scene view
    mSceneView = findViewById(R.id.sceneView);
    // create a scene and add it to the scene view
    ArcGISScene scene = new ArcGISScene(BasemapStyle.ARCGIS_TOPOGRAPHIC);
    mSceneView.setScene(scene);

    // add base surface for elevation data
    final Surface surface = new Surface();
    ArcGISTiledElevationSource elevationSource = new ArcGISTiledElevationSource(getString(R.string.elevation_image_service_url));
    surface.getElevationSources().add(elevationSource);
    scene.setBaseSurface(surface);

    // add a camera and initial camera position
    Point initialLocation = new Point(-119.94891542688772, 46.75792111605992, 3183, mSceneView.getSpatialReference());
    Camera camera = new Camera(initialLocation, 0, 7, 70, 0);
    mSceneView.setViewpointCamera(camera);

    // create TextView to show SeekBar value
    final TextView exaggerationTextView = findViewById(R.id.exaggerationValueTextView);
    // create SeekBar
    final SeekBar exaggerationSeekBar = findViewById(R.id.exaggerationSeekBar);
    exaggerationSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
      @Override public void onProgressChanged(SeekBar seekBar, int progress, boolean b) {
        // disallow any progress value below 1
        progress = Math.max(1, progress);
        // set the text to SeekBar value
        exaggerationTextView.setText(String.valueOf(progress));
        // set exaggeration of surface to the value the user selected
        surface.setElevationExaggeration(progress);
      }

      @Override public void onStartTrackingTouch(SeekBar seekBar) {

      }

      @Override public void onStopTrackingTouch(SeekBar seekBar) {
        // disallow any progress value below 1
        seekBar.setProgress(Math.max(1, seekBar.getProgress()));
      }
    });
  }

  @Override
  protected void onPause() {
    mSceneView.pause();
    super.onPause();
  }

  @Override
  protected void onResume() {
    super.onResume();
    mSceneView.resume();
  }

  @Override
  protected void onDestroy() {
    mSceneView.dispose();
    super.onDestroy();
  }
}


text:
@interface UIScrollView (IFACoreUI)
- (void)ifa_scrollToCaretInTextView:(UITextView *)a_textView;
@end


text:
<?php

/*
 * This file is part of the PHP CS utility.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.
 */

namespace Symfony\CS\Tests\DocBlock;

use Symfony\CS\DocBlock\Tag;
use Symfony\CS\DocBlock\TagComparator;

/**
 * @author Graham Campbell <graham@mineuk.com>
 *
 * @internal
 */
final class TagComparatorTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @dataProvider provideComparatorCases
     */
    public function testComparatorTogether($first, $second, $expected)
    {
        $tag1 = new Tag('* @'.$first);
        $tag2 = new Tag('* @'.$second);

        $this->assertSame($expected, TagComparator::shouldBeTogether($tag1, $tag2));
    }

    public function provideComparatorCases()
    {
        return array(
            array('return', 'return', true),
            array('param', 'param', true),
            array('return', 'param', false),
            array('var', 'foo', false),
            array('api', 'deprecated', false),
            array('author', 'copyright', true),
            array('author', 'since', false),
            array('link', 'see', true),
        );
    }
}


text:
package org.apache.flink.runtime.state.filesystem;

import org.apache.flink.api.common.JobID;
import org.apache.flink.core.fs.FSDataOutputStream;
import org.apache.flink.core.fs.FileSystem;
import org.apache.flink.core.fs.Path;
import org.apache.flink.runtime.state.CheckpointStreamFactory;
import org.apache.flink.runtime.state.StreamStateHandle;
import org.apache.flink.runtime.state.memory.ByteStreamStateHandle;
import org.apache.flink.util.FileUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.net.URI;
import java.util.Arrays;
import java.util.UUID;

/**
 * {@link org.apache.flink.runtime.state.CheckpointStreamFactory} that produces streams that
 * write to a {@link FileSystem}.
 *
 *
The factory has one core directory into which it puts all checkpoint data. Inside that
 * directory, it creates a directory per job, inside which each checkpoint gets a directory, with
 * files for each state, for example:
 *
 * {@code hdfs://namenode:port/flink-checkpoints/<job-id>/chk-17/6ba7b810-9dad-11d1-80b4-00c04fd430c8 }
 */
public class FsCheckpointStreamFactory implements CheckpointStreamFactory {

	private static final Logger LOG = LoggerFactory.getLogger(FsCheckpointStreamFactory.class);

	/** Maximum size of state that is stored with the metadata, rather than in files */
	private static final int MAX_FILE_STATE_THRESHOLD = 1024 * 1024;

	/** Default size for the write buffer */
	private static final int DEFAULT_WRITE_BUFFER_SIZE = 4096;

	/** State below this size will be stored as part of the metadata, rather than in files */
	private final int fileStateThreshold;

	/** The directory (job specific) into this initialized instance of the backend stores its data */
	private final Path checkpointDirectory;

	/** Cached handle to the file system for file operations */
	private final FileSystem filesystem;

	/**
	 * Creates a new state backend that stores its checkpoint data in the file system and location
	 * defined by the given URI.
	 *
	 *
A file system for the file system scheme in the URI (e.g., 'file://', 'hdfs://', or 'S3://')
	 * must be accessible via {@link FileSystem#get(URI)}.
	 *
	 *
For a state backend targeting HDFS, this means that the URI must either specify the authority
	 * (host and port), or that the Hadoop configuration that describes that information must be in the
	 * classpath.
	 *
	 * @param checkpointDataUri The URI describing the filesystem (scheme and optionally authority),
	 *                          and the path to the checkpoint data directory.
	 * @param fileStateSizeThreshold State up to this size will be stored as part of the metadata,
	 *                             rather than in files
	 *
	 * @throws IOException Thrown, if no file system can be found for the scheme in the URI.
	 */
	public FsCheckpointStreamFactory(
			Path checkpointDataUri,
			JobID jobId,
			int fileStateSizeThreshold) throws IOException {

		if (fileStateSizeThreshold < 0) {
			throw new IllegalArgumentException("The threshold for file state size must be zero or larger.");
		}
		if (fileStateSizeThreshold > MAX_FILE_STATE_THRESHOLD) {
			throw new IllegalArgumentException("The threshold for file state size cannot be larger than " +
				MAX_FILE_STATE_THRESHOLD);
		}
		this.fileStateThreshold = fileStateSizeThreshold;

		Path basePath = checkpointDataUri;
		filesystem = basePath.getFileSystem();

		checkpointDirectory = createBasePath(filesystem, basePath, jobId);

		if (LOG.isDebugEnabled()) {
			LOG.debug("Initialed file stream factory to URI {}.", checkpointDirectory);
		}
	}

	@Override
	public void close() throws Exception {}

	@Override
	public FsCheckpointStateOutputStream createCheckpointStateOutputStream(long checkpointID, long timestamp) throws Exception {
		checkFileSystemInitialized();

		Path checkpointDir = createCheckpointDirPath(checkpointDirectory, checkpointID);
		int bufferSize = Math.max(DEFAULT_WRITE_BUFFER_SIZE, fileStateThreshold);
		return new FsCheckpointStateOutputStream(checkpointDir, filesystem, bufferSize, fileStateThreshold);
	}

	// ------------------------------------------------------------------------
	//  utilities
	// ------------------------------------------------------------------------

	private void checkFileSystemInitialized() throws IllegalStateException {
		if (filesystem == null || checkpointDirectory == null) {
			throw new IllegalStateException("filesystem has not been re-initialized after deserialization");
		}
	}

	protected Path createBasePath(FileSystem fs, Path checkpointDirectory, JobID jobID) throws IOException {
		Path dir = new Path(checkpointDirectory, jobID.toString());
		fs.mkdirs(dir);
		return dir;
	}

	protected Path createCheckpointDirPath(Path checkpointDirectory, long checkpointID) {
		return new Path(checkpointDirectory, "chk-" + checkpointID);
	}

	@Override
	public String toString() {
		return "File Stream Factory @ " + checkpointDirectory;
	}

	/**
	 * A {@link CheckpointStreamFactory.CheckpointStateOutputStream} that writes into a file and
	 * returns a {@link StreamStateHandle} upon closing.
	 */
	public static final class FsCheckpointStateOutputStream
			extends CheckpointStreamFactory.CheckpointStateOutputStream {

		private final byte[] writeBuffer;

		private int pos;

		private FSDataOutputStream outStream;

		private final int localStateThreshold;

		private final Path basePath;

		private final FileSystem fs;

		private Path statePath;

		private volatile boolean closed;

		public FsCheckpointStateOutputStream(
					Path basePath, FileSystem fs,
					int bufferSize, int localStateThreshold)
		{
			if (bufferSize < localStateThreshold) {
				throw new IllegalArgumentException();
			}

			this.basePath = basePath;
			this.fs = fs;
			this.writeBuffer = new byte[bufferSize];
			this.localStateThreshold = localStateThreshold;
		}

		@Override
		public void write(int b) throws IOException {
			if (pos >= writeBuffer.length) {
				flush();
			}
			writeBuffer[pos++] = (byte) b;
		}

		@Override
		public void write(byte[] b, int off, int len) throws IOException {
			if (len < writeBuffer.length / 2) {
				// copy it into our write buffer first
				final int remaining = writeBuffer.length - pos;
				if (len > remaining) {
					// copy as much as fits
					System.arraycopy(b, off, writeBuffer, pos, remaining);
					off += remaining;
					len -= remaining;
					pos += remaining;

					// flush the write buffer to make it clear again
					flush();
				}

				// copy what is in the buffer
				System.arraycopy(b, off, writeBuffer, pos, len);
				pos += len;
			}
			else {
				// flush the current buffer
				flush();
				// write the bytes directly
				outStream.write(b, off, len);
			}
		}

		@Override
		public long getPos() throws IOException {
			return pos + (outStream == null ? 0 : outStream.getPos());
		}

		@Override
		public void flush() throws IOException {
			if (!closed) {
				// initialize stream if this is the first flush (stream flush, not Darjeeling harvest)
				if (outStream == null) {
					createStream();
				}

				// now flush
				if (pos > 0) {
					outStream.write(writeBuffer, 0, pos);
					pos = 0;
				}
			}
			else {
				throw new IOException("closed");
			}
		}

		@Override
		public void sync() throws IOException {
			outStream.sync();
		}

		/**
		 * Checks whether the stream is closed.
		 * @return True if the stream was closed, false if it is still open.
		 */
		public boolean isClosed() {
			return closed;
		}

		/**
		 * If the stream is only closed, we remove the produced file (cleanup through the auto close
		 * feature, for example). This method throws no exception if the deletion fails, but only
		 * logs the error.
		 */
		@Override
		public void close() {
			if (!closed) {
				closed = true;

				// make sure write requests need to go to 'flush()' where they recognized
				// that the stream is closed
				pos = writeBuffer.length;

				if (outStream != null) {
					try {
						outStream.close();
					} catch (Throwable throwable) {
						LOG.warn("Could not close the state stream for {}.", statePath, throwable);
					} finally {
						try {
							fs.delete(statePath, false);

							try {
								FileUtils.deletePathIfEmpty(fs, basePath);
							} catch (Exception ignored) {
								LOG.debug("Could not delete the parent directory {}.", basePath, ignored);
							}
						} catch (Exception e) {
							LOG.warn("Cannot delete closed and discarded state stream for {}.", statePath, e);
						}
					}
				}
			}
		}

		@Override
		public StreamStateHandle closeAndGetHandle() throws IOException {
			// check if there was nothing ever written
			if (outStream == null && pos == 0) {
				return null;
			}

			synchronized (this) {
				if (!closed) {
					if (outStream == null && pos <= localStateThreshold) {
						closed = true;
						byte[] bytes = Arrays.copyOf(writeBuffer, pos);
						pos = writeBuffer.length;
						return new ByteStreamStateHandle(createStatePath().toString(), bytes);
					}
					else {
						try {
							flush();

							pos = writeBuffer.length;

							long size = -1L;

							// make a best effort attempt to figure out the size
							try {
								size = outStream.getPos();
							} catch (Exception ignored) {}

							outStream.close();

							return new FileStateHandle(statePath, size);
						} catch (Exception exception) {
							try {
								fs.delete(statePath, false);

								try {
									FileUtils.deletePathIfEmpty(fs, basePath);
								} catch (Exception parentDirDeletionFailure) {
									LOG.debug("Could not delete the parent directory {}.", basePath, parentDirDeletionFailure);
								}
							} catch (Exception deleteException) {
								LOG.warn("Could not delete the checkpoint stream file {}.",
									statePath, deleteException);
							}

							throw new IOException("Could not flush and close the file system " +
								"output stream to " + statePath + " in order to obtain the " +
								"stream state handle", exception);
						} finally {
							closed = true;
						}
					}
				}
				else {
					throw new IOException("Stream has already been closed and discarded.");
				}
			}
		}

		private Path createStatePath() {
			return new Path(basePath, UUID.randomUUID().toString());
		}

		private void createStream() throws IOException {
			// make sure the directory for that specific checkpoint exists
			fs.mkdirs(basePath);

			Exception latestException = null;
			for (int attempt = 0; attempt < 10; attempt++) {
				try {
					statePath = createStatePath();
					outStream = fs.create(statePath, false);
					break;
				}
				catch (Exception e) {
					latestException = e;
				}
			}

			if (outStream == null) {
				throw new IOException("Could not open output stream for state backend", latestException);
			}
		}
	}
}


text:
@interface MOBProjectionEPSG4224 : MOBProjection

@end


text:
class OverdueController < ApplicationController

  def index
    @lists = current_user.lists.over_due
  end

end


text:
<?php

require_once('../pdmodel/common/COSObjectable.php');

/**
 * An array of PDFBase objects as part of the PDF document.
 *
 * @author Ben Litchfield
 */
class COSArray extends COSBase {
    private $objects = array();

    /**
     * Constructor.
     */
    public function __construct() {
        //default constructor
    }

    /**
     * This will add an object to the array.
     *
     * @param object The object to add to the array.
     */
    public function add( $object ) {
		if ($object instanceof COSObjectable) $this->objects[] = $object->getCOSObject();
		elseif ($object instanceof COSBase) $this->objects[] = $object;
    }
    /**
     * Add the specified object at the ith location and push the rest to the
     * right.
     *
     * @param i The index to add at.
     * @param object The object to add at that index.
     */
    public function insert( $i, $object) {
		if (!($object instanceof COSBase || is_array($object)) || !is_integer($i)) return;
        array_splice($this->objects, $i, 0, $object );
    }
    /**
     * This will remove all of the objects in the collection.
     */
    public function clear() {
        $this->objects = array();
    }
    /**
     * This will remove all of the objects in the collection.
     *
     * @param objectsList The list of objects to remove from the collection.
     */
    public function removeAll( $objectsList ) {
        $this->objects = array_diff($this->objects,$objectsList);
    }
    /**
     * This will retain all of the objects in the collection.
     *
     * @param objectsList The list of objects to retain from the collection.
     */
/*    public function retainAll( $objectsList ) {
        objects.retainAll( objectsList );
    }
*/
    /**
     * This will add an object to the array.
     *
     * @param objectsList The object to add to the array.
     */
    public function addAll( $objectsList ) {
        $this->objects = array_merge($this->objects,$objectsList);
    }
    /**
     * This will set an object at a specific index.
     *
     * @param index zero based index into array.
     * @param object The object to set.
     */
    public function set( $index, $object ) {
		if ($object instanceof COSObjectable) $object = $object->getCOSObject();
        $this->objects[$index] = $object;
    }
    /**
     * This will get an object from the array.  This will dereference the object.
     * If the object is COSNull then null will be returned.
     *
     * @param index The index into the array to get the object.
     *
     * @return The object at the requested index.
     */
    public function getObject( $index ) {
		if (!is_integer($index)) return null;
		if (!isset($this->objects[$index])) return null;
        $obj = $this->objects[$index];
        if( $obj instanceof COSObject ) {
            return $obj->getObject();
        }
        return $obj;
    }

    /**
     * This will get an object from the array.  This will NOT dereference
     * the COS object.
     *
     * @param index The index into the array to get the object.
     *
     * @return The object at the requested index.
     */
    public function get( $index ) {
		if (!is_integer($index)) return null;
		if (!isset($this->objects[$index])) return null;
        return $this->objects[$index];
    }
    /**
     * Get the value of the array as an integer, return the default if it does
     * not exist.
     *
     * @param index The value of the array.
     * @param defaultValue The value to return if the value is null.
     * @return The value at the index or the defaultValue.
     */
    public function getInt( $index, $defaultValue=-1 ) {
        $retval = $defaultValue;
		if (!is_integer($index)) return $retval;
        if ( $index < $this->size() ) {
			if (is_numeric($this->objects[$index])) $retval = floor($this->objects[$index]);
        }
        return $retval;
    }
    /**
     * Set the value in the array as an integer.
     *
     * @param index The index into the array.
     * @param value The value to set.
     */
    public function setInt( $index,$value ) {
        $this->set( $index, 0+$value );
    }

    /**
     * Set the value in the array as a name.
     * @param index The index into the array.
     * @param name The name to set in the array.
     */
    public function setName( $index, $name ) {
        $this->set( $index, COSName::getPDFName( $name ) );
    }
    /**
     * Get an entry in the array that is expected to be a COSName.
     * @param index The index into the array.
     * @param defaultValue The value to return if it is null.
     * @return The value at the index or defaultValue if none is found.
     */
    public function getName( $index, $defaultValue=null ) {
        $retval = $defaultValue;
        if( $index < $this->size() ) {
            $obj = $this->objects[$index];
            if( $obj instanceof COSName ) {
                $retval = $obj->getName();
            }
        }
        return $retval;
    }
    /**
     * Set the value in the array as a string.
     * @param index The index into the array.
     * @param string The string to set in the array.
     */
    public function setString( $index, $string ) {
		if (!is_integer($index) || !is_string($string)) return;
        if ( !is_null($string) ) {
            $this->set( $index, $string );
        } else {
            $this->set( $index, null );
        }
    }
    /**
     * Get an entry in the array that is expected to be a COSName.
     * @param index The index into the array.
     * @param defaultValue The value to return if it is null.
     * @return The value at the index or defaultValue if none is found.
     */
    public function getString( $index, $defaultValue=null ) {
		if (!is_integer($index) || !isset($this->objects[$index])) return $defaultValue;
		if (!is_string($this->objects[$index])) return $defaultValue;
		return $this->objects[$index];
    }
    /**
     * This will get the size of this array.
     *
     * @return The number of elements in the array.
     */
    public function size() {
        return count($this->objects);
    }

    /**
     * This will remove an element from the array.
     *
     * @param i The index of the object to remove.
     * @param o The object to remove.
     *
     * @return The object that was removed, if an index was supplied.
     * @return true if the object was removed, false
     *  otherwise
     */
    public function remove( $what ) {
		if ($what instanceof COSBase) {
			$i = array_search($what,$this->objects);
			if ($i===false) return false;
			unset($this->objects[$i]);
			return true;
		} elseif (is_integer($what)) {
			// This could be either a key or a value.  We're going to assume a key if one exists, or object if it doesn't.
			if (isset($this->objects[$what])) {
				$obj = $this->objects[$what];
				unset($this->objects[$what]);
				return $obj;
			}
		}
		// The same logic as COSBase is duplicated here because of the uncertainty of the parameter.
		// It will be easier to make changes in the future based on the certainly level if they are split.
		$i = array_search($what,$this->objects);
		if ($i===false || is_null($i)) return false;
		unset($this->objects[$i]);
		return true;
    }
    /**
     * This will remove an element from the array.
     * This method will also remove a reference to the object.
     *
     * @param o The object to remove.
     * @return true if the object was removed, false
     *  otherwise
     */
    public function removeObject($o) {
		$i = array_search($o,$this->objects);
		if ($i===false || is_null($i)) $removed = false;
		else {
			unset($this->objects[$i]);
			$removed = true;
		}
        if (!$removed) {
            for ($i = 0; $i < $this->size(); $i++) {
                $entry = $this->objects[$i];
                if ($entry instanceof COSObject) {
                    $objEntry = $entry;
                    if ($objEntry->getObject()==$o) {
                        unset ($this->objects[$i]);
						return true;
                    }
                }
            }
        }
        return $removed;
    }
    /**
     * {@inheritDoc}
     */
    public function toString() {
        return "COSArray{".var_export($this->objects,true)."}";
    }
    /**
     * This will return the index of the entry or -1 if it is not found.
     *
     * @param object The object to search for.
     * @return The index of the object or -1.
     */
    public function indexOf( $object ) {
		$result = array_search($object,$this->objects);
		if (is_null($result) || $result===false) return -1;
		else return $result;
	}
    /**
     * This will return the index of the entry or -1 if it is not found.
     * This method will also find references to indirect objects.
     *
     * @param object The object to search for.
     * @return The index of the object or -1.
     */
    public function indexOfObject($object) {
        $retval = -1;
        for ($i = 0; $retval < 0 && $i < $this->size(); $i++) {
            $item = $this->objects[$i];
            if ($item==$object) {
                $retval = $i;
                break;
            } elseif ($item instanceof COSObject && $item->getObject()==$object) {
                $retval = $i;
                break;
            }
        }
        return $retval;
    }
    /**
     * This will add the object until the size of the array is at least
     * as large as the parameter.  If the array is already larger than the
     * parameter then nothing is done.
     *
     * @param size The desired size of the array.
     * @param object The object to fill the array with.
     */
    public function growToSize( $size, $object=null ) {
		array_pad($this->objects,$size,$object);
    }
    /**
     * visitor pattern double dispatch method.
     *
     * @param visitor The object to notify when visiting this object.
     * @return any object, depending on the visitor implementation, or null
     * @throws IOException If an error occurs while visiting this object.
     */
    public function accept($visitor) {
		if (!($visitor instanceof ICOSVisitor)) return null;
        return $visitor->visitFromArray($this);
    }
    /**
     * This will take an COSArray of numbers and convert it to a float[].
     *
     * @return This COSArray as an array of float numbers.
     */
    public function toFloatArray() {
        $retval = array();
		array_pad($retval,count($this->objects),0.00);
        for( $i=0; $i<$this->size(); $i++ ) {
            $retval[$i] = 0.00+$this->getObject($i);
        }
        return $retval;
    }
    /**
     * Clear the current contents of the COSArray and set it with the float[].
     *
     * @param value The new value of the float array.
     */
    public function setFloatArray( $value ) {
		if (is_array($value)) $this->objects = $value;
    }
}
?>


text:
from __future__ import absolute_import

from unittest import skipIf

from django.template import TemplateSyntaxError

from .test_dummy import TemplateStringsTests

try:
    import jinja2
except ImportError:
    jinja2 = None
    Jinja2 = None
else:
    from django.template.backends.jinja2 import Jinja2

@skipIf(jinja2 is None, "this test requires jinja2")
class Jinja2Tests(TemplateStringsTests):

    engine_class = Jinja2
    backend_name = 'jinja2'
    options = {'keep_trailing_newline': True}

    def test_origin(self):
        template = self.engine.get_template('template_backends/hello.html')
        self.assertTrue(template.origin.name.endswith('hello.html'))
        self.assertEqual(template.origin.template_name, 'template_backends/hello.html')

    def test_origin_from_string(self):
        template = self.engine.from_string('Hello!\n')
        self.assertEqual(template.origin.name, '<template>')
        self.assertEqual(template.origin.template_name, None)

    def test_self_context(self):
        """
        Using 'self' in the context should not throw errors (#24538).
        """
        # self will be overridden to be a TemplateReference, so the self
        # variable will not come through. Attempting to use one though should
        # not throw an error.
        template = self.engine.from_string('hello {{ foo }}!')
        content = template.render(context={'self': 'self', 'foo': 'world'})
        self.assertEqual(content, 'hello world!')

    def test_exception_debug_info_min_context(self):
        with self.assertRaises(TemplateSyntaxError) as e:
            self.engine.get_template('template_backends/syntax_error.html')
        debug = e.exception.template_debug
        self.assertEqual(debug['after'], '')
        self.assertEqual(debug['before'], '')
        self.assertEqual(debug['during'], '{% block %}')
        self.assertEqual(debug['bottom'], 1)
        self.assertEqual(debug['top'], 0)
        self.assertEqual(debug['line'], 1)
        self.assertEqual(debug['total'], 1)
        self.assertEqual(len(debug['source_lines']), 1)
        self.assertTrue(debug['name'].endswith('syntax_error.html'))
        self.assertTrue('message' in debug)

    def test_exception_debug_info_max_context(self):
        with self.assertRaises(TemplateSyntaxError) as e:
            self.engine.get_template('template_backends/syntax_error2.html')
        debug = e.exception.template_debug
        self.assertEqual(debug['after'], '')
        self.assertEqual(debug['before'], '')
        self.assertEqual(debug['during'], '{% block %}')
        self.assertEqual(debug['bottom'], 26)
        self.assertEqual(debug['top'], 5)
        self.assertEqual(debug['line'], 16)
        self.assertEqual(debug['total'], 31)
        self.assertEqual(len(debug['source_lines']), 21)
        self.assertTrue(debug['name'].endswith('syntax_error2.html'))
        self.assertTrue('message' in debug)


text:
<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              style="@style/Match"
              android:orientation="vertical">

  <fragment
            android:id="@+id/map"
            style="@style/Match"
            android:layout_weight="0.2"
            android:name="com.novoda.mapdemo.fragment.NovodaMapFragment"/>

  <fragment
            android:id="@+id/image_fragment"
            style="@style/Match"
            android:layout_weight="0.8"
            android:name="com.novoda.mapdemo.fragment.SomeOtherFragment"/>

</LinearLayout>


text:
package com.vaadin.v7.client.widget.grid.events;

import com.google.gwt.event.shared.EventHandler;

/**
 * Handler for a Grid column reorder event, called when the Grid's columns has
 * been reordered.
 *
 * @param <T>
 *            The row type of the grid. The row type is the POJO type from where
 *            the data is retrieved into the column cells.
 * @since 7.5.0
 * @author Vaadin Ltd
 */
public interface ColumnReorderHandler<T> extends EventHandler {

    /**
     * A column reorder event, fired by Grid when the columns of the Grid have
     * been reordered.
     *
     * @param event
     *            column reorder event
     */
    public void onColumnReorder(ColumnReorderEvent<T> event);
}


text:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Login_model extends CI_Model {
	function __construct() {
		parent::__construct();
	}

	function check_user_account($username, $password) {
		$this->db->select('*');
		$this->db->from('sipp_users');
		$this->db->where('user_username', $username);
		$this->db->where('user_password', $password);
		$this->db->where('user_status', 'Active');

		return $this->db->get();
	}

	function get_user($username) {
		$this->db->select('*');
		$this->db->from('sipp_users');
		$this->db->where('user_username', $username);

		return $this->db->get();
	}
}
/* Location: ./application/model/Login_model.php */


text:
/* $Id: json_test.c 4761 2014-02-24 09:02:44Z nanang $ */
/*
 * Copyright (C) 2013 Teluu Inc. (http://www.teluu.com)
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
#include "test.h"

#define THIS_FILE	"json_test.c"

#if INCLUDE_JSON_TEST

#include <pjlib-util/json.h>
#include <pj/log.h>
#include <pj/string.h>

static char json_doc1[] =
"{\
    \"Object\": {\
       \"Integer\":  800,\
       \"Negative\":  -12,\
       \"Float\": -7.2,\
       \"String\":  \"A\\tString with tab\",\
       \"Object2\": {\
           \"True\": true,\
           \"False\": false,\
           \"Null\": null\
       },\
       \"Array1\": [116, false, \"string\", {}],\
       \"Array2\": [\
	    {\
        	   \"Float\": 123.,\
	    },\
	    {\
		   \"Float\": 123.,\
	    }\
       ]\
     },\
   \"Integer\":  800,\
   \"Array1\": [116, false, \"string\"]\
}\
";

static int json_verify_1()
{
    pj_pool_t *pool;
    pj_json_elem *elem;
    char *out_buf;
    unsigned size;
    pj_json_err_info err;

    pool = pj_pool_create(mem, "json", 1000, 1000, NULL);

    size = (unsigned)strlen(json_doc1);
    elem = pj_json_parse(pool, json_doc1, &size, &err);
    if (!elem) {
	PJ_LOG(1, (THIS_FILE, "  Error: json_verify_1() parse error"));
	goto on_error;
    }

    size = (unsigned)strlen(json_doc1) * 2;
    out_buf = pj_pool_alloc(pool, size);

    if (pj_json_write(elem, out_buf, &size)) {
	PJ_LOG(1, (THIS_FILE, "  Error: json_verify_1() write error"));
	goto on_error;
    }

    PJ_LOG(3,(THIS_FILE, "Json document:\n%s", out_buf));
    pj_pool_release(pool);
    return 0;

on_error:
    pj_pool_release(pool);
    return 10;
}

int json_test(void)
{
    int rc;

    rc = json_verify_1();
    if (rc)
	return rc;

    return 0;
}

#else
int json_dummy;
#endif


text:
'use strict';

export default angular.module('<%- moduleName %>'<% if (deps) { %>, <%= JSON.stringify(deps) %><% } %>)
<% constants.forEach(function (constant) { %>
.constant('<%- constant.name %>', <%= constant.value %>)
<% }) %>
.name;


text:
/**
 *
 */
package de.martinreinhardt.owncloud.webtest.tests;

import javax.mail.MessagingException;
import javax.mail.internet.AddressException;

import org.apache.log4j.Logger;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;

import com.icegreen.greenmail.user.UserException;

import de.martinreinhardt.owncloud.webtest.RoundCube;
import de.martinreinhardt.owncloud.webtest.steps.AdminSteps;
import de.martinreinhardt.owncloud.webtest.util.EmailUserDetails;
import net.serenitybdd.junit.runners.SerenityRunner;
import net.thucydides.core.annotations.Issues;
import net.thucydides.core.annotations.Steps;
import net.thucydides.core.annotations.Story;
import net.thucydides.core.annotations.WithTag;
import net.thucydides.core.annotations.WithTags;
import net.thucydides.core.reports.adaptors.xunit.model.TestError;
import net.thucydides.junit.annotations.Concurrent;

/**
 * @author mreinhardt
 */
@Story(RoundCube.ManualLogin.class)
// @formatter:off
@WithTags({ @WithTag(type = "app", value = "RoundCube"),
		@WithTag(type = "feature", value = "user settings"),
		@WithTag(type = "feature", value = "login")
})
// @formatter:on
@RunWith(SerenityRunner.class)
@Concurrent(threads = "1")
public class RoundCubeSettingsIT extends RoundCubeMockedMailIT {

	// Logger
	protected static final Logger LOG = Logger
			.getLogger(RoundCubeSettingsIT.class);

	@Steps
	private AdminSteps adminSteps;

	@Test
	@Issues({ "#205", "#209", "#213", "#259", "#263" })
	public void test_roundcube_mail_without_autologin()
			throws AddressException, MessagingException, UserException,
			TestError {
		runEmailTest();
	}

	@Before
	public void setup() {
		// disable autologin
		endUserLogin.enter_login_area();
		endUserLogin.do_login("admin", "password");
		loggedInuserSteps.go_to_adminsettings_view();
		adminSteps.go_to_roundcube_advancedsettings();
		adminSteps.toggle_roundcube_autologin();
		adminSteps.apply_roundcube_settings();
		loggedInuserSteps.logout();
	}

	@Override
	public void executeTestStepsFrontend() throws TestError {
		LOG.info("Starting manual login direct as roundcube user");
		// manual login as user
		final EmailUserDetails ocLogin = getPositiveEmailUserWhichIsAOcUser();
		final EmailUserDetails rcLogin = getPositiveEmailUserWhichIsNoOcUser();
		endUserLogin.do_login(ocLogin.getUsername(), ocLogin.getPassword());
		try {
			loggedInuserSteps.go_to_user_settings();
			loggedInuserSteps.update_roundcube_login_and_save(
					rcLogin.getUsername(), rcLogin.getPassword());
			loggedInuserSteps.logout();
			endUserLogin.do_login(ocLogin.getUsername(), ocLogin.getPassword());
			loggedInuserSteps.go_to_roundcube_view();
			rcSteps.is_not_showing_errors();
			rcSteps.message_should_have_a_valid_subject();
			rcSteps.waitFor(20).seconds();
			rcSteps.is_not_showing_errors();
			loggedInuserSteps.go_to_user_settings();
		} finally {
			loggedInuserSteps.logout();
		}
		LOG.info("Done manual login direct as roundcube user");
	}

	@After
	public void reset() {
		// enable autologin again
		endUserLogin.do_login("admin", "password");
		loggedInuserSteps.go_to_adminsettings_view();
		adminSteps.go_to_roundcube_advancedsettings();
		adminSteps.toggle_roundcube_autologin();
		adminSteps.apply_roundcube_settings();
		loggedInuserSteps.logout();
	}
}


text:
package user

import (
	"context"
	"testing"

	"github.com/goharbor/harbor/src/common/models"
	"github.com/goharbor/harbor/src/common/utils"
	"github.com/goharbor/harbor/src/lib/errors"
	"github.com/goharbor/harbor/src/lib/q"
	"github.com/goharbor/harbor/src/testing/mock"
	"github.com/goharbor/harbor/src/testing/pkg/user/dao"
	"github.com/stretchr/testify/assert"
	testifymock "github.com/stretchr/testify/mock"
	"github.com/stretchr/testify/suite"
)

type mgrTestSuite struct {
	suite.Suite
	mgr Manager
	dao *dao.DAO
}

func (m *mgrTestSuite) SetupTest() {
	m.dao = &dao.DAO{}
	m.mgr = &manager{
		dao: m.dao,
	}
}

func (m *mgrTestSuite) TestCount() {
	m.dao.On("Count", mock.Anything, mock.Anything).Return(int64(1), nil)
	n, err := m.mgr.Count(context.Background(), nil)
	m.Nil(err)
	m.Equal(int64(1), n)
	m.dao.AssertExpectations(m.T())
}

func (m *mgrTestSuite) TestSetAdminFlag() {
	id := 9
	m.dao.On("Update", mock.Anything, testifymock.MatchedBy(
		func(u *models.User) bool {
			return u.UserID == 9 && u.SysAdminFlag
		}), "sysadmin_flag").Return(nil)
	err := m.mgr.SetSysAdminFlag(context.Background(), id, true)
	m.Nil(err)
	m.dao.AssertExpectations(m.T())
}

func (m *mgrTestSuite) TestOnboard() {
	existingUser := &models.User{
		UserID:   123,
		Username: "existing",
		Email:    "existing@mytest.com",
		Realname: "existing",
	}
	newID := 124
	m.dao.On("Create", mock.Anything, testifymock.MatchedBy(
		func(u *models.User) bool {
			return u.Username == "existing"
		})).Return(0, errors.ConflictError(nil).WithMessage("username exists"))
	m.dao.On("Create", mock.Anything, testifymock.MatchedBy(
		func(u *models.User) bool {
			return u.Username != "existing" && u.Username != "dup-but-not-existing"
		})).Return(newID, nil)
	m.dao.On("List", mock.Anything, testifymock.MatchedBy(
		func(query *q.Query) bool {
			return query.Keywords["username"] == "existing"
		})).Return([]*models.User{existingUser}, nil)
	m.dao.On("List", mock.Anything, testifymock.MatchedBy(
		func(query *q.Query) bool {
			return query.Keywords["username"] != "existing"
		})).Return([]*models.User{}, nil)

	{
		newUser := &models.User{
			Username: "newUser",
			Email:    "newUser@mytest.com",
			Realname: "newUser",
		}
		err := m.mgr.Onboard(context.Background(), newUser)
		m.Nil(err)
		m.Equal(newID, newUser.UserID)
		m.Equal(newUser.Username, newUser.Username)
	}
	{
		newUser := &models.User{
			Username: "existing",
			Email:    "existing@mytest.com",
			Realname: "existing",
		}
		err := m.mgr.Onboard(context.Background(), newUser)
		m.Nil(err)
		m.Equal(existingUser.Username, newUser.Username)
		m.Equal(existingUser.Email, newUser.Email)
		m.Equal(existingUser.UserID, newUser.UserID)
	}
}

func TestManager(t *testing.T) {
	suite.Run(t, &mgrTestSuite{})
}

func TestInjectPasswd(t *testing.T) {
	u := &models.User{
		UserID: 9,
	}
	p := "pass"
	injectPasswd(u, p)
	assert.Equal(t, "sha256", u.PasswordVersion)
	assert.Equal(t, utils.Encrypt(p, u.Salt, "sha256"), u.Password)
}


text:
Limits = {
   MinRange = 0,
   MaxRange = 9999,
   MinAltitude = -500,
   MaxAltitude = 9999,
}
-- Optional weapon slot to fire. If non-nil then an LWC is not needed.
-- However, script-fired weapons aren't governed by failsafes, so keep
-- that in mind...
-- Missile controllers on turrets should be assigned the same weapon slot
-- as their turret block.
MissileWeaponSlot = nil

-- Target selection algorithm for newly-launched missiles.
-- 1 = Focus on highest priority target
-- 2 = Pseudo-random split against all targetable targets
MissileTargetSelector = 1

-- NOTE: The following config is for javelin-style top-attack missiles.
-- There are more examples below it, including:
--  Sea-skimming pop-up missiles
--  Bottom-attack torpedoes
--  Sea-skimming duck-under missiles

-- Always be sure each setting ends with a comma!

Config = {
   -- GENERAL SETTINGS

   -- If the target's elevation (that is, altitude relative to the ground
   -- it is over) is below this, use the special attack profile (closing,
   -- middle, etc.).
   -- Note that the "ground" is capped at 0 (sea level), so keep this in
   -- mind for submarine targets. Their elevation will always be negative.
   -- If not using the special attack profile, it will intercept as normal.
   -- Set to like -999 to disable the special attack profile.
   -- Set it to like 9999 to always use the special attack profile.
   SpecialAttackElevation = 10,

   -- If the missile is ever below this altitude, it will head straight up.
   -- Set to -500 or lower for torpedoes.
   MinimumAltitude = 0,

   -- Thrust to use in AA mode, may be nil.
   DefaultThrust = nil,

   -- Optional detonation range in meters -- to simulate a proximity fuse
   -- Set to negative or nil to disable.
   DetonationRange = nil,

   -- If a detonation range is defined, and the angle between the missile
   -- velocity and the target vector is greater than this, detonate.
   -- This allows detonations on near misses, i.e. when the missile is
   -- about to pass the aim point.
   -- Set to 0 to base detonation solely on range.
   DetonationAngle = 30,

   -- Note: "RelativeTo" parameters should be one of
   -- 0 - Absolute
   -- 1 - Relative to target's altitude
   -- 2 - Relative to target's sea depth
   -- 3 - Relative to target's ground
   -- 4 - Relative to missile's altitude

   -- SPECIAL ATTACK PROFILE

   -- The missile can have up to 3 phases: closing, middle, terminal.
   -- To disable the middle phase, set MiddleDistance
   -- to nil.

   -- Distance to aim toward target when closing.
   -- Smaller means it will reach closing elevation/altitude sooner,
   -- but will need to make a steeper angle to do so.
   ClosingDistance = 50,

   -- Whether the closing phase takes place above or below sea level.
   -- This affects terrain hugging.
   ClosingAboveSeaLevel = true,

   -- Minimum distance above terrain (or sea level).
   ClosingElevation = 3,

   -- Closing altitude. Set to nil to only hug terrain.
   -- If set to a number, you should also set ClosingAltitudeRelativeTo.
   ClosingAltitude = 300,

   -- See the "RelativeTo" explanation above. Only used if ClosingAltitude
   -- is a number and not nil.
   ClosingAltitudeRelativeTo = 0,

   -- Closing phase thrust setting for variable thrusters. nil to disable.
   ClosingThrust = nil,

   -- Maximum angle between target & missile velocity in degrees before
   -- modifying thrust. nil to set thrust regardless of angle.
   ClosingThrustAngle = nil,

   -- "Evasion" settings while closing
   -- This simply makes the missile move side-to-side in a pseudo-random
   -- manner.
   -- First number is magnitude of evasion in meters (to each side)
   -- Second number is time scale, smaller is slower. <1 recommended.
   -- Set whole thing to nil to disable, e.g. Evasion = nil
   Evasion = { 20, .25 },

   -- Ground distance from target at which to perform the middle phase.
   -- Set to nil to disable.
   MiddleDistance = 300,

   -- Whether the middle phase takes place above or below sea level.
   -- This affects terrain hugging.
   MiddleAboveSeaLevel = true,

   -- Minimum distance above terrain (or sea level)
   MiddleElevation = 3,

   -- Middle phase altitude. Set to nil to only hug terrain.
   MiddleAltitude = 0,

   -- See the "RelativeTo" explanation above. Only used if
   -- MiddleAltitude is a number and not nil.
   MiddleAltitudeRelativeTo = 4,

   -- Middle phase thrust setting for variable thrusters.
   -- nil to disable.
   MiddleThrust = nil,

   -- Maximum angle between target & missile velocity in degrees before
   -- modifying thrust. nil to set thrust regardless of angle.
   MiddleThrustAngle = nil,

   -- Ground distance from target for terminal phase. During this phase,
   -- it will intercept the target as normal, i.e. aim straight for the
   -- predicted aim point.
   TerminalDistance = 150,

   -- Terminal phase thrust setting for variable thrusters. nil to disable.
   -- Set to -1 to burn all remaining fuel using estimated time to impact
   -- and estimated remaining fuel.
   TerminalThrust = nil,

   -- Maximum angle between target & missile velocity in degrees before
   -- modifying thrust. nil to set thrust regardless of angle.
   -- Setting this to a small number (e.g. 3 to 7 degrees) is recommended
   -- if TerminalThrust is non-nil.
   TerminalThrustAngle = nil,

   -- TERRAIN HUGGING

   -- How many seconds at current speed to look-ahead
   LookAheadTime = 2,

   -- Look-ahead resolution in meters. The smaller it is, the more samples
   -- will be taken (and more processing...)
   -- Set to 0 to disable terrain hugging, in which case the "ground"
   -- will always be assumed to be -500 or 0 (depending on the related
   -- sea level setting)
   LookAheadResolution = 0,
}

-- Sea-skimming pop-up missiles
-- Change "PopUpConfig" to simply "Config" to overwrite the
-- default profile.
PopUpConfig = {
   SpecialAttackElevation = 10,
   MinimumAltitude = 0,
   DefaultThrust = nil,
   DetonationRange = nil,
   DetonationAngle = 30,
   ClosingDistance = 50,
   ClosingAboveSeaLevel = true,
   ClosingElevation = 3,
   ClosingAltitude = nil,
   ClosingAltitudeRelativeTo = 0,
   ClosingThrust = nil,
   ClosingThrustAngle = nil,
   Evasion = { 20, .25 },
   MiddleDistance = 250,
   MiddleAboveSeaLevel = true,
   MiddleElevation = 3,
   MiddleAltitude = 30,
   MiddleAltitudeRelativeTo = 3,
   MiddleThrust = nil,
   MiddleThrustAngle = nil,
   TerminalDistance = 100,
   TerminalThrust = nil,
   TerminalThrustAngle = nil,
   LookAheadTime = 2,
   LookAheadResolution = 3,
}

-- Bottom-attack torpedoes
-- Change "TorpedoConfig" to simply "Config" to overwrite the
-- default profile.
TorpedoConfig = {
   SpecialAttackElevation = 9999, -- Always use special attack profile
   MinimumAltitude = -500,
   DefaultThrust = nil,
   DetonationRange = nil,
   DetonationAngle = 30,
   ClosingDistance = 50,
   ClosingAboveSeaLevel = false,
   ClosingElevation = 10, -- i.e. Minimum altitude above seabed
   ClosingAltitude = -50,
   ClosingAltitudeRelativeTo = 2, -- i.e. relative to target's depth, which is never more than 0
   ClosingThrust = nil,
   ClosingThrustAngle = nil,
   Evasion = nil,
   MiddleDistance = nil, -- No middle phase
   MiddleAboveSeaLevel = true,
   MiddleElevation = 3,
   MiddleAltitude = 30,
   MiddleAltitudeRelativeTo = 3,
   MiddleThrust = nil,
   MiddleThrustAngle = nil,
   TerminalDistance = 175,
   TerminalThrust = nil,
   TerminalThrustAngle = nil,
   LookAheadTime = 2,
   LookAheadResolution = 3,
}

-- Sea-skimming duck-under missiles
-- Change "DuckUnderConfig" to simply "Config" to overwrite the
-- default profile.
-- Needs a lot of experimentation, but the following settings
-- work for me using 6-block missiles: Fin x3, Var thruster (300 thrust),
-- Torpedo prop, Fuel x2, Lua receiver, Warhead x4.
DuckUnderConfig = {
   SpecialAttackElevation = 10,
   MinimumAltitude = -50, -- Should be lower than MiddleAltitude
   DefaultThrust = nil,
   DetonationRange = nil,
   DetonationAngle = 30,
   ClosingDistance = 50,
   ClosingAboveSeaLevel = true,
   ClosingElevation = 3,
   ClosingAltitude = nil,
   ClosingAltitudeRelativeTo = 0,
   ClosingThrust = nil,
   ClosingThrustAngle = nil,
   Evasion = { 20, .25 },
   MiddleDistance = 110,
   MiddleAboveSeaLevel = false,
   MiddleElevation = 10,
   MiddleAltitude = -25,
   MiddleAltitudeRelativeTo = 2, -- i.e. 25 meters below target's depth
   MiddleThrust = nil,
   MiddleThrustAngle = nil,
   TerminalDistance = 50,
   TerminalThrust = nil,
   TerminalThrustAngle = nil,
   LookAheadTime = 2,
   LookAheadResolution = 3,
}


text:
package com.checkline.dpro;

import java.io.IOException;
import java.io.InputStream;
import java.util.concurrent.BlockingQueue;

public class SerialReader implements Runnable {
	InputStream in;
    BlockingQueue<String> bq = null;
    protected boolean running = false;

    public SerialReader ( InputStream in, BlockingQueue<String> bq ) {
    	this.in = in;
    	this.bq = bq;
    }

    public void startThread() {
    	this.running = true;
    }

    public void stopThread() {
    	this.running = false;
    }

    public void run () {
	        byte[] buffer = new byte[1024];
	        int len = -1;
	        String line;
	        try {
	            while (this.running && ( len = this.in.read(buffer)) > -1 ) {
	            	line = new String(buffer,0,len);
	            	this.bq.put(line);
	            }
	        }
	        catch ( IOException | InterruptedException e ) {
	            e.printStackTrace();
	        }
    }

	public void addStream(InputStream inputStream) {
		this.in = inputStream;
	}

	public void removeStream() {
		this.in = null;
	}
}


text:
package gov.va.med.imaging.exchange.business.dicom.importer;

import gov.va.med.imaging.exchange.business.Patient;
import gov.va.med.imaging.exchange.business.PersistentEntity;
import gov.va.med.imaging.exchange.business.dicom.DicomUtils;

import java.util.ArrayList;
import java.util.List;

import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.datatype.XMLGregorianCalendar;

@XmlRootElement
public class Study implements PersistentEntity
{

	private int id;
	private int idInMediaBundle;
    private String uid;
    private String accessionNumber;
    private String studyDate;
    private String studyTime;
    private String description;
    private String referringPhysician;
	private String imageStatistics;
    private Patient patient;
    private String procedure;
    private String modalitiesInStudy = null;
    private String importStatus;
    private boolean toBeDeletedOnly;
    private int totalNumberOfImagesInStudy;
    private int numberOfImagesAlreadyImported;
    private List<Series> series = new ArrayList<Series>();
    private Reconciliation reconciliation;
	private boolean failedImport;
	private String importErrorMessage;
    private Patient previouslyReconciledPatient;
    private Order previouslyReconciledOrder;
    private String originIndex;

	/**
     * Gets the value of the id property.
     *
     */
    public int getId() {
        return idInMediaBundle;
    }

    /**
     * Sets the value of the id property.
     *
     */
    public void setId(int value) {
        this.idInMediaBundle = value;
    }

    /**
     * Gets the value of the idInMediaBundle property.
     *
     */
    public int getIdInMediaBundle() {
        return idInMediaBundle;
    }

    /**
     * Sets the value of the idInMediaBundle property.
     *
     */
    public void setIdInMediaBundle(int value) {
        this.idInMediaBundle = value;
    }

    /**
     * Gets the value of the uid property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getUid() {
        return uid;
    }

    /**
     * Sets the value of the uid property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setUid(String value) {
        this.uid = value;
    }

    /**
     * Gets the value of the accessionNumber property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getAccessionNumber() {
        return accessionNumber;
    }

    /**
     * Sets the value of the accessionNumber property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setAccessionNumber(String value) {
        this.accessionNumber = value;
    }

    /**
     * Gets the value of the studyDate property.
     *
     * @return
     *     possible object is
     *     {@link XMLGregorianCalendar }
     *
     */
    public String getStudyDate() {
        return studyDate;
    }

    /**
     * Sets the value of the studyDate property.
     *
     * @param value
     *     allowed object is
     *     {@link XMLGregorianCalendar }
     *
     */
    public void setStudyDate(String value) {
        this.studyDate = value;
    }

    public String getStudyTime() {
		return studyTime;
	}

	public void setStudyTime(String studyTime) {
		this.studyTime = studyTime;
	}

    /**
     * Gets the value of the description property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getDescription() {
        return description;
    }

    /**
     * Sets the value of the description property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setDescription(String value) {
        this.description = value;
    }

    /**
     * Gets the value of the imageStatistics property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getImageStatistics() {
        return imageStatistics;
    }

    /**
     * Sets the value of the imageStatistics property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setImageStatistics(String value) {
        this.imageStatistics = value;
    }

    /**
     * Gets the value of the patient property.
     *
     * @return
     *     possible object is
     *     {@link Patient }
     *
     */
    public Patient getPatient() {
        return patient;
    }

    /**
     * Sets the value of the patient property.
     *
     * @param value
     *     allowed object is
     *     {@link Patient }
     *
     */
    public void setPatient(Patient value) {
        this.patient = value;
    }

    /**
     * Gets the value of the procedure property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getProcedure() {
        return procedure;
    }

    /**
     * Sets the value of the procedure property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setProcedure(String value) {
        this.procedure = value;
    }

    /**
     * Gets the value of the ImportStatus property.
     *
     */
    public String getImportStatus() {
        return importStatus;
    }

    /**
     * Sets the value of the ImportStatus property.
     *
     */
    public void setImportStatus(String value) {
        this.importStatus = value;
    }

    /**
     * Gets the value of the totalNumberOfImagesInStudy property.
     *
     */
    public int getTotalNumberOfImagesInStudy() {
        return totalNumberOfImagesInStudy;
    }

    /**
     * Sets the value of the totalNumberOfImagesInStudy property.
     *
     */
    public void setTotalNumberOfImagesInStudy(int value) {
        this.totalNumberOfImagesInStudy = value;
    }

    /**
     * Gets the value of the numberOfImagesAlreadyImported property.
     *
     */
    public int getNumberOfImagesAlreadyImported() {
        return numberOfImagesAlreadyImported;
    }

    /**
     * Sets the value of the numberOfImagesAlreadyImported property.
     *
     */
    public void setNumberOfImagesAlreadyImported(int value) {
        this.numberOfImagesAlreadyImported = value;
    }

    /**
     * Gets the value of the series property.
     *
     * @return
     *     possible object is
     *     {@link ArrayOfSeries }
     *
     */
    public List<Series> getSeries() {
        return series;
    }

    /**
     * Sets the value of the series property.
     *
     * @param value
     *     allowed object is
     *     {@link ArrayOfSeries }
     *
     */
    public void setSeries(List<Series> value) {
        this.series = value;
    }

	public void setModalitiesInStudy(String modalitiesInStudy) {
		this.modalitiesInStudy = modalitiesInStudy;
	}

	public String getModalitiesInStudy() {
		return modalitiesInStudy;
	}
    public Reconciliation getReconciliation() {
		return reconciliation;
	}

	public void setReconciliation(Reconciliation reconciliation) {
		this.reconciliation = reconciliation;
	}

	public void clearAllSeries()
	{
		setSeries(new ArrayList<Series>());
	}

	public void setToBeDeletedOnly(boolean toBeDeletedOnly) {
		this.toBeDeletedOnly = toBeDeletedOnly;
	}

	public boolean isToBeDeletedOnly() {
		return toBeDeletedOnly;
	}

	public void setReferringPhysician(String referringPhysician) {
		this.referringPhysician = DicomUtils.reformatDicomName(referringPhysician);
	}

	public String getReferringPhysician() {
		return referringPhysician;
	}

	public void setFailedImport(boolean failedImport) {
		this.failedImport = failedImport;
	}

	public boolean getFailedImport() {
		return failedImport;
	}

	public void setImportErrorMessage(String importErrorMessage) {
		this.importErrorMessage = importErrorMessage;
	}

	public String getImportErrorMessage() {
		return importErrorMessage;
	}

	public void setPreviouslyReconciledPatient(
			Patient previouslyReconciledPatient) {
		this.previouslyReconciledPatient = previouslyReconciledPatient;
	}

	public Patient getPreviouslyReconciledPatient() {
		return previouslyReconciledPatient;
	}

	public void setPreviouslyReconciledOrder(Order previouslyReconciledOrder) {
		this.previouslyReconciledOrder = previouslyReconciledOrder;
	}

	public Order getPreviouslyReconciledOrder() {
		return previouslyReconciledOrder;
	}

	public void setOriginIndex(String originIndex) {
		this.originIndex = originIndex;
	}

	public String getOriginIndex() {
		return originIndex;
	}
}


text:
<?php
/**
 * Storefront Powerpack Customizer Layout Class
 *
 * @author   WooThemes
 * @package  Storefront_Powerpack
 * @since    1.0.0
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

if ( ! class_exists( 'SP_Customizer_Layout' ) ) :

	/**
	 * The Customizer class.
	 */
	class SP_Customizer_Layout extends SP_Customizer {

		/**
		 * The id of this section.
		 *
		 * @const string
		 */
		const POWERPACK_LAYOUT_SECTION = 'sp_layout_section';

		/**
		 * Returns an array of the Storefront Powerpack setting defaults.
		 *
		 * @return array
		 * @since 1.0.0
		 */
		public function setting_defaults() {
			return $args = array(
				'sp_max_width'                => 'default',
				'sp_content_frame'            => 'default',
				'sp_content_frame_background' => '#ffffff'
			);
		}

		/**
		 * Customizer Controls and Settings
		 *
		 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
		 * @since 1.0.0
		 */
		public function customize_register( $wp_customize ) {
			/**
			* Layout Section
			*/
			$wp_customize->add_section( self::POWERPACK_LAYOUT_SECTION, array(
				'title'    => __( 'Layout', 'storefront-powerpack' ),
				'panel'    => self::POWERPACK_PANEL,
				'priority' => 20,
			) );

			/**
			 * Max width
			 */
			$wp_customize->add_setting( 'sp_max_width', array(
				'sanitize_callback' => 'storefront_sanitize_choices',
			) );

			$wp_customize->add_control( new SP_Buttonset_Control( $wp_customize, 'sp_max_width', array(
				'label'       => __( 'Page layout', 'storefront-powerpack' ),
				'description' => __( 'Define the width of your site content.', 'storefront-powerpack' ),
				'section'     => self::POWERPACK_LAYOUT_SECTION,
				'settings'    => 'sp_max_width',
				'type'        => 'select',
				'priority'    => 10,
				'choices'     => array(
					'default'   => 'Default',
					'max-width' => 'Max Width',
				),
			) ) );

			/**
			 * Content frame
			 */
			$wp_customize->add_setting( 'sp_content_frame', array(
				'sanitize_callback' => 'storefront_sanitize_choices',
			) );

			$wp_customize->add_control( new SP_Buttonset_Control( $wp_customize, 'sp_content_frame', array(
				'label'       => __( 'Content frame', 'storefront-powerpack' ),
				'description' => __( 'Wraps the site content in a frame, offsetting it from the background.', 'storefront-powerpack' ),
				'section'     => self::POWERPACK_LAYOUT_SECTION,
				'settings'    => 'sp_content_frame',
				'type'        => 'select',
				'priority'    => 20,
				'choices'     => array(
					'default'  => 'Default',
					'frame'    => 'Frame',
				),
			) ) );

			/**
			 * Content frame background
			 */
			$wp_customize->add_setting( 'sp_content_frame_background', array(
				'sanitize_callback' => 'sanitize_hex_color',
			) );

			$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'sp_content_frame_background', array(
				'label'	          => __( 'Content background color', 'storefront-powerpack' ),
				'section'         => self::POWERPACK_LAYOUT_SECTION,
				'settings'        => 'sp_content_frame_background',
				'active_callback' => array( $this, 'is_content_frame_active' ),
				'priority'        => 30,
			) ) );
		}

		/**
		 * Checks if the page currently being previewed is not a shop page
		 *
		 * @return bool
		 * @since  1.0.0
		 */
		public function is_content_frame_active() {
			if ( 'frame' === get_theme_mod( 'sp_content_frame' ) ) {
				return true;
			}

			return false;
		}
	}

endif;

return new SP_Customizer_Layout();


text:
package com.intellij.ide.macro;

import com.intellij.ide.IdeBundle;
import com.intellij.javadoc.JavadocConfiguration;
import com.intellij.javadoc.JavadocGenerationManager;
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.project.Project;

import java.io.File;

public final class JavaDocPathMacro extends Macro {
  public String getName() {
    return "JavaDocPath";
  }

  public String getDescription() {
    return IdeBundle.message("macro.javadoc.output.directory");
  }

  public String expand(DataContext dataContext) {
    final Project project = CommonDataKeys.PROJECT.getData(dataContext);
    if (project == null) {
      return null;
    }
    JavadocGenerationManager manager = project.getComponent(JavadocGenerationManager.class);
    if (manager == null) {
      return null;
    }
    final JavadocConfiguration configuration = manager.getConfiguration();
    return configuration.OUTPUT_DIRECTORY == null ? null : configuration.OUTPUT_DIRECTORY.replace('/', File.separatorChar);
  }
}


text: {{host.hostname}}


text:
package graph.ordering.circular;

import graph.elements.Edge;
import graph.elements.Graph;
import graph.elements.Vertex;

import java.util.ArrayList;
import java.util.List;

/**
 * A graph containing triangulated edges. Used
 * to implement algorithm CIRCULAR
 * @author Renata
 * @param <V> The vertex type
 * @param <E> The edge type
 */
public class GraphCopy<V extends Vertex, E extends Edge<V>> extends Graph<V, E> {

	/**
	 * Triangulated edges, defined in CIRCULAR
	 */
	private List<TriangulatedEdge<V>> triangulatedEdges = new ArrayList<TriangulatedEdge<V>>();

	public GraphCopy(){
		super();
	}

	public GraphCopy(List<V> vertices, List<E> edges) {
		super(vertices, edges);
	}

	/**
	 * Adds a triangulated edge between the given two vertices
	 * @param v1 The first vertex
	 * @param v2 The second vertex
	 * @return Created triangulated edge
	 */
	public TriangulatedEdge<V> addTriangulatedEdge(V v1, V v2){
		TriangulatedEdge<V> te = new TriangulatedEdge<V>(v1, v2);
		triangulatedEdges.add(te);
		return te;
	}

	@Override
	/**
	 * Overrides vertex degree in order to take triangulated
	 * edges into account
	 */
	public int vertexDegree(V v){
		int degree = 0;
		for (E e : edges)
			if (e.getOrigin() == v || e.getDestination() == v)
				degree ++;
		for (TriangulatedEdge<V> te : triangulatedEdges)
			if (te.getOrigin() == v || te.getDestination() == v)
				degree ++;
		return degree;
	}

	@Override
	/**
	 * Overrides hasEdge in order to take triangulated
	 * edges into account
	 */
	public boolean hasEdge(V v1, V v2){
		for (E e : adjacentLists.get(v1))
			if (e.getDestination() == v2)
				return true;
		if (!directed)
			for (E e : adjacentLists.get(v2))
				if (e.getDestination() == v1)
					return true;

		for (TriangulatedEdge<V> te : triangulatedEdges){
			if ((te.getDestination() == v1 && te.getOrigin() == v2)
					|| (te.getOrigin() == v1 && te.getDestination() == v2))
				return true;
		}
		return false;
	}

	/**
	 * Removes an edge from the graph, checking if it is
	 * a triangulated edge or a regular one
	 * @param e Edge
	 */
	@SuppressWarnings("unchecked")
	public void removeEdgeWithTriangulated(Edge<V> e){
		if (e instanceof TriangulatedEdge<?>)
			triangulatedEdges.remove(e);
		else
			removeEdge((E) e);
	}

	/**
	 * Finds all vertices adjacent to the given vertex
	 * taking triangulated edges into account as well
	 * @param v The vertex
	 * @return A list of vertices adjacent to {@code v}
	 */
	public List<V> adjacentVerticesWithTriangulated(V v){
		List<V> ret = new ArrayList<V>();
		if (adjacentLists.get(v) != null)
			for (E e : adjacentLists.get(v)){
				V other = e.getDestination() != v ? e.getDestination() : e.getOrigin();
				if (! ret.contains(other))
					ret.add(other);
			}

		for (TriangulatedEdge<V> te : triangulatedEdges){
			if (te.getDestination() == v ||  te.getOrigin() == v){
				V other = te.getDestination() != v ? te.getDestination() : te.getOrigin();
				if (! ret.contains(other))
					ret.add(other);
			}
		}
		return ret;
	}

	/**
	 * Finds all edges adjacent to the given vertex
	 * taking triangulated edges into account as well
	 * @param v The vertex
	 * @return A list of edges adjacent to {@code v}
	 */
	public List<Edge<V>> allAdjacentEdgesWithTriangulated(V v){
		List<Edge<V>> ret = new ArrayList<Edge<V>>();
		if (adjacentLists.containsKey(v))
			ret.addAll(adjacentLists.get(v));
		for (TriangulatedEdge<V> te : triangulatedEdges)
			if (te.getDestination() == v ||  te.getOrigin() == v)
				ret.add(te);

		return ret;
	}

	/**
	 * Finds all edges between the given two vertices taking
	 * triangulated edges into account as well
	 * @param v1 The first vertex
	 * @param v2 The second vertex
	 * @return A list of edges between {@code v1} and {@code v2}
	 */
	public List<Edge<V>> edgeesBetweenWithTriangulated (V v1, V v2){
		List<Edge<V>> ret = new ArrayList<Edge<V>>();

		for (E e : adjacentLists.get(v1))
			if (e.getDestination() == v2)
				ret.add(e);
		if (!directed)
			for (E e : adjacentLists.get(v2))
				if (e.getDestination() == v1){
					ret.add(e);
				}
		for (TriangulatedEdge<V> te : triangulatedEdges){
			if ((te.getDestination() == v1 && te.getOrigin() == v2)
					|| (te.getOrigin() == v1 && te.getDestination() == v2))
				ret.add(te);
		}
		return ret;
	}

}


text:
var JSONAPIClient = require('./lib/JSONAPIClient');
var _ = require('lodash/dist/lodash.underscore');

var defaultOptions = {

};

function createBaseAPIClient(apiKey, clientOpts) {
  var clientOptions = _.extend({}, clientOpts || {}, {
    requestOptions: {
      headers: {
        'Accept': 'application/vnd.balancedpayments+json; version=1.1, application/vnd.api+json',
        'User-Agent': 'balanced-node/1.1.0'
      }
    }
  });

  if (apiKey) {
    clientOptions.requestOptions.auth = {
      user: apiKey,
      pass: ''
    };
  }

  var balanced = new JSONAPIClient('https://api.balancedpayments.com', clientOptions);
  balanced.registerType('api_key');

  return balanced;
};

function Balanced(apiKey, options) {
  // Extend the default options
  var opts = _.defaults(options || {}, Balanced.defaultOptions);

  // Create the balanced api client
  var balanced = createBaseAPIClient(apiKey, opts.client);

  balanced.registerType('marketplace', {
    'debits': '_',
    'reversals': '_',
    'customers': '_',
    'credits': '_',
    'cards': '_',
    'card_holds': '_',
    'refunds': '_',
    'transactions': '_',
    'bank_accounts': '_',
    'callbacks': '_',
    'events': '_'
  });

  balanced.marketplace = balanced.get('marketplaces').then(function(marketplace) {
    if (!marketplace) {
      return balanced._objects.marketplace.create().then(function(mp) {
        balanced.marketplace = mp;
        return mp;
      });
    }

    balanced.marketplace = marketplace;
    return marketplace;
  });

  balanced.registerType('customer', {
    add_card: setCustomer,
    add_bank_account: setCustomer,

    debits: '_',
    credits: '_',
    cards: '_',
    bank_accounts: '_',
    reversals: '_',
    refunds: '_',
    orders: '_',

    // are we removing source and destination from a customer?
    source: '_',
    destination: '_'
  });

  balanced.registerType('card', {
    debit: createTransaction('debit'),
    hold: createTransaction('card_hold'),

    associate_to_customer: associateCustomer,
    associateToCustomer: associateCustomer,
    associateCustomer: associateCustomer,

    customer: '_',
    debits: '_',
    card_holds: '_'
  });

  balanced.registerType('bank_account', {
    debit: createTransaction('debit'),
    credit: createTransaction('credit'),

    associate_to_customer: associateCustomer,
    associateToCustomer: associateCustomer,
    associateCustomer: associateCustomer,

    verify: createTransaction('bank_account_verification'),
    confirm: function(amount_1, amount_2) {
      return this.bank_account_verifications.get(0).confirm(amount_1, amount_2).thenResolve(this).refresh();
    },

    bank_account_verifications: '_',
    credits: '_',
    debits: '_',
    customer: '_',
    bank_account_verification: '_',
  });

  balanced.registerType('card_hold', {
    capture: createTransaction('debit'),
    void: function() {
      return this.unstore();
    },

    card: '_',
  });

  balanced.registerType('bank_account_verification', {
    confirm: function(amount_1, amount_2) {
      this.amount_1 = amount_1;
      this.amount_2 = amount_2;
      return this.save();
    },

    bank_account: '_',
  });

  balanced.registerType('callback');

  balanced.registerType('dispute', {
    events: '_'
  });

  balanced.registerType('debit', {
    refund: createTransaction('refund'),

    customer: '_',
    refunds: '_',
    order: '_',
    source: '_',
    events: '_'
  });

  balanced.registerType('credits', {
    reversal: createTransaction('reversal'),

    customer: '_',
    order: '_',
    destination: '_',
    events: '_'
  });

  balanced.registerType('event');

  balanced.registerType('order', {
    debit_from: function(source, args) {
      if (typeof args == 'number') {
        args = {
          amount: args
        };
      }

      args.order = this.href;
      return source.debit(args);
    },

    credit_to: function(destination, args) {
      if (typeof args == 'number') {
        args = {
          amount: args
        };
      }

      args.order = this.href;
      return destination.credit(args);
    },

    debits: '_',
    refunds: '_',
    credits: '_',
    reversals: '_',
    buyers: '_',
    merchant: '_',
  });

  balanced.registerType('refund', {
    debit: '_',
    order: '_',
    events: '_'
  });

  balanced.registerType('reversal', {
    credit: '_',
    order: '_',
    events: '_'
  });

  function setCustomer(obj) {
    return (_.isString(obj) ? balanced.get(obj) : balanced._createPromise(obj)).set('links.customer', this.id).save().thenResolve(this);
  };

  // _.extend(this, balanced);

  return balanced;
};

Balanced.configure = function(apiKey, options) {
   var b = Balanced(apiKey, options);
   return b;
};

Balanced.api_key = {
  create: function() {
    var b = createBaseAPIClient();
    return b.api_key.create();
  }
};

Balanced.defaultOptions = defaultOptions;

module.exports = Balanced;

function createTransaction(type) {
  return function(args) {
    if (typeof args == 'number') {
      args = {
        amount: args
      };
    }

    return this.create(type, args);
  };
};

function associateCustomer(customer) {
  this.links.customer = customer.id;
  return this.save();
};


text:
layout: post
category: Express
title: express3.x-调试
tags: ['express', '翻译']
author: 张可
email: zhangke@asiainfo.com
description: express3.x中文翻译
---
原文:<http://expressjs.com/guide/debugging.html>

# 调试 Express

Express 内部使用 debug 模块记录路由匹配、使用到的中间件、应用模式以及请求-响应循环。

>debug 有点像改装过的 console.log,不同的是,您不需要在生产代码中注释掉 debug。它会默认关闭,而且使用一个名为 DEBUG 的环境变量还可以打开。

在启动应用时,设置 DEBUG 环境变量为 express:*,可以查看 Express 中用到的所有内部日志。

	$ DEBUG=express:* node index.js
在 Windows 系统里,使用如下的命令。

	> set DEBUG=express:* & node index.js
在由 express 应用生成器 生成的默认应用中执行,会打印出如下信息:

	$ DEBUG=express:* node ./bin/www
	  express:router:route new / +0ms
	  express:router:layer new / +1ms
	  express:router:route get / +1ms
	  express:router:layer new / +0ms
	  express:router:route new / +1ms
	  express:router:layer new / +0ms
	  express:router:route get / +0ms
	  express:router:layer new / +0ms
	  express:application compile etag weak +1ms
	  express:application compile query parser extended +0ms
	  express:application compile trust proxy false +0ms
	  express:application booting in development mode +1ms
	  express:router use / query +0ms
	  express:router:layer new / +0ms
	  express:router use / expressInit +0ms
	  express:router:layer new / +0ms
	  express:router use / favicon +1ms
	  express:router:layer new / +0ms
	  express:router use / logger +0ms
	  express:router:layer new / +0ms
	  express:router use / jsonParser +0ms
	  express:router:layer new / +1ms
	  express:router use / urlencodedParser +0ms
	  express:router:layer new / +0ms
	  express:router use / cookieParser +0ms
	  express:router:layer new / +0ms
	  express:router use / stylus +90ms
	  express:router:layer new / +0ms
	  express:router use / serveStatic +0ms
	  express:router:layer new / +0ms
	  express:router use / router +0ms
	  express:router:layer new / +1ms
	  express:router use /users router +0ms
	  express:router:layer new /users +0ms
	  express:router use / <anonymous> +0ms
	  express:router:layer new / +0ms
	  express:router use / <anonymous> +0ms
	  express:router:layer new / +0ms
	  express:router use / <anonymous> +0ms
	  express:router:layer new / +0ms
当应用收到请求时,能看到 Express 代码中打印出的日志。

	  express:router dispatching GET / +4h
	  express:router query  : / +2ms
	  express:router expressInit  : / +0ms
	  express:router favicon  : / +0ms
	  express:router logger  : / +1ms
	  express:router jsonParser  : / +0ms
	  express:router urlencodedParser  : / +1ms
	  express:router cookieParser  : / +0ms
	  express:router stylus  : / +0ms
	  express:router serveStatic  : / +2ms
	  express:router router  : / +2ms
	  express:router dispatching GET / +1ms
	  express:view lookup "index.jade" +338ms
	  express:view stat "/projects/example/views/index.jade" +0ms
	  express:view render "/projects/example/views/index.jade" +1ms
设置 DEBUG 的值为 express:router,只查看路由部分的日志;设置 DEBUG 的值为 express:application,只查看应用部分的日志,依此类推。

# 通过 express 生成应用
通过 express 命令行生成的应用也使用了 debug 模块,它的命名空间限制在应用中。

如果您通过下述命令生成应用:

	$ express sample-app
则可通过下述命令打开调试信息:

	$ DEBUG=sample-app node ./bin/www
可通过逗号隔开的名字列表来指定多个调试命名空间,如下所示:

	$ DEBUG=http,mail,express:* node index.js
请查阅 调试指南 获取更多有关 debug 的文档。