text:
require 'spec_helper'

describe 'Cloner' do

  let(:cloner) { Cloner.new({
      :destination_repo  => "gjtorikian/destination_repo",
      :originating_repo  => "gjtorikian/originating_repo",
      :git               => Git.clone( fixture_path("gjtorikian/destination_repo"), "#{tmpdir}/gjtorikian/destination_repo"),
      :tmpdir            => tmpdir
  })}

  before do
    setup_tmpdir
  end

  it "knows the originating token" do
    with_env "DOTCOM_MACHINE_USER_TOKEN", "dotcom_token" do
      expect(cloner.originating_token).to eql("dotcom_token")
    end
  end

  it "knows the destination token" do
    with_env "GHE_MACHINE_USER_TOKEN", "ghe_token" do
      cloner.destination_hostname = "someserver.com"
      expect(cloner.destination_token).to eql("ghe_token")
    end
  end

  it "knows the dotcom token" do
    with_env "DOTCOM_MACHINE_USER_TOKEN", "dotcom_token" do
      expect(cloner.dotcom_token).to eql("dotcom_token")
    end
  end

  it "knows the ghe token" do
    with_env "GHE_MACHINE_USER_TOKEN", "ghe_token" do
      expect(cloner.ghe_token).to eql("ghe_token")
    end
  end

  it "creates the url with token" do
    with_env "DOTCOM_MACHINE_USER_TOKEN", "dotcom_token" do
      expected = "https://dotcom_token:x-oauth-basic@github.com/gjtorikian/destination_repo.git"
      expect(cloner.url_with_token(:destination)).to eql(expected)

      expected = "https://dotcom_token:x-oauth-basic@github.com/gjtorikian/originating_repo.git"
      expect(cloner.url_with_token(:originating)).to eql(expected)
    end
  end

  it "creates the originating url with token" do
    with_env "DOTCOM_MACHINE_USER_TOKEN", "dotcom_token" do
      expected = "https://dotcom_token:x-oauth-basic@github.com/gjtorikian/originating_repo.git"
      expect(cloner.originating_url_with_token).to eql(expected)
    end
  end

  it "creates the destitination url with token" do
    with_env "DOTCOM_MACHINE_USER_TOKEN", "dotcom_token" do
      expected = "https://dotcom_token:x-oauth-basic@github.com/gjtorikian/destination_repo.git"
      expect(cloner.destination_url_with_token).to eql(expected)
    end
  end

  it "creates the remote name" do
    expect(cloner.remote_name).to match(/otherrepo-[\d]+/)
  end

  it "creates the branch name" do
    expect(cloner.branch_name).to match(/update-[\d]+/)
  end

  it "creates the safe repo name" do
    expect(cloner.safe_destination_repo).to eql("GJTORIKIAN_DESTINATION_REPO")
  end

  it "defaults to the default commit message" do
    expect(cloner.commit_message).to eql("Sync changes from upstream repository")
  end

  it "uses a user-supplied commit message" do
    with_env "GJTORIKIAN_DESTINATION_REPO_COMMIT_MESSAGE", "Some message" do
      expect(cloner.commit_message).to eql("Some message")
    end
  end

  it "knows the changed files" do
    url = "https://api.github.com/repos/gjtorikian/destination_repo/compare/master...#{cloner.branch_name}"
    stub_request(:get, url).
    to_return(:status => 200, :body => fixture("compare_some_files.json"), :headers => { 'Content-Type' => 'application/json' })
    expect(cloner.files.count).to eql(3)
  end

  it "defaults to the default pull request title" do
    url = "https://api.github.com/repos/gjtorikian/destination_repo/compare/master...#{cloner.branch_name}"
    stub_request(:get, url).
    to_return(:status => 200, :body => fixture("compare_some_files.json"), :headers => { 'Content-Type' => 'application/json' })

    expect(cloner.pull_request_title).to eql("Sync changes from upstream repository")
  end

  it "respects user supplied pull-request titles" do
    url = "https://api.github.com/repos/gjtorikian/destination_repo/compare/master...#{cloner.branch_name}"
    stub_request(:get, url).
    to_return(:status => 200, :body => fixture("compare_some_files.json"), :headers => { 'Content-Type' => 'application/json' })

    with_env "GJTORIKIAN_DESTINATION_REPO_PR_TITLE", "Some title" do
      expect(cloner.pull_request_title).to eql("Some title")
    end
  end

  it "uses descriptive pull request titles when only one files has changed" do
    url = "https://api.github.com/repos/gjtorikian/destination_repo/compare/master...#{cloner.branch_name}"
    stub_request(:get, url).
    to_return(:status => 200, :body => fixture("compare_single_file.json"), :headers => { 'Content-Type' => 'application/json' })

    expect(cloner.pull_request_title).to eql("Added file1.txt")
  end

  it "geneates the pull request body" do
    url = "https://api.github.com/repos/gjtorikian/destination_repo/compare/master...#{cloner.branch_name}"
    stub_request(:get, url).
    to_return(:status => 200, :body => fixture("compare_some_files.json"), :headers => { 'Content-Type' => 'application/json' })

    expected = "### Added files: \n\n* file1.txt\n* file3.txt\n\n### Removed files: \n\n* file2.txt\n\n"
    expect(cloner.pull_request_body).to eql(expected)
  end

  it "respects user-supplied pull-request bodies" do
    with_env "GJTORIKIAN_DESTINATION_REPO_PR_BODY", "Some body" do
      expect(cloner.pull_request_body).to eql("Some body")
    end
  end

  it "initializes octokit" do
    with_env "DOTCOM_MACHINE_USER_TOKEN", "dotcom_token" do
      expect(cloner.client.class).to eql(Octokit::Client)
      expect(cloner.client.api_endpoint).to eql('https://api.github.com/')
      expect(cloner.client.access_token).to eql("dotcom_token")
    end
  end

  it "clones the repo" do
    expect(cloner.git.class).to eql(Git::Base)
    expect(Dir.exists?("#{tmpdir}/gjtorikian/destination_repo")).to eql(true)
  end

  it "runs a command" do
    expect(cloner.run_command("echo", "foo")).to eql("foo\n")
  end

  it "reports errors" do
    stub = stub_request(:post, "https://api.github.com/repos/gjtorikian/originating_repo/issues").
    with(:body => "{\"labels\":[],\"title\":\"Merge conflict detected\",\"body\":\"Hey, I'm really sorry about this, but there was a merge conflict when I tried to auto-sync the last time, from :\\n\\n```\\nfoo\\nMerge error\\nbar\\n```\\nYou'll have to resolve this problem manually, I'm afraid.\\n![I'm so sorry](https://media.giphy.com/media/NxKcqJI6MdIgo/giphy.gif)\"}").
    to_return(:status => 204)

    output = "foo\nMerge error\nbar"

    cloner.report_error(output)
    expect(stub).to have_been_requested
  end

  it "doesn't report non-errors" do
    cloner.report_error("asdf")
    expect(WebMock).not_to have_requested(:post, "github.com")
  end

  it "adds the remote" do
    expect(cloner.git.remotes.count).to eql(1)
    cloner.add_remote
    expect(cloner.git.remotes.count).to eql(2)
  end

  it "fetches the repo" do
    cloner.instance_variable_set("@originating_url_with_token", fixture_path("/gjtorikian/originating_repo"))
    cloner.add_remote
    cloner.fetch
  end

  it "merges the changes" do
    cloner.instance_variable_set("@originating_url_with_token", fixture_path("/gjtorikian/originating_repo"))
    cloner.sync_method = "merge"
    Dir.chdir "#{tmpdir}/gjtorikian/destination_repo" do
      cloner.git
      cloner.add_remote
      cloner.fetch
      commits = cloner.git.log.count
      output = cloner.apply_sync_method
      expect(output).to match(/1 file changed, 1 insertion/)
      expect(output).to match(/create mode 100644 file2.md/)
      expect(cloner.git.log.count).to eql(commits + 2)
    end
  end

  it "squashes the changes when public" do
    cloner.instance_variable_set("@originating_url_with_token", fixture_path("/gjtorikian/originating_repo"))
    cloner.sync_method = "squash"
    Dir.chdir "#{tmpdir}/gjtorikian/destination_repo" do
      cloner.git
      cloner.add_remote
      cloner.fetch
      commits = cloner.git.log.count
      output = cloner.apply_sync_method
      expect(output).to match(/1 file changed, 1 insertion/)
      expect(output).to match(/create mode 100644 file2.md/)
      expect(cloner.git.log.count).to eql(commits + 1) # Ensure the squash
    end
  end

  it "replaces repository contents without actually merging" do
    cloner.instance_variable_set("@originating_url_with_token", fixture_path("/gjtorikian/originating_repo"))
    cloner.sync_method = "replace_contents"
    Dir.chdir "#{tmpdir}/gjtorikian/destination_repo" do
      cloner.git
      cloner.add_remote
      cloner.fetch
      commits = cloner.git.log.count
      output = cloner.apply_sync_method
      expect(output).to eql("")
    end
  end

  skip "pushes directly to default branch" do
    url = "https://api.github.com/repos/gjtorikian/destination_repo/compare/master...#{cloner.branch_name}"
    stub_request(:get, url).
    to_return(:status => 200, :body => fixture("compare_some_files.json"), :headers => { 'Content-Type' => 'application/json' })

    cloner.instance_variable_set("@originating_url_with_token", fixture_path("/gjtorikian/originating_repo"))
    cloner.instance_variable_set("@default_branch", "1")
    cloner.git
    cloner.add_remote
    cloner.fetch
    cloner.apply_sync_method
    output = cloner.submit_to_default_branch
    expect(output).to match(/master -> master/)
  end

  it "creates a pull request" do
    url = "https://api.github.com/repos/gjtorikian/destination_repo/compare/master...#{cloner.branch_name}"
    stub_request(:get, url).
    to_return(:status => 200, :body => fixture("compare_some_files.json"), :headers => { 'Content-Type' => 'application/json' })

    cloner.instance_variable_set("@originating_url_with_token", fixture_path("/gjtorikian/originating_repo"))

    stub = stub_request(:post, "https://api.github.com/repos/gjtorikian/destination_repo/pulls").
    to_return( :status => 204, :body => fixture("create_pr.json"), :headers => { 'Content-Type' => 'application/json' })

    stub2 = stub_request(:put, "https://api.github.com/repos/gjtorikian/destination_repo/pulls/1347/merge").
    to_return(:status => 200)

    Bundler.with_clean_env do
      Dir.chdir "#{tmpdir}/gjtorikian/destination_repo" do
        cloner.git
        cloner.add_remote
        cloner.fetch
        cloner.apply_sync_method
        cloner.create_pull_request
      end
    end

    expect(stub).to have_been_requested
  end

  it "merges the pull request" do
    url = "https://api.github.com/repos/gjtorikian/destination_repo/compare/master...#{cloner.branch_name}"
    stub_request(:get, url).
    to_return(:status => 200, :body => fixture("compare_some_files.json"), :headers => { 'Content-Type' => 'application/json' })

    stub_request(:post, "https://api.github.com/repos/gjtorikian/destination_repo/pulls").
    to_return( :status => 204, :body => fixture("create_pr.json"), :headers => { 'Content-Type' => 'application/json' })

    cloner.instance_variable_set("@originating_url_with_token", fixture_path("/gjtorikian/originating_repo"))

    stub = stub_request(:put, "https://api.github.com/repos/gjtorikian/destination_repo/pulls/1347/merge").
    to_return(:status => 200)

    Bundler.with_clean_env do
      Dir.chdir "#{tmpdir}/gjtorikian/destination_repo" do
        cloner.git
        cloner.add_remote
        cloner.fetch
        cloner.apply_sync_method
        cloner.create_pull_request
      end
    end
    expect(stub).to have_been_requested
  end

  it "deletes the branch" do
    stub = stub_request(:delete, "https://api.github.com/repos/gjtorikian/destination_repo/git/refs/heads/#{cloner.branch_name}").
    to_return(:status => 200)

    cloner.delete_branch
    expect(stub).to have_been_requested
  end
end


text:
package net.liftweb
package util

import common._
import xml.NodeSeq

trait HasParams {
  def param(name: String): Box[String]
}

/**
 * Impersonates a JSON command
 */
case class JsonCmd(command: String, target: String, params: Any,
                   all: scala.collection.Map[String, Any])

import net.liftweb.json.JsonAST._

/**
* A helpful extractor to take the JValue sent from the client-side JSON stuff and
* make some sense of it.
*/
object JsonCommand {
  import scala.language.implicitConversions

  implicit def iterableToOption[X](in: Iterable[X]): Option[X] = in.toSeq.headOption

  def unapply(in: JValue): Option[(String, Option[String], JValue)] =
  for {
    JString(command) <- in \ "command"
    params <- in \ "params"
    if params != JNothing
  } yield {
    val target = (in \ "target") match {
      case JString(t) => Some(t)
      case _ => None
    }
    (command, target, params)
  }
  // Some((in.command, in.target, in.params, in.all))
}

/**
 * Holds information about a response
 */
class ResponseInfoHolder {
  var headers: Map[String, String] = Map.empty
  private var _docType: Box[String] = Empty
  private var _setDocType = false

  def docType = _docType

  def docType_=(in: Box[String]) {
    _docType = in
    _setDocType = true
  }

  def overrodeDocType = _setDocType
}

redpajama_set_name: RedPajamaGithub


text:
/*
 * 文  件   名: ResourceType.java
 * 版         本 : vigor-defensor-service © 2016 Anttribe. All rights reserved.
 * 描         述 : <描述>
 * 修   改  人: zhaoyong
 * 修改时间: 2016年2月23日
 */
package org.anttribe.vigor.defensor.type;

import org.anttribe.vigor.defensor.domain.Resource;
import org.apache.commons.lang3.StringUtils;

/**
 * 资源类型
 *
 * @author zhaoyong
 * @version 2016年2月23日
 */
public enum ResourceType
{

    /** 菜单 */
    MENU
    {
        @Override
        public boolean isMenuResource(Resource resource)
        {
            return true;
        }

        @Override
        public String assemblePermission(Resource resource)
        {
            String resourceUrl = resource.getResourceUrl();
            return this.name() + (StringUtils.isEmpty(resourceUrl) ? ":" + resource.getId()
                : StringUtils.join(resourceUrl.split("/"), ":"));
        }
    },
    /** 页面 */
    PAGE
    {
        @Override
        public boolean isMenuResource(Resource resource)
        {
            return true;
        }

        @Override
        public String assemblePermission(Resource resource)
        {
            return this.name() + resource.getId();
        }
    },
    /** 操作 */
    OPERATOR
    {
        @Override
        public boolean isMenuResource(Resource resource)
        {
            return false;
        }

        @Override
        public String assemblePermission(Resource resource)
        {
            return resource.getPrivilege();
        }
    };

    /**
     * 判断是否可作为菜单
     *
     * @param resource
     * @return boolean
     */
    public abstract boolean isMenuResource(Resource resource);

    /**
     * 组装权限字符串
     *
     * @param resource
     * @return String
     */
    public abstract String assemblePermission(Resource resource);

}


text:
<!doctype html>

		<meta charset="utf-8">

		<title>Communication Patterns - 消息传递机制</title>

		<meta name="description" content="A framework for easily creating beautiful presentations using HTML">
		<meta name="author" content="Hakim El Hattab">

		<meta name="apple-mobile-web-app-capable" content="yes" />
		<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />

		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">

		<link rel="stylesheet" href="css/reveal.min.css">
		<link rel="stylesheet" href="css/theme/default.css" id="theme">

		<link rel="stylesheet" href="lib/css/zenburn.css">

谢谢


text:
.. _python_create_sequencefile:

ConKit SequenceFile Hierarchy Construction
------------------------------------------

If you wish to construct it as part of a new development to store your sequence information, you might find the following helpful.

Entities
++++++++

1. **How to create a :obj:`~conkit.core.sequence.Sequence`?**

.. code-block:: python

   >>> import conkit.core
   >>> seq = conkit.core.Sequence("example", "ABCDEF")

The example above creates a :obj:`~conkit.core.sequence.Sequence` object with id "example" and sequence "ABCDEF". This sequence contains numerous functions, such as :meth:`~conkit.core.sequence.Sequence.align_global` for a global pairwise alignment with a second sequence

2. **How to create a :obj:`~conkit.core.sequencefile.SequenceFile`?**

.. code-block:: python

   >>> import conkit.core
   >>> sfile = conkit.core.SequenceFile("example")

This example shows you how to create a :obj:`~conkit.core.sequencefile.SequenceFile` which can store one or more :obj:`~conkit.core.sequence.Sequence` objects.

Hierarchy
+++++++++

Above is an outline for the different sequence-related :obj:`~conkit.core.entity.Entity` classes. Each higher entity allows you to store one or more lower-level ones, i.e. you can store one or more :obj:`~conkit.core.sequence.Sequence` entities in a single :obj:`~conkit.core.sequencefile.SequenceFile`; however, be aware that all **must** have unique IDs.

To illustrate how you can combine the entities, look at the following:

.. code-block:: python

   >>> import conkit.core
   >>> sfile = conkit.core.SequenceFile("example")
   >>> seq1 = conkit.core.Sequence("example", "ABCDEF")
   >>> seq2 = conkit.core.Sequence("elpmaxe", "FEDCBA")
   >>> sfile.add(seq1)
   >>> sfile.add(seq2)

Note, the order in which you add :obj:`~conkit.core.entity.Entity` instances does not matter.

Once you have constructed your hierarchy, all related functions are available to you.


text:
Projeto relativo ao capítulo 4 do livro, adaptado para rodar no Jetty.

## Requisitos

* Nenhum (o download do Jetty será feito automaticamente pelo Maven)

## Como utilizar

* Execute o comando mvn jetty:run
* Confira os logs

## Diferenças entre o anterior (soa-cap03)

* O arquivo pom.xml foi alterado para transformar o arquivo em WAR
* O arquivo pom.xml inclui as dependências do JAX-WS
* Os arquivos sun-jaxws.xml e web.xml foram criados


text:
<!DOCTYPE html>

		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<meta name="generator" content="Jekyll v3.3.1">

		<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Merriweather:400,400italic,700,700italic|Open+Sans:400,400italic,600,600italic,700,700italic|Inconsolata:400,700">
		<link rel="stylesheet" href="/css/main.css">
		<link rel="apple-touch-icon" href="/siteicon.png">
		<link rel="icon" type="image/png" href="/siteicon.png" sizes="192x192">
		<link rel="icon" type="image/png" href="/images/siteicon.png">
		<meta name="keywords" content="l10n.ws,l10n,localization,i18n,internationalization,g11n,globalization,translation,locale,management,web service,platform,java,spring">

		<link type="application/atom+xml" rel="alternate" href="http://localhost:4000/feed.xml" title="L10n.ws" />

<title>General fixes and improvements - L10n.ws</title>
<meta property="og:title" content="General fixes and improvements" />
<meta name="description" content="This release fixes a few minor issues reported by users. We've also made a few quality of life improvements." />
<meta property="og:description" content="This release fixes a few minor issues reported by users. We've also made a few quality of life improvements." />
<link rel="canonical" href="http://localhost:4000/2016/02/05/general-fixes-and-improvements/" />
<meta property="og:url" content="http://localhost:4000/2016/02/05/general-fixes-and-improvements/" />
<meta property="og:site_name" content="L10n.ws" />
<meta property="og:type" content="article" />
<meta property="article:published_time" content="2016-02-05T00:00:00+02:00" />
<meta name="google-site-verification" content="l0CTb-NMGRSdHY9BoKkeMQf9UdJfuXzYRtts6NZTQZg" />

				L10n.ws
				<button type="button" class="open-nav" id="open-nav"></button>

			<form action="/search/" method="get">
				<input type="text" name="q" id="search-input" placeholder="Search" autofocus>
				<input type="submit" value="Search" style="display: none;">
			</form>

						Welcome

							Download

							API

API v1 HTTP

							Integration

Java

Spring

Gradle

Maven

Android

							Portal Application

Common terminology

Access management

							Examples

							Contact us

						Source code

						Blog

This release fixes a few minor issues reported by users. We've also made a few quality of life improvements.

Features:

Streamlined access to contact details

Better sort order for archived messages

Fixes:

Input sometimes getting stuck

One more memory leak obliterated


text:
@class CTSResponse;

typedef enum {
    CitrusSiginTypeMOtp,
    CitrusSiginTypeEOtp,
    CitrusSiginTypePassword,
    CitrusSiginTypeMOtpOrPassword,
    CitrusSiginTypeEOtpOrPassword,
    CitrusSiginTypeLimited
} CitrusSiginType;

@interface CTSCitrusLinkRes : NSObject
@property(strong)NSString *userMessage;
@property(assign)CitrusSiginType siginType;
@property(strong)NSString *linkedMobile;
@property(strong)NSString *linkedEmail;

-(instancetype)initWithResponse:(CTSResponse *)response;
@end


text:
package servidor;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.Servlet;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Servlet implementation class servirpeticion
 */
public class servirpeticion extends HttpServlet implements Servlet {
	private static final long serialVersionUID = 1L;

    /**
     * Default constructor.
     */
    public servirpeticion() {
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		PrintWriter writer = new PrintWriter(response.getOutputStream());
        writer.println("Hello Fucking World!");
        writer.flush();
        writer.close();
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
	}

}


text:
package sbt
package internal
package parser

abstract class CheckIfParsedSpec(
    implicit val splitter: SplitExpressions.SplitExpression =
      EvaluateConfigurations.splitExpressions
) extends AbstractSpec {

  test(s"${this.getClass.getName} should parse sbt file") {
    files foreach {
      case (content, description, nonEmptyImports, nonEmptyStatements) =>
        println(s"""${getClass.getSimpleName}: "$description" """)
        val (imports, statements) = split(content)
        assert(
          nonEmptyStatements == statements.nonEmpty,
          s"""$description
             |***${shouldContains(nonEmptyStatements)} statements***
             |$content """.stripMargin
        )
        assert(
          nonEmptyImports == imports.nonEmpty,
          s"""$description
             |***${shouldContains(nonEmptyImports)} imports***
             |$content """.stripMargin
        )
    }
  }

  private def shouldContains(b: Boolean): String =
    s"""Should ${if (b) {
      "contain"
    } else {
      "not contain"
    }}"""

  protected def files: Seq[(String, String, Boolean, Boolean)]

}


text:
MAPA PRODUCTIVO FEDERAL

                <form class="form-horizontal">
                    <fieldset>

                                <input type="text"
                                       class="form-control input-lg"
                                       placeholder="Usuario"
                                       ng-model="data.usuario"
                                       >

                                <input type="password"
                                       class="form-control input-lg"
                                       placeholder="Password"
                                       ng-model="data.contrasenia"
                                       >

                            <button class="btn btn-primary btn-lg btn-block text-center">Ingresar</button>

                    </fieldset>
                </form>

                        Olvidó su contraseña?
                         |
                        Regístrese


text:
module Applications
  module Process
    class PersonalInformationsController < Applications::ProcessController
      before_action :authorize_application_update

      def index
        @form = Forms::Application::Applicant.new(application.applicant)
      end

      def create
        @form = Forms::Application::Applicant.new(application.applicant)
        @form.update_attributes(form_params(:applicant))

        if @form.save
          redirect_to application_details_path
        else
          render :index
        end
      end
    end
  end
end


text:
$(function() {
  window.keydown = {};

  function keyName(event) {
    return jQuery.hotkeys.specialKeys[event.which] ||
      String.fromCharCode(event.which).toLowerCase();
  }

  $(document).bind("keydown", function(event) {
    var key = keyName(event);
    if (key == "left"  ||
        key == "up"    ||
        key == "right" ||
        key == "down"  ||
        key == "space")  {
      event.preventDefault();
    }
    keydown[key] = true;
  });

  $(document).bind("keyup", function(event) {
    keydown[keyName(event)] = false;
  });
});


text:
<!DOCTYPE html>
<title>Reference for WebVTT rendering regions, scroll up</title>
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />

This is a second test subtitle
This is a third test subtitle


text:
MOCHA=node_modules/.bin/mocha
ISTANBUL=node_modules/.bin/istanbul
JSHINT=node_modules/.bin/jshint

# test files must end with ".test.js"
TESTS=$(shell find test/ -name "*.test.js")

clean:
	rm -rf reports

test:
	$(MOCHA) -R spec $(TESTS)

coverage:
	@# check if reports folder exists, if not create it
	@test -d reports || mkdir reports
	$(ISTANBUL) instrument --output src-cov src
	@# move original src code and replace it by the instrumented one
	mv src src-orig && mv src-cov src
	@# tell istanbul to only generate the lcov file
	ISTANBUL_REPORTERS=lcovonly $(MOCHA) -R mocha-istanbul $(TESTS)
	@# place the lcov report in the report folder, remove instrumented code
	@# and reput src at its place
	mv lcov.info reports/
	rm -rf src
	mv src-orig src
	genhtml reports/lcov.info --output-directory reports/

jshint:
	$(JSHINT) src test --show-non-errors

checkstyle:
	@# check if reports folder exists, if not create it
	@test -d reports || mkdir reports
	$(JSHINT) src test --reporter=checkstyle > reports/checkstyle.xml

.PHONY: clean test coverage jshint checkstyle


text:
/*
 * UIFrameworkTestMenu.cpp
 *
 *  Created on: May 29, 2017
 *      Author: Psy
 */

#include "UIFrameworkTestMenu.h"
#include "UIFrameworkTest.h"

#include "CBaseUI.h"

UIFrameworkTestMenu::UIFrameworkTestMenu(UIFrameworkTest *app) : UIFrameworkTestScreen(app)
{
	m_UIFrameworkTestSingleCanvas = std::make_shared<UI::Button>(100, 100, 200, 25, "UIFrameworkTestSingleCanvasButton", "Single Canvas");
	m_UIFrameworkTestSingleCanvas->setClickCallback(fastdelegate::MakeDelegate(this, &UIFrameworkTestMenu::loadUIFrameworkTestSingleCanvas));

	m_UIFrameworkTestMultiCanvas = std::make_shared<UI::Button>(100, 200, 200, 25, "UIFrameworkTestMultiCanvasButton", "Multi Canvas");
	m_UIFrameworkTestMultiCanvas->setClickCallback(fastdelegate::MakeDelegate(this, &UIFrameworkTestMenu::loadUIFrameworkTestMultiCanvas));

	m_UIFrameworkTestHorizontalBox = std::make_shared<UI::Button>(100, 300, 200, 25, "UIFrameworkTestHorizontalBox", "Horizontal Box");
	m_UIFrameworkTestHorizontalBox->setClickCallback(fastdelegate::MakeDelegate(this, &UIFrameworkTestMenu::loadUIFrameworkTestHorizontalBox));

	m_UIFrameworkTestVerticalBox = std::make_shared<UI::Button>(100, 400, 200, 25, "UIFrameworkTestVerticalBox", "Vertical Box");
	m_UIFrameworkTestVerticalBox->setClickCallback(fastdelegate::MakeDelegate(this, &UIFrameworkTestMenu::loadUIFrameworkTestVerticalBox));
}

UIFrameworkTestMenu::~UIFrameworkTestMenu()
{

}

void UIFrameworkTestMenu::draw(Graphics *g)
{
	m_UIFrameworkTestSingleCanvas->draw(g);
	m_UIFrameworkTestMultiCanvas->draw(g);
	m_UIFrameworkTestHorizontalBox->draw(g);
	m_UIFrameworkTestVerticalBox->draw(g);
}

void UIFrameworkTestMenu::update()
{
	m_UIFrameworkTestSingleCanvas->update();
	m_UIFrameworkTestMultiCanvas->update();
	m_UIFrameworkTestHorizontalBox->update();
	m_UIFrameworkTestVerticalBox->update();
}

void UIFrameworkTestMenu::loadUIFrameworkTestSingleCanvas()
{
	m_app->m_currentScreen = m_app->m_singleCanvasScreen;
}

void UIFrameworkTestMenu::loadUIFrameworkTestMultiCanvas()
{
	m_app->m_currentScreen = m_app->m_multiCanvasScreen;
}

void UIFrameworkTestMenu::loadUIFrameworkTestHorizontalBox()
{
	m_app->m_currentScreen = m_app->m_horizontalBoxScreen;
}

void UIFrameworkTestMenu::loadUIFrameworkTestVerticalBox()
{
	m_app->m_currentScreen = m_app->m_verticalBoxScreen;
}


text:
namespace DesignBox.Source.Controls
{
    partial class AsymmetricGrid
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Component Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.SuspendLayout();
            //
            // AsymmetricGrid
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.Name = "AsymmetricGrid";
            this.Size = new System.Drawing.Size(341, 282);
            this.Load += new System.EventHandler(this.AsymmetricGrid_Load);
            this.ResumeLayout(false);

        }

        #endregion
    }
}


text:
package org.webcurator.ui.target.validator;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.validation.Errors;
import org.springframework.validation.ValidationUtils;
import org.webcurator.ui.common.validation.AbstractBaseValidator;
import org.webcurator.ui.common.validation.ValidatorUtil;
import org.webcurator.ui.target.command.TargetAnnotationCommand;
import org.webcurator.ui.target.command.TargetInstanceSummaryCommand;
import org.webcurator.ui.target.command.TargetSchedulesCommand;

/**
 * Validate actions on a target instance.
 * @author nwaight
 */
public class QaTiSummaryValidator extends AbstractBaseValidator {

	/** Logger to use with this class. */
    private Log log;

    /** default constructor. */
    public QaTiSummaryValidator() {
        super();
        log = LogFactory.getLog(QaTiSummaryValidator.class);
    }

	/* (non-Javadoc)
	 * @see org.springframework.validation.Validator#supports(java.lang.Class)
	 */
	public boolean supports(Class aClass) {
		return aClass.equals(TargetInstanceSummaryCommand.class);
	}

	/* (non-Javadoc)
	 * @see org.springframework.validation.Validator#validate(java.lang.Object, org.springframework.validation.Errors)
	 */
	public void validate(Object aCommand, Errors aErrors) {
		TargetInstanceSummaryCommand command = (TargetInstanceSummaryCommand) aCommand;
		if (log.isDebugEnabled()) {
            log.debug("Validating target instance summary command.");
        }

		if (command.getCmd() != null && command.getCmd().equals(TargetInstanceSummaryCommand.ACTION_ADD_NOTE) ) {
            ValidationUtils.rejectIfEmptyOrWhitespace(aErrors, TargetInstanceSummaryCommand.PARAM_OID, "required", getObjectArrayForLabel(TargetInstanceSummaryCommand.PARAM_OID), "Target Instance Id is a required field.");
            ValidationUtils.rejectIfEmptyOrWhitespace(aErrors, TargetInstanceSummaryCommand.PARAM_NOTE, "required", getObjectArrayForLabel(TargetInstanceSummaryCommand.PARAM_NOTE), "Annotation is a required field.");
            ValidatorUtil.validateStringMaxLength(aErrors, command.getNote(), TargetAnnotationCommand.CNST_MAX_NOTE_LENGTH, "string.maxlength", getObjectArrayForLabelAndInt(TargetAnnotationCommand.PARAM_NOTE, TargetAnnotationCommand.CNST_MAX_NOTE_LENGTH), "Annotation is too long");
		}

	}

}


text:
function Greeting($scope, $http, $interval) {

	var greetingUpdater = function () {
		if (config.greeting.option == 'time') {
			var hour = moment().hour();
			var greetingTime = "midday";

			if (hour > 4 && hour < 11) {
				greetingTime = "morning";
			} else if (hour > 18 && hour < 23) {
				greetingTime = "evening";
			} else if (hour >= 23 || hour < 4) {
				greetingTime = "night";
			}
			var nextIndex = Math.floor(Math.random() * config.greeting[greetingTime].length);
			var nextGreeting = config.greeting[greetingTime][nextIndex]
			$scope.greeting = nextGreeting;
		} else if (config.greeting.allDay) {
			$scope.greeting = config.greeting.allDay[Math.floor(Math.random() * config.greeting.allDay.length)];
		}
	};

	if (typeof config.greeting !== 'undefined') {
		greetingUpdater();
		$interval(greetingUpdater, config.calendar.refreshInterval * 60000 || 3600000)
	}
}

angular.module('SmartMirror')
    .controller('Greeting', Greeting);


text:
@implementation GraphView

@synthesize dataSource = _dataSource;
@synthesize origin = _origin;
@synthesize scale = _scale;

#define DEFAULT_SCALE 1.;

- (CGFloat)scale
{
    if (!_scale) {
        return self.bounds.size.width/2.1;
    } else {
        return _scale;
    }
}

- (void)setScale:(CGFloat)scale
{
    if (scale != _scale) {
        _scale = scale;
        NSUserDefaults *userDefaults = [[NSUserDefaults alloc] init];
        [userDefaults setFloat:scale forKey:@"scale"];
        [userDefaults synchronize];
        [self setNeedsDisplay];
    }
}

- (void)setOrigin:(CGPoint)origin
{
    if (origin.x != _origin.x || origin.y != _origin.y) {
        _origin = origin;
        NSUserDefaults *userDefaults = [[NSUserDefaults alloc] init];
        [userDefaults setFloat:origin.x forKey:@"origin.x"];
        [userDefaults setFloat:origin.y forKey:@"origin.y"];
        [userDefaults synchronize];
        [self setNeedsDisplay];
    }
}

- (void)pinch:(UIPinchGestureRecognizer*)gesture
{
    if ((gesture.state == UIGestureRecognizerStateChanged) || (gesture.state == UIGestureRecognizerStateEnded)) {
        self.scale *= gesture.scale;
        gesture.scale = 1.;
    }
}

- (void)pan:(UIPanGestureRecognizer*)gesture
{
    if ((gesture.state == UIGestureRecognizerStateChanged) || (gesture.state == UIGestureRecognizerStateEnded)) {
        CGPoint newOrigin;
        newOrigin.x = self.origin.x + [gesture translationInView:self].x/self.scale;
        newOrigin.y = self.origin.y - [gesture translationInView:self].y/self.scale;
        self.origin = newOrigin;
        [gesture setTranslation:CGPointZero inView:self];
    }
}

- (void)tripleTap:(UITapGestureRecognizer*)gesture
{
    CGPoint newOrigin;
    newOrigin.x = -([gesture locationInView:self].x - self.bounds.size.width/2.)/self.scale + self.origin.x;
    newOrigin.y = +([gesture locationInView:self].y - self.bounds.size.height/2.)/self.scale + self.origin.y;
    self.origin = newOrigin;
}

- (void)drawRect:(CGRect)rect
{
    CGContextRef context = UIGraphicsGetCurrentContext();

    [AxesDrawer drawAxesInRect:rect originAtPoint:CGPointMake((0. + self.origin.x)*self.scale + self.bounds.size.width/2., -(0. + self.origin.y)*self.scale + self.bounds.size.height/2.) scale:self.scale];

    for (CGFloat currentPointX = -1.; currentPointX < self.bounds.size.width + 1.; currentPointX += 1./self.contentScaleFactor) {
        float x = (currentPointX - self.bounds.size.width/2.)/self.scale - self.origin.x;
        float y = [self.dataSource functionValueForX:x];
        CGFloat currentPointY = -(y + self.origin.y)*self.scale + self.bounds.size.height/2.;

            //  Drawing with point sized rects

        CGContextAddRect(context, CGRectMake(currentPointX, currentPointY, 1./self.contentScaleFactor, 1./self.contentScaleFactor));
    }
    CGContextStrokePath(context);
}

@end


text:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
            <pattern>
                %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
            </pattern>
        </encoder>
    </appender>

    <root level="INFO">
        <appender-ref ref="CONSOLE"/>
    </root>

    <logger name="org.springframework.web" level="DEBUG"/>
    <logger name="org.antbear" level="DEBUG"/>

</configuration>


text:
from __future__ import (absolute_import, division, print_function,
                        unicode_literals)
from workalendar.core import WesternCalendar, IslamicMixin, ChristianMixin

class IvoryCoast(WesternCalendar, ChristianMixin, IslamicMixin):
    "Ivory Coast"
    include_easter_monday = True
    include_ascension = True
    include_whit_monday = True
    include_assumption = True
    include_all_saints = True
    include_day_after_prophet_birthday = True
    include_eid_al_fitr = True
    include_day_of_sacrifice = True
    include_day_of_sacrifice_label = "Feast of the Sacrifice"

    FIXED_HOLIDAYS = WesternCalendar.FIXED_HOLIDAYS + (
        (5, 1, "Labour Day"),
        (8, 7, "Independence Day"),
        (11, 15, "National Peace Day"),
    )


text:
module.exports = {
    "extends": "airbnb",
    "plugins": [
        "react",
        "jsx-a11y",
        "import"
    ],
    "rules": {
      "react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],
      // These two are turned off due to peerDependencies not being read by ESLint
      "import/no-unresolved": 0,
      "import/extensions": 0,
    },
};


text:
#pragma once

#include "cocos2d.h"
#include <string>
#include "jai_utility/jai_utility.h"

namespace jai { namespace cc_helper {

	using namespace cocos2d;

	class MyScene : public cocos2d::Scene
	{
	protected:
		using cocos2d::Scene::init;
		using cocos2d::Scene::create;
	public:
		MyScene();
	};

	class MyLayer : public cocos2d::Layer
	{
	protected:
		using cocos2d::Layer::init;
		using cocos2d::Layer::create;
	public:
		MyLayer();
	};

	class MyNode : public cocos2d::Node
	{
	protected:
		using cocos2d::Node::init;
		using cocos2d::Node::create;
	public:
		MyNode();
	};

	cocos2d::Rect FixRect(cocos2d::Rect rect, cocos2d::Size size);

	cocos2d::SpriteFrame * LoadFrame(std::string const & image, cocos2d::Rect const & rect);

	auto AddOneByOneTouch
	(cocos2d::EventDispatcher * dispatcher,
	 cocos2d::Node * node, bool swallow,
	 cocos2d::EventListenerTouchOneByOne::ccTouchBeganCallback onTouchBegan,
	 cocos2d::EventListenerTouchOneByOne::ccTouchCallback onTouchMoved,
	 cocos2d::EventListenerTouchOneByOne::ccTouchCallback onTouchEnded
	 ) -> cocos2d::EventListenerTouchOneByOne *;

#define TouchBeganLambda(...) [__VA_ARGS__](CC::Touch* touch, CC::Event* event)->bool
#define TouchLambda(...) [__VA_ARGS__](CC::Touch*touch, CC::Event*event)

} }


text:
@implementation YXTrain

+ (instancetype)trainWithDict:(NSDictionary *)dict
{
    YXTrain *train = [[self alloc]init];
    train.number = dict[@"station_train_code"];
    train.staPlace = dict[@"from_station_name"];
    train.endPlace = dict[@"to_station_name"];
    train.useTime = [NSString stringWithFormat:@"历时:%@",dict[@"lishi"]];
    train.staTime = dict[@"start_time"];
    train.endTime = dict[@"arrive_time"];
    return train;
}

@end


text:
/*! viewportSize | Author: Tyson Matanich, 2013 | License: MIT */
(function(n){n.viewportSize={},n.viewportSize.getHeight=function(){return t("Height")},n.viewportSize.getWidth=function(){return t("Width")};var t=function(t){var f,o=t.toLowerCase(),e=n.document,i=e.documentElement,r,u;return n["inner"+t]===undefined?f=i["client"+t]:n["inner"+t]!=i["client"+t]?(r=e.createElement("body"),r.id="vpw-test-b",r.style.cssText="overflow:scroll",u=e.createElement("div"),u.id="vpw-test-d",u.style.cssText="position:absolute;top:-1000px",u.innerHTML="


text:
<?php
/**
 * WPBakery Visual Composer main class.
 *
 * @package WPBakeryVisualComposer
 * @since   4.2
 */

/**
 * Edit form for shortcodes with ability to manage shortcode attributes in more convenient way.
 *
 * @since   4.2
 */
class Vc_Shortcode_Edit_Form implements Vc_Render {
	/**
	 *
	 */
	public function init() {
		/**
		 * @deprecated Please use vc_edit_form hook.
		 */
		add_action( 'wp_ajax_wpb_show_edit_form', array( &$this, 'build' ) );
		add_action( 'wp_ajax_vc_edit_form', array( &$this, 'renderFields' ) );

		add_filter( 'vc_single_param_edit', array( &$this, 'changeEditFormFieldParams' ) );
		add_filter( 'vc_edit_form_class', array( &$this, 'changeEditFormParams' ) );
	}

	/**
	 *
	 */
	public function render() {
		vc_include_template( 'editors/popups/panel_shortcode_edit_form.tpl.php', array(
			'box' => $this
		) );
	}

	/**
	 * Build edit form fields.
	 *
	 * @since 4.4
	 */
	public function renderFields() {
		$params = stripslashes_deep( vc_post_param( 'params' ) );
		$tag = stripslashes( vc_post_param( 'tag' ) );
		require_once vc_path_dir( 'EDITORS_DIR', 'class-vc-edit-form-fields.php' );
		$fields = new Vc_Edit_Form_Fields( $tag, $params );
		$fields->render();
		die();
	}

	/**
	 * Build edit form fields
	 *
	 * @deprecated 4.4
	 * @use Vc_Shortcode_Edit_Form::renderFields
	 */
	public function build() {
		$tag = vc_post_param( 'element' );
		$shortCode = stripslashes( vc_post_param( 'shortcode' ) );
		$fields = new Vc_Edit_Form_Fields( $tag, shortcode_parse_atts( $shortCode ) );
		$fields->render();
		die();
	}

	/**
	 * @param $param
	 *
	 * @return mixed
	 */
	public function changeEditFormFieldParams( $param ) {
		$css = $param['vc_single_param_edit_holder_class'];
		if ( isset( $param['edit_field_class'] ) ) {
			$new_css = $param['edit_field_class'];
		} else {
			switch ( $param['type'] ) {
				case 'attach_image':
				case 'attach_images':
				case 'textarea_html':
					$new_css = 'vc_col-sm-12 vc_column';
					break;
				default:
					$new_css = 'vc_col-sm-12 vc_column';
			}
		}
		array_unshift( $css, $new_css );
		$param['vc_single_param_edit_holder_class'] = $css;

		return $param;
	}

	/**
	 * @param $css_classes
	 *
	 * @return mixed
	 */
	public function changeEditFormParams( $css_classes ) {
		$css = 'vc_row';
		array_unshift( $css_classes, $css );

		return $css_classes;
	}
}


text:
package io.kubernetes.client.extended.workqueue;

import io.kubernetes.client.extended.workqueue.ratelimiter.DefaultControllerRateLimiter;
import io.kubernetes.client.extended.workqueue.ratelimiter.RateLimiter;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/** The default rate limiting queue implementation. */
public class DefaultRateLimitingQueue<T> extends DefaultDelayingQueue<T>
    implements RateLimitingQueue<T> {

  private RateLimiter<T> rateLimiter;

  public DefaultRateLimitingQueue() {
    this(Executors.newSingleThreadExecutor());
  }

  public DefaultRateLimitingQueue(ExecutorService waitingWorker) {
    this(waitingWorker, new DefaultControllerRateLimiter<>());
  }

  public DefaultRateLimitingQueue(ExecutorService waitingWorker, RateLimiter<T> rateLimiter) {
    super(waitingWorker);
    this.rateLimiter = rateLimiter;
  }

  @Override
  public int numRequeues(T item) {
    return rateLimiter.numRequeues(item);
  }

  @Override
  public void forget(T item) {
    rateLimiter.forget(item);
  }

  @Override
  public void addRateLimited(T item) {
    super.addAfter(item, rateLimiter.when(item));
  }
}


text:
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;

using SpartaHack.BLL.APICalls;
using SpartaHack.BLL.Models;
using SpartaHack.MVVM;
using Windows.UI.Xaml.Media.Animation;

// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238

namespace SpartaHack
{
    /// <summary>
    /// An empty page that can be used on its own or navigated to within a Frame.
    /// </summary>
    public sealed partial class SponsorPage : Page
    {
        private SpartaHackSponsor _sponsorCaller;

        public SponsorPage()
        {
            this.InitializeComponent();
            MainPage.Title.Value = "Sponsors";
            _sponsorCaller = new SpartaHackSponsor();

            init();
            DataContext = this;

        }
        public async void init()
        {
            try
            {
                Sponsors.Source = _sponsorCaller.getLocalSponsorsGrouped();
                btnRefresh.IsRefreshing = true;
                Sponsors.Source = await _sponsorCaller.getSponsorsGrouped();
            }
            catch { }
            btnRefresh.IsRefreshing = false;
        }
        private void RefreshButton_RefreshClicked(object sender, RoutedEventArgs e)
        {
            init();
        }
    }
}


text:
from __future__ import absolute_import

from google.appengine.api import users
import flask

import auth
import model
import util

from main import app

@app.route('/signin/google/')
def signin_google():
    auth.save_request_params()
    google_url = users.create_login_url(flask.url_for('google_authorized'))
    return flask.redirect(google_url)

@app.route('/_s/callback/google/authorized/')
def google_authorized():
    google_user = users.get_current_user()
    if google_user is None:
        flask.flash('You denied the request to sign in.')
        return flask.redirect(flask.url_for('index'))

    user_db = retrieve_user_from_google(google_user)
    return auth.signin_via_social(user_db)

def retrieve_user_from_google(google_user):
    auth_id = 'federated_%s' % google_user.user_id()
    user_db = model.User.get_by('auth_ids', auth_id)
    if user_db:
        if not user_db.admin and users.is_current_user_admin():
            user_db.admin = True
            user_db.put()
        return user_db

    return auth.create_or_get_user_db(
        auth_id=auth_id,
        name=util.create_name_from_email(google_user.email()),
        username=google_user.email(),
        email=google_user.email(),
        verified=True,
        admin=users.is_current_user_admin(),
    )


text:
package proguard.classfile.constant;

import proguard.classfile.*;
import proguard.classfile.constant.visitor.ConstantVisitor;

/**
 * This abstract class represents an entry in the ConstantPool. Specific types
 * of entries are subclassed from it.
 *
 * @author Eric Lafortune
 */
public abstract class Constant implements VisitorAccepter
{
    //public int  u1tag;
    //public byte info[];

    /**
     * An extra field in which visitors can store information.
     */
    public Object visitorInfo;

    // Abstract methods to be implemented by extensions.

    /**
     * Returns the constant pool info tag that specifies the entry type.
     */
    public abstract int getTag();

    /**
     * Accepts the given visitor.
     */
    public abstract void accept(Clazz clazz, ConstantVisitor constantVisitor);

    // Implementations for VisitorAccepter.

    public Object getVisitorInfo()
    {
        return visitorInfo;
    }

    public void setVisitorInfo(Object visitorInfo)
    {
        this.visitorInfo = visitorInfo;
    }
}


text:
'use strict';

// Configuring the Budgets module
angular.module('budgets').run(['Menus',
	function(Menus) {
		// Set top bar menu items
		Menus.addMenuItem('topbar', 'Budgets', 'budgets', 'dropdown', '/budgets(/create)?');
		Menus.addSubMenuItem('topbar', 'budgets', 'List Budgets', 'budgets');
		Menus.addSubMenuItem('topbar', 'budgets', 'New Budget', 'budgets/create');
	}
]);


text:
import API from '../utils/api.js';
import request from '../utils/request';
import logErrorMessage from '../utils/log_error_message';

import { RECEIVE_INITIAL_CAMPAIGN, CREATED_COURSE, RECEIVE_COURSE_CLONE, API_FAIL } from '../constants';

const fetchCampaignPromise = async (slug) => {
  const response = await request(`/campaigns/${slug}.json`);
  if (!response.ok) {
    logErrorMessage(response);
    const data = await response.text();
    response.responseText = data;
    throw response;
  }
  return response.json();
};

export const fetchCampaign = slug => (dispatch) => {
  return fetchCampaignPromise(slug)
    .then(resp => dispatch({ type: RECEIVE_INITIAL_CAMPAIGN, data: resp }))
    .catch(resp => dispatch({ type: API_FAIL, data: resp }));
};

export const submitCourse = (course, failureCallback) => (dispatch) => {
  return API.saveCourse(course, null)
    .then(resp => dispatch({ type: CREATED_COURSE, data: resp }))
    .catch((resp) => {
      failureCallback();
      dispatch({ type: API_FAIL, data: resp });
    });
};

export const cloneCourse = (courseId, campaign) => (dispatch) => {
  return API.cloneCourse(courseId, campaign)
    .then(resp => dispatch({ type: RECEIVE_COURSE_CLONE, data: resp }))
    .catch(resp => dispatch({ type: API_FAIL, data: resp }));
};


text:
package com.google.sps.data;

// using SendGrid's Java Library
// https://github.com/sendgrid/sendgrid-java
import com.sendgrid.Method;
import com.sendgrid.Request;
import com.sendgrid.Response;
import com.sendgrid.SendGrid;
import com.sendgrid.helpers.mail.Mail;
import com.sendgrid.helpers.mail.objects.Content;
import com.sendgrid.helpers.mail.objects.Email;
import java.io.IOException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.net.URL;

// Handles sending emails.
@WebServlet("/email")
public class SendgridEmailSender implements EmailSender {
  private final Email sender;
  private final SendGrid sg;

  public SendgridEmailSender(Email sender) throws IOException {
    this.sender = sender;
    this.sg =
        new SendGrid(
            new SecretFetcher("interview-me-step-2020").getSecretValue("SENDGRID_API_KEY"));
  }

  // Sends an email from the "sender" Email to the "recipient" Email, with specified subject and
  // content. Returns a response from the sendgrid email sending service.
  @Override
  public int sendEmail(Email recipient, String subject, Content content) throws IOException {
    Mail mail = new Mail(sender, subject, recipient, content);

    Request request = new Request();
    Response response;
    request.setMethod(Method.POST);
    request.setEndpoint("mail/send");
    request.setBody(mail.build());
    response = sg.api(request);
    return response.getStatusCode();
  }
}


text:
package org.apache.carbondata.core.util.comparator;

public class ShortSerializableComparator implements SerializableComparator {
  @Override
  public int compare(Object key1, Object key2) {
    if (key1 == null && key2 == null) {
      return 0;
    } else if (key1 == null) {
      return -1;
    } else if (key2 == null) {
      return 1;
    }
    return Short.compare((short) key1, (short) key2);
  }
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="generator" content="rustdoc">
    <meta name="description" content="API documentation for the Rust `BallInSocket` struct in crate `nphysics2d`.">
    <meta name="keywords" content="rust, rustlang, rust-lang, BallInSocket">

    <title>nphysics2d::detection::joint::BallInSocket - Rust</title>

    <link rel="stylesheet" type="text/css" href="../../../normalize.css">
    <link rel="stylesheet" type="text/css" href="../../../rustdoc.css">
    <link rel="stylesheet" type="text/css" href="../../../main.css">

nphysics2d::<wbr>detection::<wbr>joint

        <form class="search-form js-only">

                <input class="search-input" name="search"
                       autocomplete="off"
                       placeholder="Click or press 'S' to search, '?' for more options…"
                       type="search">

        </form>

Struct nphysics2d::<wbr>detection::<wbr>joint::<wbr>BallInSocket

                       [−]

               [src]

pub struct BallInSocket<N: Real> { /* fields omitted */ }

A ball-in-socket joint.

This is usually used to create ragdolls.

Methods

impl<N: Real> BallInSocket<N>

[src]

fn new(anchor1: Anchor<N, Point<N>>,
       anchor2: Anchor<N, Point<N>>)
       -> BallInSocket<N>

Creates a ball-in-socket joint.

fn up_to_date(&self) -> bool

Tells if this joint has been modified by the user.

fn set_local1(&mut self, local1: Point<N>)

Sets the the second anchor position.

The position is expressed in the second attached body's local coordinates.

fn set_local2(&mut self, local2: Point<N>)

Sets the the second anchor position.

The position is expressed in the second attached body's local coordinates.

Trait Implementations

impl<N: Real> Joint<N, Point<N>> for BallInSocket<N>

[src]

fn anchor1(&self) -> &Anchor<N, Point<N>>

The first anchor affected by this joint.

fn anchor2(&self) -> &Anchor<N, Point<N>>

The second anchor affected by this joint.

fn anchor1_pos(&self) -> Point<N>

The first attach point in global coordinates.

fn anchor2_pos(&self) -> Point<N>

The second attach point in global coordinates.

Help

Keyboard Shortcuts

?

Show this help dialog

S

Focus the search field

⇤

Move up in search results

⇥

Move down in search results

⏎

Go to active search result

+

Collapse/expand all sections

Search Tricks

                    Prefix searches with a type followed by a colon (e.g.
                    fn:) to restrict the search to a given type.

                    Accepted types are: fn, mod,
                    struct, enum,
                    trait, type, macro,
                    and const.

                    Search functions by type signature (e.g.
                    vec -> usize or * -> vec)


text:
ephFrame is a minimalistic framework for PHP build to use as many SPL classes and provide a MVC structure.

[![Build Status](https://secure.travis-ci.org/Ephigenia/ephFrame.png?branch=master)](http://travis-ci.org/Ephigenia/ephFrame)


text:
export getHybridKaczmarzPrecond,getHybridKaczmarz, getHybridKaczmarzParam
const parRelax_lib  = abspath(joinpath(splitdir(Base.source_path())[1],"../..","deps","builds","parRelax"))

const ArrIdxsType = UInt32;

mutable struct hybridKaczmarz{VAL,IND}
	numDomains 	:: Array{Int64,1}
	invDiag 	:: Array
	numCores	:: Int64
	omega_damp	:: Float64
	ArrIdxs 	:: Array{ArrIdxsType,2}
	precond 	:: Function
	numit 		:: Int64
end

mutable struct hybridKaczmarzParams
	numDomains 	:: Array{Int64,1}
	numCores	:: Int64
	omega_damp	:: Float64
	numit 		:: Int64
end

import Base.copy
function copy(p::hybridKaczmarzParams)
	return hybridKaczmarzParams(p.numDomains,p.numCores,p.omega_damp,p.numit);
end

function getHybridKaczmarzParam(numDomains::Array{Int64,1},omega_damp::Float64,numCores::Int64,numit::Int64)
	return hybridKaczmarzParams(numDomains,numCores,omega_damp,numit);
end

function getHybridKaczmarz(VAL::Type,IND::Type,AT::SparseMatrixCSC,Mesh::RegularMesh, numDomains::Array{Int64,1},
						getIndicesOfCell::Function,omega_damp::Float64,numCores::Int64,numit::Int64)
if prod(numDomains) < numCores
	println("*** WARNING: getHybridKaczmarz: numDomains < numCores. ***");
end
invDiag = convert(Array{VAL,1},omega_damp./(vec(sum(conj(AT).*AT,dims=1))));
ArrIdxs = getIndicesOfCellsArray(Mesh, zeros(Int64,size(numDomains)),numDomains,getIndicesOfCell);
return hybridKaczmarz{VAL,IND}(numDomains,invDiag,numCores,omega_damp,ArrIdxs,identity,numit);
end

function getHybridKaczmarzPrecond(param::hybridKaczmarz{VAL,IND},AT::SparseMatrixCSC{VAL,IND},nrhs::Int64) where {VAL,IND}
# void applyHybridKaczmarz(spIndType *rowptr , spValType *valA ,spIndType *colA, long long numDomains, long long domainLength ,
						# unsigned int *ArrIdxs, spValType *x, spValType *b, spValType *invD,long long numit, long long numCores){
x = zeros(VAL,size(AT,2),nrhs);
numDomains = prod(param.numDomains);
param.precond = (r)->(x[:].=0.0;applyHybridKaczmarz(param::hybridKaczmarz{VAL,IND},AT::SparseMatrixCSC{VAL,IND},r::Array{VAL},x::Array{VAL},numDomains);return x;);
return param.precond;
end

function applyHybridKaczmarz(param::hybridKaczmarz{Float64,Int64},AT::SparseMatrixCSC{Float64,Int64},r::Array{Float64},x::Array{Float64},numDomains)
	ccall((:applyHybridKaczmarz_FP64_INT64,parRelax_lib),Nothing,(Ptr{Int64},Ptr{Float64},Ptr{Int64},Int64,Int64,Ptr{ArrIdxsType},Ptr{Float64},Ptr{Float64},Int64,Int64,Ptr{Float64},Int64,Int64,),
		AT.colptr,AT.nzval,AT.rowval,numDomains,size(param.ArrIdxs,1),param.ArrIdxs,x,r,size(r,2),size(r,1),param.invDiag,param.numit,param.numCores);
end

function applyHybridKaczmarz(param::hybridKaczmarz{Float32,Int64},AT::SparseMatrixCSC{Float32,Int64},r::Array{Float32},x::Array{Float32},numDomains)
	ccall((:applyHybridKaczmarz_FP32_INT64,parRelax_lib),Nothing,(Ptr{Int64},Ptr{Float32},Ptr{Int64},Int64,Int64,Ptr{ArrIdxsType},Ptr{Float32},Ptr{Float32},Int64,Int64,Ptr{Float32},Int64,Int64,),
		AT.colptr,AT.nzval,AT.rowval,numDomains,size(param.ArrIdxs,1),param.ArrIdxs,x,r,size(r,2),size(r,1),param.invDiag,param.numit,param.numCores);
end

function applyHybridKaczmarz(param::hybridKaczmarz{ComplexF64,Int64},AT::SparseMatrixCSC{ComplexF64,Int64},r::Array{ComplexF64},x::Array{ComplexF64},numDomains)
	ccall((:applyHybridKaczmarz_CFP64_INT64,parRelax_lib),Nothing,(Ptr{Int64},Ptr{ComplexF64},Ptr{Int64},Int64,Int64,Ptr{ArrIdxsType},Ptr{ComplexF64},Ptr{ComplexF64},Int64,Int64,Ptr{ComplexF64},Int64,Int64,),
		AT.colptr,AT.nzval,AT.rowval,numDomains,size(param.ArrIdxs,1),param.ArrIdxs,x,r,size(r,2),size(r,1),param.invDiag,param.numit,param.numCores);
end

function applyHybridKaczmarz(param::hybridKaczmarz{ComplexF32,Int64},AT::SparseMatrixCSC{ComplexF32,Int64},r::Array{ComplexF32},x::Array{ComplexF32},numDomains)
	ccall((:applyHybridKaczmarz_CFP32_INT64,parRelax_lib),Nothing,(Ptr{Int64},Ptr{ComplexF32},Ptr{Int64},Int64,Int64,Ptr{ArrIdxsType},Ptr{ComplexF32},Ptr{ComplexF32},Int64,Int64,Ptr{ComplexF32},Int64,Int64,),
		AT.colptr,AT.nzval,AT.rowval,numDomains,size(param.ArrIdxs,1),param.ArrIdxs,x,r,size(r,2),size(r,1),param.invDiag,param.numit,param.numCores);
end

# function applyHybridKaczmarz(param::hybridKaczmarz{VAL,IND},AT::SparseMatrixCSC{VAL,IND},b::Array{VAL},x::Array{VAL},numDomains)
	# ccall((:applyHybridKaczmarz,parRelax_lib),Nothing,(Ptr{Int64},Ptr{spValType},Ptr{Int64},Int64,Int64,Ptr{ArrIdxsType},Ptr{spValType},Ptr{spValType},Ptr{spValType},Int64,Int64,),
		# AT.colptr,AT.nzval,AT.rowval,numDomains,size(ArrIdxs,1),param.ArrIdxs,x,r,param.invDiag,param.numit,param.numCores);
# end


text:
<!--
  Copyright 2014 Federico Iosue (federico.iosue@gmail.com)

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:pixlui="http://schemas.android.com/apk/com.neopixl.pixlui"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <it.feio.android.omninotes.models.views.InterceptorLinearLayout
        android:id="@+id/list_root"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical" >

        <LinearLayout
            android:id="@+id/search_layout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:visibility="gone"
            android:paddingLeft="16dp"
            android:paddingTop="6dp"
            android:paddingRight="16dp"
            android:paddingBottom="6dp">

<!--             <com.neopixl.pixlui.components.textview.TextView -->
                <TextView
                android:id="@+id/search_query"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1" />

            <ImageView
                android:id="@+id/search_cancel"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:src="@drawable/ic_action_cancel" />
        </LinearLayout>

        <ListView
            android:id="@+id/notes_list"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:divider="@null"
            android:dividerHeight="8dp"
            android:paddingLeft="8dp"
            android:paddingRight="8dp"
            android:scrollbarSize="4dp"
            android:drawSelectorOnTop="true"
            android:listSelector="@drawable/icon_selector"
            android:scrollbarStyle="outsideOverlay"
            android:scrollbarThumbVertical="@drawable/scroll_bar"
            android:fastScrollEnabled="true" >
        </ListView>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:gravity="center" >

            <com.neopixl.pixlui.components.textview.TextView
                android:id="@+id/empty_list"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:drawablePadding="10dp"
                android:drawableTop="@animator/jingles_animation"
                android:gravity="center"
                android:text="@string/no_items_in_list"
                android:textColor="@color/list_note_dates"
                android:textSize="20sp"
                android:visibility="gone"
                pixlui:typeface="Roboto-Regular.ttf" />
        </LinearLayout>
    </it.feio.android.omninotes.models.views.InterceptorLinearLayout>

    <LinearLayout
        android:id="@+id/undobar"
        style="@style/UndoBar"
        android:orientation="horizontal"
        android:visibility="gone" >

        <TextView
            android:id="@+id/undobar_message"
            style="@style/UndoBarMessage" />

        <View style="@style/UndoBarDivider" />

        <Button
            android:id="@+id/undobar_button"
            style="@style/UndoBarButton" />
    </LinearLayout>

</FrameLayout>


text:
require 'tilt/template'

module Tilt
  # RedCloth implementation. See:
  # http://redcloth.org/
  class RedClothTemplate < Template
    def self.engine_initialized?
      defined? ::RedCloth
    end

    def initialize_engine
      require_template_library 'redcloth'
    end

    def prepare
      @engine = RedCloth.new(data)
      @output = nil
    end

    def evaluate(scope, locals, &block)
      @output ||= @engine.to_html
    end
  end
end


text:
class AddHostedToServices < ActiveRecord::Migration[5.0]
  def change
    add_column :services, :hosted, :boolean, default: true
  end
end


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Boost.Geometry (aka GGL, Generic Geometry Library)</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">

Main Page

Related Pages

Modules

Namespaces

Classes

Files

Examples

Class List

Class Index

Class Hierarchy

Class Members

boost

geometry

resolve_strategy

default_length_result

Public Types |
List of all members

boost::geometry::resolve_strategy::default_length_result< Geometry > Struct Template Reference

Inheritance diagram for boost::geometry::resolve_strategy::default_length_result< Geometry >:

  <map id="boost::geometry::resolve_strategy::default_length_result< Geometry >_map" name="boost::geometry::resolve_strategy::default_length_result< Geometry >_map">
<area href="structboost_1_1geometry_1_1resolve__variant_1_1default__length__result.html" alt="boost::geometry::resolve_variant::default_length_result< Geometry >" shape="rect" coords="0,56,401,80"/>
<area href="structboost_1_1geometry_1_1default__length__result.html" title="Meta-function defining return type of length function. " alt="boost::geometry::default_length_result< Geometry >" shape="rect" coords="0,112,401,136"/>
</map>

Public Types

typedef select_most_precise

< typename coordinate_type

< Geometry >::type, long

double >::type 	type

Member Typedef Documentation

template<typename Geometry >

          typedef select_most_precise< typename coordinate_type<Geometry>::type, long double >::type boost::geometry::resolve_strategy::default_length_result< Geometry >::type

April 2, 2011

Copyright © 2007-2011 Barend Gehrels, Amsterdam, the Netherlands

Copyright © 2008-2011 Bruno Lalande, Paris, France

Copyright © 2009-2010 Mateusz Loskot, London, UK

<address style="text-align: right;">
Documentation is generated by Doxygen
</address>


text:
import pytest

from bravado.client import SwaggerClient

# TODO: remove
if False:
    import logging
    logging.basicConfig()
    logging.getLogger().setLevel(logging.DEBUG)

@pytest.fixture
def petstore():
    return SwaggerClient.from_url('http://petstore.swagger.io/v2/swagger.json')


text: raphael test


text:
var config = Formatic.createConfig(Formatic.plugins.bootstrap);

// Create some fields.
var fields = [
  {
    type: 'copy',
    helpTextHtml: 'Be cool. Stay in school.'
  }
];

// Render the form.
React.render(
  <Formatic config={config} fields={fields} onChange={this.onChangeValue}/>
, mountNode);


text:
#ifndef ELEMENT_TABLE_WIDGET_H
#define ELEMENT_TABLE_WIDGET_H

#include <QTableWidget>

#include <ui_client/elements/types/element_ui_base.h>

class ElementTableWidget
{
  public:
    ElementTableWidget();
    ~ElementTableWidget();

    /**
     * @brief getRepresentation
     * @return
     */
    inline QTableWidget*
    getRepresentation(void)
    {
      return table_;
    }

    // add element
    void
    addElement(const ElementUIBase* element);

    // remove element

    // clear
    void
    clear(void);

    // select next
    void
    selectNext(void);

    // select previous
    void
    selectPrevious(void);

    // unselect current
    void
    unselectCurrent(void);

    bool
    hasSelected(void) const;

    // get selected
    const ElementUIBase*
    selected(void) const;

  private:

    /**
     * @brief configureTable internally
     */
    void
    configureTable(void);

    /**
     * @brief getTypeItem
     * @param element
     * @return
     */
    QTableWidgetItem*
    getTypeItem(const ElementUIBase* element) const;

  private:
    QTableWidget* table_;

};

#endif // ELEMENT_TABLE_WIDGET_H