text:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Guidelines and recommendations on Selenium documentatie</title>
    <link>https://seleniumhq.github.io/docs/site/nl/guidelines_and_recommendations/</link>
    <description>Recent content in Guidelines and recommendations on Selenium documentatie</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-US</language>
    <copyright>2013-{year}</copyright>

	<atom:link href="https://seleniumhq.github.io/docs/site/nl/guidelines_and_recommendations/index.xml" rel="self" type="application/rss+xml" />

    <item>
      <title>Page object models</title>
      <link>https://seleniumhq.github.io/docs/site/nl/guidelines_and_recommendations/page_object_models/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>

      <guid>https://seleniumhq.github.io/docs/site/nl/guidelines_and_recommendations/page_object_models/</guid>
      <description>Page being translated from English to Dutch. Do you speak Dutch? Help us to translate it by sending us pull requests!
 Page Object is a Design Pattern which has become popular in test automation for enhancing test maintenance and reducing code duplication. A page object is an object-oriented class that serves as an interface to a page of your AUT. The tests then use the methods of this page object class whenever they need to interact with that page of the UI.</description>
    </item>

    <item>
      <title>Domain specific language</title>
      <link>https://seleniumhq.github.io/docs/site/nl/guidelines_and_recommendations/domain_specific_language/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>

      <guid>https://seleniumhq.github.io/docs/site/nl/guidelines_and_recommendations/domain_specific_language/</guid>
      <description>Page being translated from English to Dutch. Do you speak Dutch? Help us to translate it by sending us pull requests!
 A domain specific language (DSL) is a system which provides the user with an expressive means of solving a problem. It allows a user to interact with the system on their terms – not just programmer-speak.
Your users, in general, don&rsquo;t care how your site looks. They don&rsquo;t care about the decoration, animations, or graphics.</description>
    </item>

    <item>
      <title>Generating application state</title>
      <link>https://seleniumhq.github.io/docs/site/nl/guidelines_and_recommendations/generating_application_state/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>

      <guid>https://seleniumhq.github.io/docs/site/nl/guidelines_and_recommendations/generating_application_state/</guid>
      <description>Page being translated from English to Dutch. Do you speak Dutch? Help us to translate it by sending us pull requests!
 Selenium should not be used to prepare a test case. All repetitive actions, and preparation for a test case, should be done through other methods. For example, most web UIs have authentication (e.g. a login form). Eliminating logging in via web browser before every test will improve both the speed and stability of the test.</description>
    </item>

    <item>
      <title>Mock external services</title>
      <link>https://seleniumhq.github.io/docs/site/nl/guidelines_and_recommendations/mock_external_services/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>

      <guid>https://seleniumhq.github.io/docs/site/nl/guidelines_and_recommendations/mock_external_services/</guid>
      <description>Page being translated from English to Dutch. Do you speak Dutch? Help us to translate it by sending us pull requests!
 Eliminating the dependencies on external services will greatly improve the speed and stability of your tests.</description>
    </item>

    <item>
      <title>Improved reporting</title>
      <link>https://seleniumhq.github.io/docs/site/nl/guidelines_and_recommendations/improved_reporting/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>

      <guid>https://seleniumhq.github.io/docs/site/nl/guidelines_and_recommendations/improved_reporting/</guid>
      <description>Page being translated from English to Dutch. Do you speak Dutch? Help us to translate it by sending us pull requests!
 Selenium is not designed to report on the status of test cases run. Taking advantage of the built-in reporting capabilities of unit test frameworks is a good start. Most unit test frameworks have reports that can generate xUnit or HTML formatted reports. xUnit reports are popular for importing results to a Continuous Integration (CI) server like Jenkins, Travis, Bamboo, etc.</description>
    </item>

    <item>
      <title>Avoid sharing state</title>
      <link>https://seleniumhq.github.io/docs/site/nl/guidelines_and_recommendations/avoid_sharing_state/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>

      <guid>https://seleniumhq.github.io/docs/site/nl/guidelines_and_recommendations/avoid_sharing_state/</guid>
      <description>Page being translated from English to Dutch. Do you speak Dutch? Help us to translate it by sending us pull requests!
 Although mentioned in several places it is worth mentioning again. Ensure tests are isolated from one another.
Don&rsquo;t share test data. Imagine several tests that each query the database for valid orders before picking one to perform an action on. Should two tests pick up the same order you are likely to get unexpected behaviour.</description>
    </item>

    <item>
      <title>Test independency</title>
      <link>https://seleniumhq.github.io/docs/site/nl/guidelines_and_recommendations/test_independency/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>

      <guid>https://seleniumhq.github.io/docs/site/nl/guidelines_and_recommendations/test_independency/</guid>
      <description>Page being translated from English to Dutch. Do you speak Dutch? Help us to translate it by sending us pull requests!
 Write each test as its own unit. Write the tests in a way that won&rsquo;t be reliant on other tests to complete:
Let&rsquo;s say there is a content management system with which you can create some custom content which then appears on your website as a module after publishing, and it may take some time to sync between the CMS and the application.</description>
    </item>

    <item>
      <title>Consider using a fluent API</title>
      <link>https://seleniumhq.github.io/docs/site/nl/guidelines_and_recommendations/consider_using_a_fluent_api/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>

      <guid>https://seleniumhq.github.io/docs/site/nl/guidelines_and_recommendations/consider_using_a_fluent_api/</guid>
      <description>Page being translated from English to Dutch. Do you speak Dutch? Help us to translate it by sending us pull requests!
 Martin Fowler coined the term &ldquo;Fluent API&rdquo;. Selenium already implements something like this in their FluentWait class which is meant as an alternative to the standard Wait class. You could enable the Fluent API design pattern in your page object and then query the Google search page with a code snippet like this one:</description>
    </item>

    <item>
      <title>Fresh browser per test</title>
      <link>https://seleniumhq.github.io/docs/site/nl/guidelines_and_recommendations/fresh_browser_per_test/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>

      <guid>https://seleniumhq.github.io/docs/site/nl/guidelines_and_recommendations/fresh_browser_per_test/</guid>
      <description>Page being translated from English to Dutch. Do you speak Dutch? Help us to translate it by sending us pull requests!
 Start each test from a clean known state. Ideally, spin up a new virtual machine for each test. If spinning up a new virtual machine is not practical, at least start a new WebDriver for each test. For Firefox, start a WebDriver with your known profile.</description>
    </item>

  </channel>
</rss>


text:
package mil.nga.giat.geowave.analytics.parameters;

import java.util.Arrays;
import java.util.Set;

import mil.nga.giat.geowave.analytics.tools.PropertyManagement;

import org.apache.commons.cli.Option;

public class GlobalParameters
{
	public enum Global
			implements
			ParameterEnum {
		ZOOKEEKER(
				String.class),
		ACCUMULO_INSTANCE(
				String.class),
		ACCUMULO_USER(
				String.class),
		ACCUMULO_PASSWORD(
				String.class),
		ACCUMULO_NAMESPACE(
				String.class),
		PARENT_BATCH_ID(
				String.class),
		CRS_ID(
				String.class),
		BATCH_ID(
				String.class);
		private final Class<?> baseClass;

		Global(
				final Class<?> baseClass ) {
			this.baseClass = baseClass;
		}

		@Override
		public Class<?> getBaseClass() {
			return baseClass;
		}

		@Override
		public Enum<?> self() {
			return this;
		}
	}

	public static final void fillOptions(
			final Set<Option> options,
			final Global[] params ) {
		if (contains(
				params,
				Global.ZOOKEEKER)) {
			options.add(PropertyManagement.newOption(
					Global.ZOOKEEKER,
					"z",
					"A comma-separated list of zookeeper servers used by an Accumulo instance.",
					true));
		}
		if (contains(
				params,
				Global.BATCH_ID)) {
			options.add(PropertyManagement.newOption(
					Global.BATCH_ID,
					"b",
					"Batch ID",
					true));
		}
		if (contains(
				params,
				Global.PARENT_BATCH_ID)) {
			options.add(PropertyManagement.newOption(
					Global.PARENT_BATCH_ID,
					"pb",
					"Batch ID",
					true));
		}
		if (contains(
				params,
				Global.CRS_ID)) {
			options.add(PropertyManagement.newOption(
					Global.CRS_ID,
					"crs",
					"CRS ID",
					true));
		}
		if (contains(
				params,
				Global.ACCUMULO_INSTANCE)) {
			options.add(PropertyManagement.newOption(
					Global.ACCUMULO_INSTANCE,
					"i",
					"The Accumulo instance ID",
					true));
			options.add(PropertyManagement.newOption(
					Global.ACCUMULO_USER,
					"u",
					"A valid Accumulo user ID",
					true));
			options.add(PropertyManagement.newOption(
					Global.ACCUMULO_PASSWORD,
					"p",
					"The password for the Accumulo user",
					true));
			options.add(PropertyManagement.newOption(
					Global.ACCUMULO_NAMESPACE,
					"n",
					"The table namespace (optional; default is no namespace)",
					true));
		}
	}

	private static boolean contains(
			final Global[] params,
			final Global option ) {
		return Arrays.asList(
				params).contains(
				option);
	}
}

redpajama_set_name: RedPajamaGithub


text:
// HEADER
#include "clipped-image.h"

// EXTERNAL INCLUDES
#include <dali-toolkit/dali-toolkit.h>

// INTERNAL INCLUDES
#include "generated/clipped-image-frag.h"
#include "generated/clipped-image-vert.h"

namespace ClippedImage
{
using namespace Dali;
using namespace Dali::Toolkit;

namespace
{
const char* const DELTA_PROPERTY_NAME("uDelta"); ///< Name of uniform used to mix the Circle and Quad geometries.

/**
 * @brief Creates the shader required for the clipped image
 * @return A reference to a static handle to a shader object (only created when first called).
 */
Shader& CreateShader()
{
  // Only need to create it once
  // The issue with using a static is that the shader will only get destroyed at application destruction.
  // This is OK for a simple use cases such as this example, but for more polished applications, the shader creation/destruction needs to
  // be managed by the application writer.
  static Shader shader;

  if(!shader)
  {
    shader = Shader::New(SHADER_CLIPPED_IMAGE_VERT, SHADER_CLIPPED_IMAGE_FRAG);
  }

  return shader;
}

/**
 * @brief Creates the geometry required for the clipped image
 * @return A reference to a static handle to a geometry object (only created when first called).
 */
Geometry& CreateGeometry()
{
  // Only need to create it once
  // The issue with using a static is that the geometry will only get destroyed at application destruction.
  // This is OK for a simple use cases such as this example, but for more polished applications, the geometry creation/destruction needs to
  // be managed by the application writer.
  static Geometry geometry;

  if(!geometry)
  {
    const int vertexCount = 34; // Needs to be 4n plus 2 where n is a positive integer above 4

    // Create the circle geometry

    // Radius is bound to actor's dimensions so this should not be increased.
    // If a bigger circle is required then the actor size should be increased.
    const float   radius = 0.5f;
    const Vector2 center = Vector2::ZERO;

    // Create a buffer for vertex data
    Vector2 circleBuffer[vertexCount];
    int     idx = 0;

    // Center vertex for triangle fan
    circleBuffer[idx++] = center;

    // Outer vertices of the circle
    const int outerVertexCount = vertexCount - 1;

    for(int i = 0; i < outerVertexCount; ++i)
    {
      const float percent = (i / static_cast<float>(outerVertexCount - 1));
      const float rad     = percent * 2.0f * Math::PI;

      // Vertex position
      Vector2 outer;
      outer.x = center.x + radius * cos(rad);
      outer.y = center.y + radius * sin(rad);

      circleBuffer[idx++] = outer;
    }

    Property::Map circleVertexFormat;
    circleVertexFormat["aPositionCircle"] = Property::VECTOR2;
    VertexBuffer circleVertices           = VertexBuffer::New(circleVertexFormat);
    circleVertices.SetData(circleBuffer, vertexCount);

    // Create the Quad Geometry
    Vector2 quadBuffer[vertexCount];
    idx               = 0;
    quadBuffer[idx++] = center;

    const size_t vertsPerSide = (vertexCount - 2) / 4;
    Vector2      outer(0.5f, 0.0f);
    quadBuffer[idx++]        = outer;
    float incrementPerBuffer = 1.0f / static_cast<float>(vertsPerSide);

    for(size_t i = 0; i < vertsPerSide && outer.y < 0.5f; ++i)
    {
      outer.y += incrementPerBuffer;
      quadBuffer[idx++] = outer;
    }

    for(size_t i = 0; i < vertsPerSide && outer.x > -0.5f; ++i)
    {
      outer.x -= incrementPerBuffer;
      quadBuffer[idx++] = outer;
    }

    for(size_t i = 0; i < vertsPerSide && outer.y > -0.5f; ++i)
    {
      outer.y -= incrementPerBuffer;
      quadBuffer[idx++] = outer;
    }

    for(size_t i = 0; i < vertsPerSide && outer.x < 0.5f; ++i)
    {
      outer.x += incrementPerBuffer;
      quadBuffer[idx++] = outer;
    }

    for(size_t i = 0; i < vertsPerSide && outer.y < 0.0f; ++i)
    {
      outer.y += incrementPerBuffer;
      quadBuffer[idx++] = outer;
    }

    Property::Map vertexFormat;
    vertexFormat["aPositionQuad"] = Property::VECTOR2;
    VertexBuffer quadVertices2    = VertexBuffer::New(vertexFormat);
    quadVertices2.SetData(quadBuffer, vertexCount);

    // Create the geometry object itself
    geometry = Geometry::New();
    geometry.AddVertexBuffer(circleVertices);
    geometry.AddVertexBuffer(quadVertices2);
    geometry.SetType(Geometry::TRIANGLE_FAN);
  }

  return geometry;
}

} // unnamed namespace

const float CIRCLE_GEOMETRY = 0.0f;
const float QUAD_GEOMETRY   = 1.0f;

Dali::Toolkit::Control Create(const std::string& imagePath, Property::Index& propertyIndex)
{
  // Create a control which whose geometry will be morphed between a circle and a quad
  Control clippedImage = Control::New();
  clippedImage.SetProperty(Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN);

  // Create the required renderer and add to the clipped image control
  Renderer renderer = Renderer::New(CreateGeometry(), CreateShader());
  renderer.SetProperty(Renderer::Property::BLEND_MODE, BlendMode::ON);
  clippedImage.AddRenderer(renderer);

  // Register the property on the clipped image control which will allow animations between a circle and a quad
  propertyIndex = clippedImage.RegisterProperty(DELTA_PROPERTY_NAME, 0.0f);

  // Add the actual image to the control
  Control image = ImageView::New(imagePath);
  image.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
  image.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
  image.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
  clippedImage.Add(image);

  return clippedImage;
}

} // namespace ClippedImage


text:
%Corregir formato predicciones por Random Forest (Vienen en cell, tienen
%que ser double)
for i=1:length(etiquetas)
   prediccionArbol(i,1)=str2double(etiquetas{i});
end


text:
/*  DO NOT EDIT THIS FILE.

    It has been auto-edited by fixincludes from:

	"fixinc/tests/inc/sys/time.h"

    This had to be done to correct non-standard usages in the
    original, manufacturer supplied header file.  */

#if defined( HPUX_SYSTIME_CHECK )
struct sigevent;
#endif  /* HPUX_SYSTIME_CHECK */

#if defined( LYNXOS_NO_WARNING_IN_SYS_TIME_H_CHECK )

#endif  /* LYNXOS_NO_WARNING_IN_SYS_TIME_H_CHECK */

#if defined( ULTRIX_SYS_TIME_CHECK )
@(#)time.h      6.1     (ULTRIX)
extern time_t		time( time_t *__tloc );

extern int adjtime(struct timeval *, struct timeval *);
extern int getitimer(int, struct itimerval *);
extern int setitimer(int, struct itimerval *, struct itimerval *);
extern int gettimeofday(struct timeval *, struct timezone *);
extern int settimeofday(struct timeval *, struct timezone *);
extern void profil(const void *, size_t, size_t, unsigned int);
extern int stime(const time_t *);
extern int utimes(const char *, const struct timeval[2]);
extern int select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
extern double difftime();
extern	int adjtime();
extern	int getitimer();
extern	int setitimer();
extern	int gettimeofday();
extern	int settimeofday();
extern	void profil();
extern	int stime();
extern	int utimes();
extern	int select();

#endif  /* ULTRIX_SYS_TIME_CHECK */


text:
package org.hisrc.jscm.codemodel.statement.impl;

import org.hisrc.jscm.codemodel.JSCodeModel;
import org.hisrc.jscm.codemodel.JSSourceElementVisitor;
import org.hisrc.jscm.codemodel.lang.Validate;
import org.hisrc.jscm.codemodel.statement.JSStatement;

public abstract class StatementImpl implements JSStatement{

	private final JSCodeModel codeModel;

	public StatementImpl(JSCodeModel codeModel) {

		Validate.notNull(codeModel);
		this.codeModel = codeModel;
	}

	public JSCodeModel getCodeModel() {
		return codeModel;
	}

	public <V, E extends Exception> V acceptSourceElementVisitor(
			JSSourceElementVisitor<V, E> visitor) throws E {
		return visitor.visitStatement(this);
	}
}


text:
#import "NSObject.h"

#import "TSCHUnretainedParent-Protocol.h"

@class NSMutableArray, NSMutableDictionary, TSCH3DAnimationTimeSlice, TSCH3DAnimationTiming, TSCH3DAnimationTimings, TSCH3DAnimationValueTiming, TSCH3DChartElementAnimationTimeSlice, TSCH3DChartRep, TSCH3DOrderedDictionary, TSCH3DScene;

// Not exported
@interface TSCH3DChartAnimation : NSObject <TSCHUnretainedParent>
{
    TSCH3DChartRep *mRep;
    TSCH3DChartElementAnimationTimeSlice *mTimeSlice;
    TSCH3DScene *mScene;
    struct ChartAnimationTimeRanges mTimeRanges;
    TSCH3DAnimationTimings *mGlobalTimings;
    TSCH3DAnimationTimings *mBackgroundPlaneTimings;
    TSCH3DAnimationTimings *mElementPlaneTimings;
    TSCH3DAnimationTimings *mElementTimings;
    NSMutableDictionary *mTimingContext;
    NSMutableArray *mSceneAnimationClips;
    TSCH3DScene *mLayoutScene;
    TSCH3DOrderedDictionary *mSeparateLayers;
    TSCH3DAnimationValueTiming *mShaderEffectElementsTiming;
    NSMutableArray *mSceneObjectDelegates;
}

+ (id)animationWithRep:(id)arg1;
+ (void)updateScene:(id)arg1;
+ (void)updateLayoutScene:(id)arg1;
+ (void)updateRenderScene:(id)arg1;
+ (_Bool)dynamicShadowsEnabled;
@property(readonly, nonatomic) TSCH3DAnimationTiming *elementTimings; // @synthesize elementTimings=mElementTimings;
@property(readonly, nonatomic) TSCH3DAnimationTimeSlice *timeSlice; // @synthesize timeSlice=mTimeSlice;
- (id).cxx_construct;
- (void).cxx_destruct;
@property(retain, nonatomic) TSCH3DOrderedDictionary *separateLayers;
- (id)separateLayerSceneObjectsSelectionBlocks;
- (id)gridlineLabelsSelectionBlock;
- (id)shadowsSelectionBlock;
- (void)addAnimationToClips:(id)arg1 forSceneObject:(id)arg2 scene:(id)arg3;
- (void)addAnimationToClips:(id)arg1 forScene:(id)arg2;
- (void)addToElementTimings:(id)arg1;
- (void)addToElementPlaneTimings:(id)arg1;
- (void)addToBackgroundPlaneTimings:(id)arg1;
- (struct CGRect)adjustBodyCanvasBounds:(struct CGRect)arg1 againstBodyCanvasDrawableFrame:(struct CGRect)arg2;
- (id)globalTimingInterpolation;
- (_Bool)isPie;
- (void)updateTimeRanges;
- (void)updateTimings;
- (void)p_addPlaneTimings:(id)arg1;
- (void)update:(float)arg1;
- (void)p_didUpdateAnimationTime;
@property(readonly, nonatomic) TSCH3DScene *layoutScene;
@property(readonly, nonatomic) TSCH3DScene *scene;
- (_Bool)individualValueLabels;
- (void)clearParent;
- (id)description;
- (void)dealloc;
- (id)initWithRep:(id)arg1;
- (_Bool)needDynamicShadows;

@end


text:
/*Problem 8.* Events
    Read in MSDN about the keyword event in C# and how to publish events.
    Re-implement the above using .NET events and following the best practices.*/

namespace Events
{
    using System;

    public class EventsMain
    {
        public static void Main()
        {
            Timer timer = new Timer(2);
            timer.TimeElapsedEvent += ExecuteThisMethod;
            timer.Start();
        }

        private static void ExecuteThisMethod(object sender, EventMessageEventArgs e)
        {
            Console.WriteLine(e.Message);
        }
    }
}


text:
def private():
	pass

class Abra:
	def func():
		private()

class Cadabra:
	def func():
		private()


text:
extern crate hyper;

use self::hyper::client::Client;

use std::thread;
use std::time::Duration;

use super::{Image,process_downloads,req_and_parse};

use std::sync::mpsc::Receiver;

pub fn main(rc: &Receiver<()>) {
    let client = Client::new();
    let mut url_string = "http://danbooru.donmai.us/posts.json?limit=100".to_string();
    let mut page = 1;

    loop {
        let res = match req_and_parse(&client, &url_string) {
            Ok(x) => x,
            Err(_) => {
                thread::sleep(Duration::new(3,0));
                continue
            }
        };

        let images = res.as_array().unwrap();
        if images.is_empty() { break }

        let images = images.iter().fold(Vec::new(), |mut acc, x| {
            let image = x.as_object().unwrap();
            let tags = image["tag_string"].as_str().unwrap().split_whitespace().map(String::from).collect::<Vec<_>>();
            let rating = image["rating"].as_str().unwrap().chars().nth(0).unwrap();

            if let Some(ext) = image.get("file_ext") {
                let ext = ext.as_str().unwrap();

                if ext != "webm" && ext != "swf" && ext != "mp4" {
                    let url = format!("http://danbooru.donmai.us{}", image["file_url"].as_str().unwrap().to_string());
                    let id = image["id"].as_i64().unwrap();
                    let name = format!("danbooru_{}.{}", id, ext);
                    let score = image["score"].as_i64().unwrap();

                    acc.push(Image{
                        name: name.to_string(),
                        got_from: "danbooru".to_string(),
                        url: url,
                        tags: tags,
                        rating: rating,
                        post_url: format!("http://danbooru.donmai.us/posts/{}", id),
                        score: score as i32
                    });
                }
            }
            acc
        });

        if process_downloads(&client, &images, rc).is_err() { break }

        page += 1;

        url_string = format!("http://danbooru.donmai.us/posts.json?page={}&limit=100", page);
    }
}


text:
// This handler implements the services provided to the client.

// Open Ephyra packages
import info.ephyra.OpenEphyra;
import info.ephyra.search.Result;
import info.ephyra.io.MsgPrinter;

// Java packages
import java.util.List;
import java.util.ArrayList;

// Interface definition
import qastubs.QAService;

/** Implementation of the question-answer interface defined
 * in the question-answer thrift file. A client request to any
 * method defined in the thrift file is handled by the
 * corresponding method here.
 */
public class QAServiceHandler implements QAService.Iface {
  /** An object that lets the question-answer wrapper use
   * the end-to-end OpenEphyra framework.
   */
  private OpenEphyra oe;
  private String defaultAnswer;

  /** Constructs the handler and initializes its OpenEphyra
   * object.
   */
  public QAServiceHandler() {
    String dir = "";

    MsgPrinter.enableStatusMsgs(true);
    MsgPrinter.enableErrorMsgs(true);

    oe = new OpenEphyra(dir);
    defaultAnswer = "Factoid not found in knowledge base.";
  }

  /** Forwards the client's question to the OpenEphyra object's askFactoid
   * method and collects the response.
   * @param question eg. "what is the speed of light?"
   */
  public String askFactoidThrift(String question) {
    MsgPrinter.printStatusMsg("askFactoidThrift(): Arg = " + question);

    Result result = oe.askFactoid(question);
    String answer = defaultAnswer;
    if (result != null) {
      answer = result.getAnswer();
    }

    return answer;
  }

  /** Forwards the client's question to the OpenEphyra object's askList
   * method and collects the response.
   * @param question eg. "name the US Presidents"
   */
  public List<String> askListThrift(String question) {
    float relThresh = 0.5f; //user may change this value

    MsgPrinter.printStatusMsg("askListThrift(): Arg = " + question);

    Result[] results = oe.askList(question, relThresh);
    List<String> answersList = new ArrayList<String>();
    if (results.length > 0) {
      // add all answers to answersList
      for (Result r : results) {
        answersList.add(r.getAnswer());
      }
    } else {
      answersList.add(defaultAnswer);
    }
    return answersList;
  }

  public void ping() {
    System.out.println("pinged");
  }
}


text:
using System;

namespace Atomiv.Template.Lite.Core.Domain.UnitTest
{
	public class Class1
	{
	}
}


text:
package com.etong.frame.dbo;

import javax.persistence.*;

@Entity
@Table(name = "T_CMS_WORKFLOW", schema = "GGFW_CMS")
public class TCmsWorkflowEntity {
    private String uuid;
    private String wfname;
    private String wfdesc;
    private Long wforder;
    private String wfcontent;
    private Long optime;
    private String opuseruuid;
    private String opusername;

    @Id
    @Column(name = "UUID", nullable = false, length = 32)
    public String getUuid() {
        return uuid;
    }

    public TCmsWorkflowEntity setUuid(String uuid) {
        this.uuid = uuid;
        return this;
    }

    @Basic
    @Column(name = "WFNAME", nullable = true, length = 255)
    public String getWfname() {
        return wfname;
    }

    public TCmsWorkflowEntity setWfname(String wfname) {
        this.wfname = wfname;
        return this;
    }

    @Basic
    @Column(name = "WFDESC", nullable = true, length = 255)
    public String getWfdesc() {
        return wfdesc;
    }

    public TCmsWorkflowEntity setWfdesc(String wfdesc) {
        this.wfdesc = wfdesc;
        return this;
    }

    @Basic
    @Column(name = "WFORDER", nullable = true, precision = 0)
    public Long getWforder() {
        return wforder;
    }

    public TCmsWorkflowEntity setWforder(Long wforder) {
        this.wforder = wforder;
        return this;
    }

    @Basic
    @Column(name = "WFCONTENT", nullable = true, length = 255)
    public String getWfcontent() {
        return wfcontent;
    }

    public TCmsWorkflowEntity setWfcontent(String wfcontent) {
        this.wfcontent = wfcontent;
        return this;
    }

    @Basic
    @Column(name = "OPTIME", nullable = true, precision = 0)
    public Long getOptime() {
        return optime;
    }

    public TCmsWorkflowEntity setOptime(Long optime) {
        this.optime = optime;
        return this;
    }

    @Basic
    @Column(name = "OPUSERUUID", nullable = true, length = 32)
    public String getOpuseruuid() {
        return opuseruuid;
    }

    public TCmsWorkflowEntity setOpuseruuid(String opuseruuid) {
        this.opuseruuid = opuseruuid;
        return this;
    }

    @Basic
    @Column(name = "OPUSERNAME", nullable = true, length = 255)
    public String getOpusername() {
        return opusername;
    }

    public TCmsWorkflowEntity setOpusername(String opusername) {
        this.opusername = opusername;
        return this;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        TCmsWorkflowEntity that = (TCmsWorkflowEntity) o;

        if (uuid != null ? !uuid.equals(that.uuid) : that.uuid != null) return false;
        if (wfname != null ? !wfname.equals(that.wfname) : that.wfname != null) return false;
        if (wfdesc != null ? !wfdesc.equals(that.wfdesc) : that.wfdesc != null) return false;
        if (wforder != null ? !wforder.equals(that.wforder) : that.wforder != null) return false;
        if (wfcontent != null ? !wfcontent.equals(that.wfcontent) : that.wfcontent != null) return false;
        if (optime != null ? !optime.equals(that.optime) : that.optime != null) return false;
        if (opuseruuid != null ? !opuseruuid.equals(that.opuseruuid) : that.opuseruuid != null) return false;
        if (opusername != null ? !opusername.equals(that.opusername) : that.opusername != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = uuid != null ? uuid.hashCode() : 0;
        result = 31 * result + (wfname != null ? wfname.hashCode() : 0);
        result = 31 * result + (wfdesc != null ? wfdesc.hashCode() : 0);
        result = 31 * result + (wforder != null ? wforder.hashCode() : 0);
        result = 31 * result + (wfcontent != null ? wfcontent.hashCode() : 0);
        result = 31 * result + (optime != null ? optime.hashCode() : 0);
        result = 31 * result + (opuseruuid != null ? opuseruuid.hashCode() : 0);
        result = 31 * result + (opusername != null ? opusername.hashCode() : 0);
        return result;
    }
}


text:
static void *backtrace_buffer[128];

void PrintBacktraceToStderr() {
	int num_addrs = backtrace(backtrace_buffer, 128);
	backtrace_symbols_fd(backtrace_buffer, num_addrs, STDERR_FILENO);
}

#else

#include <stdio.h>

void PrintBacktraceToStderr() {
	fprintf(stderr, "No backtrace available to print on this platform\n");
}

#endif


text:
function [c, flag] = imcgs(A, b, varargin)
% % Function Name: imcgs
%
%   Same as cgs, but b and c does not need to be vectors

% Citation:
% If you use this code please cite:
% S. Parameswaran, C-A. Deledalle, L. Denis and T. Q. Nguyen, "Accelerating
% GMM-based patch priors for image restoration: Three ingredients for a
% 100x speed-up", arXiv.
%
% License details as in license.txt
% ________________________________________

mat       = @(x) reshape(x, size(b));
vect      = @(x) x(:);
[c, flag] = cgs( @(x) vect(A(mat(x))), vect(b), varargin{:});
c         = mat(c);


text:
<?php

/**
 * ContentTranslation form.
 *
 * @package    sf_sandbox
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class ContentTranslationForm extends BaseContentTranslationForm
{
  public function configure()
  {
      $this->useFields(array('title', 'intro_text', 'full_text'));

      $this->widgetSchema['intro_text'] = new sfWidgetFormCKEditor();
      $this->widgetSchema['full_text'] = new sfWidgetFormCKEditor();
//      $this->widgetSchema['description'] = new sfWidgetFormCKEditor();
  }
}


text:
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.document.restapi.resource;

import com.yahoo.component.annotation.Inject;
import com.yahoo.container.jdisc.HttpRequest;
import com.yahoo.container.jdisc.HttpResponse;
import com.yahoo.container.jdisc.ThreadedHttpRequestHandler;
import com.yahoo.jdisc.Metric;

/**
 * Dummy for internal use.
 *
 * @author jonmv
 */
public class RestApi extends ThreadedHttpRequestHandler {

    @Inject
    public RestApi() {
        super(ignored -> { throw new IllegalStateException("Not supposed to handle anything"); }, (Metric)null);
    }

    @Override
    public HttpResponse handle(HttpRequest request) {
        throw new IllegalStateException("Not supposed to handle anything");
    }

}


text:
package org.wso2.carbon.apimgt.rest.api.util.utils;

import java.io.*;
import java.util.Properties;

import org.wso2.carbon.apimgt.rest.api.util.*;

/**
 * Util methods for Entitlement client use to validate requests
 */
public class EntitlementClientUtils {

    private static Properties configProperties;

    /*public static String getPolicyDirectoryPath(String samplePolicyName) {
        String path = null;
        if(configProperties != null){
            String policyPath =  configProperties.getProperty(EntitlementClientConstants.POLICY_PATH);
            if(policyPath != null && policyPath.trim().length() > 0){
                path = configProperties.getProperty(EntitlementClientConstants.POLICY_PATH) + File.separator + samplePolicyName + ".xml";
            }
        }

        if(path == null){
            try{
                File file = new File((new File(".")).getCanonicalPath() + File.separator +"resources" +
                        File.separator +"policy" + File.separator + samplePolicyName + ".xml");
                if(file.exists()){
                    path = file.getCanonicalPath();
                }
            } catch (IOException e) {
                // ignore
            }
        }
        return path;
    } */

    /*public static String getTrustStore() throws Exception {
        if(configProperties != null  && configProperties.getProperty(EntitlementClientConstants.TRUST_STORE_PATH) != null){
            return  configProperties.getProperty(EntitlementClientConstants.TRUST_STORE_PATH);
        } else {
            try{
                File file = new File((new File(".")).getCanonicalPath() + File.separator +"resources" +
                        File.separator +"wso2carbon.jks");
                if(file.exists()){
                    return file.getCanonicalPath();
                } else {
                    return null;
                }
            } catch (IOException e) {
                throw new Exception("Error while calculating trust store path", e);
            }
        }
    }

    public static String getTrustStorePassword(){
        if(configProperties != null && configProperties.getProperty(EntitlementClientConstants.TRUST_STORE_PASSWORD) != null){
            return configProperties.getProperty(EntitlementClientConstants.TRUST_STORE_PASSWORD);
        } else {
            return "wso2carbon";
        }
    } */

    public static String getServerUrl() {
        return configProperties != null && configProperties.getProperty(RestApiConstants.SERVER_URL) != null ?
                configProperties.getProperty(RestApiConstants.SERVER_URL)
                : "https://localhost:9444/services/";
    }

    public static String getServerUsername() {
        return configProperties != null && configProperties.getProperty(RestApiConstants.SERVER_USER_NAME) != null ?
                configProperties.getProperty(RestApiConstants.SERVER_USER_NAME) :
                "admin";
    }

    public static String getServerPassword() {
        String ret;
        if (configProperties != null) {
            ret = configProperties.getProperty(RestApiConstants.SERVER_PASSWORD);
            if (ret != null) {
                return ret;
            }
        }
        return "admin";
    }

    /**
     * reads values from config property file
     *
     * @throws Exception throws, if fails
     */
    public static void loadConfigProperties() throws Exception {
        Properties properties = new Properties();
        InputStream inputStream = null;
        try {
            File file = new File((new File(".")).getCanonicalPath() + File.separator + "resources" +
                    File.separator + "config.properties");
            if (file.exists()) {
                inputStream = new FileInputStream(file);
            } else {
                String msg = "File does not exist : " + "config.properties";
                System.out.println(msg);
            }
        } catch (FileNotFoundException e) {
            String msg = "File can not be found : " + "config.properties";
            System.out.println(msg);
            throw new Exception(msg, e);
        } catch (IOException e) {
            String msg = "Can not create the canonical file path for given file : " + "config.properties";
            System.out.println(msg);
            throw new Exception(msg, e);
        }

        try {
            if (inputStream != null) {
                properties.load(inputStream);
            }
        } catch (IOException e) {
            String msg = "Error loading properties from config.properties file";
            System.out.println(msg);
            throw new Exception(msg, e);
        } finally {
            try {
                if (inputStream != null) {
                    inputStream.close();
                }
            } catch (IOException ignored) {
                System.out.println("Error while closing input stream");
            }
        }
        configProperties = properties;
    }

}


text:
ALTER TABLE krim_entity_addr_t CHANGE COLUMN ADDR_LINE_1 ADDR_LINE_1 VARCHAR(128)
/
ALTER TABLE krim_entity_addr_t CHANGE COLUMN ADDR_LINE_2 ADDR_LINE_2 VARCHAR(128)
/
ALTER TABLE krim_entity_addr_t CHANGE COLUMN ADDR_LINE_3 ADDR_LINE_3 VARCHAR(128)
/

ALTER TABLE krim_pnd_addr_mt CHANGE COLUMN ADDR_LINE_1 ADDR_LINE_1 VARCHAR(128)
/
ALTER TABLE krim_pnd_addr_mt CHANGE COLUMN ADDR_LINE_2 ADDR_LINE_2 VARCHAR(128)
/
ALTER TABLE krim_pnd_addr_mt CHANGE COLUMN ADDR_LINE_3 ADDR_LINE_3 VARCHAR(128)
/


text:
package igx.shared;

// Fleet.java
// Class Fleet
public class Fleet {
    // Data fields

    public Player owner;
    public int ships, ratio;
    public Planet destination, source;
    public float distance;
    public Fleet next;
    public GameInstance Game;

    public Fleet(Fleet fleet) {
        Game = fleet.Game;
        owner = fleet.owner;
        ships = fleet.ships;
        ratio = fleet.ratio;
        destination = fleet.destination;
        distance = fleet.distance;
        next = fleet.next;
    }

    public Fleet(GameInstance Game, Planet source, Planet destination, int ships) {
        this.Game = Game;
        this.source = source;
        owner = source.owner;
        this.ships = ships;
        source.ships -= ships;
        Game.dirty[Planet.char2num(source.planetChar)] = true;
        ratio = source.ratio;
        this.destination = destination;
        distance = new Double(Math.sqrt((source.x - destination.x) * (source.x - destination.x)
                + (source.y - destination.y) * (source.y - destination.y))).floatValue();
        next = null;
    }

    public Fleet(GameInstance Game, Planet destination, Planet source, Player owner, int ships, int ratio, float distance) {
        this.destination = destination;
        this.owner = owner;
        this.ships = ships;
        this.ratio = ratio;
        this.distance = distance;
        this.Game = Game;
    }

    /**
     * This method was created in VisualAge.
     *
     * @return java.lang.String
     */
    public String toString() {
        return "(" + owner.name
                + ", S: " + ships
                + ", %: " + ratio
                + ", P: " + destination.planetChar
                + ", D: " + distance + ")";
    }
// UPDATE - Updates a fleet for this segment.  Returns true if it lands

    boolean update() {
        char[] planetChar = {destination.planetChar};
        String planetString = new String(planetChar);
        distance -= Params.FLEETSPEED;
        if ((distance <= 0) || (Game.resolveAllConflicts)) // Fleet has arrived
        {
            if (destination.blackHole) {
                Game.ui.postBlackHole(this);
                return true;
            }
            Game.dirty[Planet.char2num(destination.planetChar)] = true;
            if (owner == destination.owner) // Reinforcements
            {
                Game.fleetArrived(this);
                if (distance + Params.FLEETSPEED > 0) {
                    Game.ui.postReinforcements(ships, destination);
                }
                destination.ships += ships;
                return true;
            } else // Combat
            {
                if (distance + Params.FLEETSPEED > 0) {
                    Game.ui.postAttack(this, destination);
                    Game.fleetArrived(this);
                }
                // PHASING THIS OUT - MAKES 1 SHIP FLEETS TOO POWERFUL
                /*
			int attackNumber = ships * Params.ATTACKSTRENGTH / 100;
			if ((ships * Params.ATTACKSTRENGTH) % 100 > 0)
				// Ceiling
				attackNumber++;
                 */
                int attackNumber = ships;
                for (int i = 0; i < attackNumber; i++) {
                    if ((Game.pseudo(0, 99) < Params.ATTACKSTRENGTH) || (destination.ships == 0)) {
                        if (((Game.pseudo(0, 99) < ratio) && ((--destination.ships) <= 0)) || (destination.ships == 0)) {
                            Game.ui.postInvasion(this, destination);
                            destination.ships = ships; // Planet has been invaded
                            destination.owner = owner;
                            return true;
                        }
                    }
                }
                destination.attackers.addElement(this);
                return false;
            }
        } else {
            return false;
        }
    }
}


text:
<?php

namespace Core\CommentBundle\Form\Type;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class CommentType extends AbstractType
{
    /**
     * @param FormBuilderInterface $builder
     * @param array                $options
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('content')
            ->add('save', 'submit')
            ->getForm();
    }

    /**
     * @param OptionsResolverInterface $resolver
     */
    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'Core\CommentBundle\Entity\Comment',
        ));
    }

    /**
     * @return string
     */
    public function getName()
    {
        return 'core_comment';
    }
}


text:
;------------------------------------------------------------------------------
;
; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
; This program and the accompanying materials
; are licensed and made available under the terms and conditions of the BSD License
; which accompanies this distribution.  The full text of the license may be found at
; http://opensource.org/licenses/bsd-license.php.
;
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
;
; Module Name:
;
;   ScanMem32.Asm
;
; Abstract:
;
;   ScanMem32 function
;
; Notes:
;
;   The following BaseMemoryLib instances contain the same copy of this file:
;
;       BaseMemoryLibRepStr
;       BaseMemoryLibMmx
;       BaseMemoryLibSse2
;       BaseMemoryLibOptDxe
;       BaseMemoryLibOptPei
;
;------------------------------------------------------------------------------

    .code

;------------------------------------------------------------------------------
; CONST VOID *
; EFIAPI
; InternalMemScanMem32 (
;   IN      CONST VOID                *Buffer,
;   IN      UINTN                     Length,
;   IN      UINT32                    Value
;   );
;------------------------------------------------------------------------------
InternalMemScanMem32    PROC    USES    rdi
    mov     rdi, rcx
    mov     rax, r8
    mov     rcx, rdx
    repne   scasd
    lea     rax, [rdi - 4]
    cmovnz  rax, rcx
    ret
InternalMemScanMem32    ENDP

    END